Network Basics
Network Basics
CE 367R
INTRODUCTION
A network is a mathematical object consisting of nodes connected by links.
1 4
The set of nodes is N, the set of links is A, and the network is denoted
G = (N, A)
Park-and-ride Park-and-ride
Roadway link
Bus route Bus route link
Transfer link
Tens (or even hundreds) of thousands of links and nodes are not
uncommon. We need systematic methods for working with networks.
Network concepts Introduction
NETWORK TERMINOLOGY
Nodes are typically denoted i, j, etc.
Links are typically denoted (i, j), where i is the upstream node (the tail)
and j is the downstream node (the head).
The total number of nodes in the network is denoted n, and the total
number of links is m.
The forward star of a node i is the set of links whose tail is i. This is
denoted A(i)
The reverse star of a node i is the set of links whose head is i. This is
denoted B(i).
We will assume that there are no “self-loops” (i, i), and no “parallel links,”
so (i, j) only refers to one link.
In an undirected network, “path” and “undirected path” are the same thing,
as are “cycle” and “undirected cycle.”
A link (i, j) may have a flow xij , a cost cij per unit of flow, and a capacity
uij . (Rarely, a link may have a lower bound `ij on its flow.)
Identify a path connecting a given origin and destination, where the total
cost of the links in the path is minimized.
Vehicle routing
Critical path analysis in project management
Six degrees of Kevin Bacon
What is the greatest amount of flow that can be shipped between a given
source and sink without exceeding link capacities?
Respecting capacities, find link flows which balance supply and demand
among sources and sinks, with minimum total cost.
Find a path which passes through all nodes and returns to the origin with
minimum total cost.
Given a network G = (N, A) and an origin node s, find all of the nodes in
N which can be reached from s by a path. Furthermore, for each node
which is reachable, identify a path from s to that node.
Each node will either be marked or unmarked. Marked nodes are reachable
from s, unmarked nodes may or may not be (we do not know).
Each marked node has a predecessor pred, indicating the last node on a
path from the origin to that node. This turns out to be enough to
represent the requested paths.
We also maintain a scan eligible list SEL, a set of nodes that we still need
to check before we are done.
1 Mark node j
2 Set pred(j) = i
3 Add j to SEL.
6 If SEL is empty, then stop. Otherwise return to step 4.
Upon termination, all marked nodes are reachable from s and all unmarked
nodes are unreachable.
1 4
This is good for visualization, but not very convenient when working with
large networks, if you want to communicate them to others, or for
computers.
−1 −1 0 0 0
1
0 −1 −1 0
0 1 1 0 −1
0 0 0 1 1
The node-link incidence matrix has a row for each node, and a column
for each link. In each column, there is a −1 in the row for the tail, a +1 in
the row for the head, and 0 everywhere else.
c = [3,2,1,5,4]
b = [1,0,-2,1]
Answer: Use vectors with m components to store link data, and vectors
with n components to store node data.
0 1 1 0
0 0 1 1
0 0 0 1
0 0 0 0
This matrix has a row for each node, and a column for each node. The
entry in row i and column j is 1 if (i, j) is a link, and zero otherwise.
So, it seems that usually m ≥ n, suggesting that the node-node matrix uses
less memory to store the same information.
A useful fact: if limn→∞ f (n)/g (n) < ∞, then f (n) is O(g (n)). This is a
faster way to do these examples.
The lessons: the approximation may only work when n is very large; and it
may not be the tightest bound possible.
Also note that we are talking about the worst case! In many networks m
grows at roughly the same rate as n, in which case the node-link matrix
grows as n2 .
How could you find a link’s forward star using the node-node adjacency
matrix? How many steps are required?
The forward star representation orders the links based on their tail
node. We then have vectors tail and head, where link a connects
tail(a) to head(a).
How would you find a link’s forward star using this representation? How
many steps are required in the worst case?
It would be nice to say that the forward star of i is always the links
between point(i) and point(i + 1) - 1, inclusive.
Represent this as a network problem. Can you solve this puzzle? Can you
think of a systematic way to solve this kind of puzzle?
Network concepts Back to network representations...