You are on page 1of 44

Lecture Day 7

Networks
Shortest-Route Problem
Minimum Spanning Tree Problem
Maximal Flow Problem
Networks
A network is a collection
of nodes or points
connected by arcs.
What is a
Network?
Many real-world problems
have a network structure or
can be modeled in network
form.
Examples:
Why are Physical distribution systems
Communication networks
Networks Pipeline systems

important? City streets and traffic signals


Airline flight legs
Production assembly line systems

Network models are important


due to their solution efficiency.
Network models are at the
problem-solving frontiers
in terms of problem size and
solution speed.
The objective of this algorithm
is to find the shortest route
along arcs from one node
to one or more other nodes
in the network.
(The arcs usually represent
The distances, but can also
Shortest-Route represent times or costs).
This algorithm consists of two
Problem parts, a labeling procedure
to determine the shortest
distance from the first node
to every other node, and a
backtracking procedure
to determine the actual route
from the first node to any other
node.
Assuming that Node 1 is the
Head Office (HO) and the
other nodes represent the
companys branch offices
The objective is to determine
the shortest distance from the
HO to any of the branch offices
Example 40
7
2

10 5
15
1 3 12

4 6
20
1. Compute the distance from the
first node to all other nodes
that are connected directly to
the first node. Label the nodes
temporarily.

Steps Involved
40
The labels for the 7
nodes consist of an 2
ordered pair of 10 5
numbers, where the
first number indicates 1
15
3 12
the distance from the
first node, and the
second number 8
indicates the preceding
node on the route from 4 6
the first node. 20
2. Set the distance portion of the
temporarily labeled nodes equal
to the distance to the first
node. Set the predecessor
portion of their labels equal to
node 1.

Steps Involved (20, 1) 40


The labels for the 7
nodes consist of an 2
ordered pair of 10 5
numbers, where the
first number indicates 15 (15, 1) 12
1 3
the distance from the
first node, and the
second number 8
indicates the preceding
node on the route from 4 6
the first node. 20
(25, 1)
3. Permanently label the temporarily
labeled node whose distance from
node 1 is minimum. Break ties
(if any) arbitrarily.

Steps Involved (20, 1) 40


7
2

10 5
15 (15, 1) 12
1 3

4 6
20
(25, 1)
4. Identify all unlabeled or temporarily
labeled nodes that can be reached
directly from the new permanently
labeled node. Compute the new
distance for the node reached
by adding the distance label
of the permanently labeled node
Steps Involved to the distance from the permanently
labeled node to the node in question.
If the node in question is unlabeled,
temporarily label it with the newly
calculated distance. If the node in
question is already temporarily
labeled, update its current distance
label only if the newly calculated
distance is less that its previous
distance label. For any node whose
distance label is updated, set its
predecessor label equal to the new
permanently labeled node.
(20, 1) 40
7
2

10 5
15 (15, 1)
1 3 12

4 6
20
(25, 1)
(20, 1) 40
7
2

10 5
15 (15, 1)
1 3 12

4 6
20
(23, 3) (45, 3)
(60, 2)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (45, 3)
(60, 2)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (45, 3)
(60, 2)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (43, 4)
(60, 2)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (43, 4)
(49, 5)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (43, 4)
(49, 5)
(20, 1) 40
7
2

10 5
15
(40, 2)
(15, 1) 12
1 3

4 6
20
(23, 3) (43, 4)
(49, 5)
5. After the labeling (20, 1) 40
process, each node 7
other than node 1 2
will have a
permanent distance 10 5
and predecessor label. 15
(40, 2)
(15, 1) 12
To determine the 1 3
shortest route from
node 1 to any other 8
node, say node j,
refer to the 4 6
predecessor label for 20
node j until you reach (23, 3) (43, 4)
back to node 1.
This algorithm involves the
selection of a set of arcs that
will span (connect) all nodes of
a network and will minimize the
The sum of the arc lengths. This
differs from the shortest-route
Minimum problem in that the arcs of the
Spanning Tree network do not yet exist and
are still to be selected.
Problem
This problem is particularly
useful in designing
transportation systems in which
the nodes of the network are
The terminals and the arcs
represent highways, pipelines,
Minimum airways, etc. This is also
Spanning Tree applicable to communication
and teleprocessing systems.
Problem
The type of structure that will
connect all nodes in a network
and be of minimal length is a
tree. A tree is a graph in which
The the arcs connect all nodes
(that is, provide paths along
Minimum which one node can eventually
Spanning Tree reach any other node) and
form no closed loops.
Problem
A tree has the property that if it
spans a network graph with n
nodes, the tree will always
contain n-1 arcs.
The minimum spanning tree
algorithm is a type of greedy
algorithm because each step
being greedy, that is, selecting
The the minimal-length arc, will
lead to an optimal solution.
Minimum
This type of problem cannot be
Spanning Tree solved as an LP problem.
Problem
Assuming that the nodes
represent dams and the arcs
are potential pipeline
connections (in miles)
The objective is to determine
the shortest length of pipes
necessary to connect the dams
Example
120
2 5

80 200
1 3 7

4 6
90
Steps Involved:
1. Start with any node and select the shortest arc
leading to any other node. This forms a
connected segment of two nodes.
2. Select the shortest arc leading from the
connected segment to the unconnected segment
of arcs.
3. Add the unconnected node of the newly selected
arc to the list of connected nodes and delete it
from the list of unconnected nodes. If all nodes
are connected, stop; otherwise, go back to
Step 2.
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90
120
2 5

80 200
1 3 7

4 6
90

Shortest length of pipes needed = 360 miles


The objective of this algorithm
is to determine the maximum
amount of flow (fluid, traffic,
information, etc.) that can be
transmitted through the nodes
The and arcs of a network.
Maximal Flow This algorithm has applications
in areas such as the study of
Problem traffic flow, pipeline design,
communication network design,
and distribution systems. It is
particularly helpful in capacity
planning for these types of
systems.
In this algorithm, we assume a
single input node called the
source and a single output
node called the sink; all flows
commence at the source and
terminate at the sink.
The
The maximal flow is characterized
Maximal Flow by the arcs of the network having
Problem finite capacities that limit the
amount of flow that can pass
through the arc in a given amount
of time. The problem is to
determine the amount of flow
across each arc (subject to
capacity restrictions) that will
permit the maximal total flow from
source to sink.
Assuming that this is the street
network of a small village
where Node 1 is the entrance
Example and Node 7 is the exit.
The objective is to determine
the number of cars that the
network can accommodate.
2 3
2 5
2

6 0 4 0
1 3 7

2
4 6
2 1
Steps Involved:
1. Find a path from source node to sink node with
positive flow capacity. If no paths with positive flow
capacity exist, stop, for the current flows are optimal.
2. Determine the arc in the path with minimum flow
capacity, Cmin. Increase the flow along the path by
Cmin.
The maximum amount that can flow from source to
sink along a given path is equal to the minimum
available capacity on any arc in the path.
3. Decrease the capacities in the direction of flow by Cmin
for all arcs in the path. Increase the capacities in the
opposite direction by Cmin for all arcs in the path. Go
back to Step 1.
2 3
2 5
2
2 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin
1-3-7 4
0 5
2 3
2 5
2
2 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin
1-3-7 4
1-2-5-7 2
0 5
2 3
2 5
2
2 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin 0 3

1-3-7 4
1-2-5-7 2
1-4-6-7 2
0 5
2 3
2 5
2
2 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin 0 3

1 - 3 - 7 4
1 - 2 - 5-7 2
1 - 4 - 6-7 2
1 - 2 - 3-6-7 1
0 5
2 3
2 5
2
2 0 6 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin 0 3 Path Cmin
1 - 3 - 7 4 1-3-5-7 2
1 - 2 - 5-7 2
1 - 4 - 6-7 2
1 - 2 - 3-6-7 1
0 5
2 3
2 5
2
2 0 6 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin 0 3 Path Cmin
1 - 3 - 7 4 1-3-5-7 2
1 - 2 - 5-7 2 1-4-3-6-7 2
1 - 4 - 6-7 2
1 - 2 - 3-6-7 1
0 5
2 3
2 5
2
2 0 6 4 0 4
6 0 4 0
1 3 7

2
4 6
2 1
Path Cmin 0 3 Path Cmin
1 - 3 - 7 4 1-3-5-7 2
1 - 2 - 5-7 2 1-4-3-6-7 2
1 - 4 - 6-7 2
13
1 - 2 - 3-6-7 1
End of Lecture Day 7

You might also like