You are on page 1of 45

Dr.

Papiya Bhattacharjee
Assistant Professor,
Decision Sciences Area
Xavier Institute of
Management
Bhubaneswar

Some Important Network Problems

Minimum Spanning Tree Problem

Shortest Path Problem

Maximum Flow Problem

Minimum Cost Flow Problem

What is a Network ?
A graphical description of a real life system/situation
We have already seen two special types of network problems (Transportation and
Assignment Problems)
Many efficient algorithms have been developed for solving such problems
A network consists a set of points
(called nodes), a set of lines (called
arcs) connecting pairs of points
and many a times some
commodity flowing through the
network

Nodes

Arcs

Flow

Examples of Nodes, Arcs and Flow

Applications of Network Optimization

Facilities location

Project planning

Transportation planning

Transportation networks design

Telecommunication networks design

Terminology of Networks
Directed arc If the flow through an arc is allowed in only one direction, it is a

directed arc. Otherwise it is an undirected arc (or simply a link)

Directed network A network that has only directed arcs

Undirected network A network that has only undirected arcs


Path A sequence of distinct arcs connecting two nodes is called a path

between the nodes

Directed path If all the arcs in a path are directed, then the path is directed. If

all the arcs are undirected, then it is an undirected path

Terminology of Networks
Cycle A path that begins and ends at the same node

Connected Nodes Two nodes are connected if there exists at least

one directed or undirected path between them


Connected Network A network in which every pair of nodes is

connected

Terminology of Networks
Tree A connected network that contains no cycles

Spanning Tree A spanning tree for a network contains all the

nodes of the network. A spanning tree for a network with n


nodes has exactly n 1 arcs

Terminology of Networks

Arc Capacity The maximum amount of the flow that can be carried through a
directed arc

Supply Node A node for which the total outflow is greater than the total inflow

Demand Node A node for which the total inflow is greater than the total outflow

Transshipment node A node for which the total inflow is equal to the total outflow

Minimal Spanning Tree Problem


Given
The nodes of a network
The potential links
Some measure (e.g. distance, cost etc.) associated with each potential

link
Objective
To design the network by inserting enough links so that there is a path

between every pair of nodes and the total length of the links inserted
into the network is minimized
To find a spanning tree containing all the given nodes and
with minimum total length of the links

Algorithm
Greedy Algorithm for Finding the Minimum Spanning Tree
(Prims algorithm)
1.

Begin with any node/select any node

2.

Choose the shortest possible link to another node (ties may be broken
arbitrarily)

3.

Identify the unconnected node that is closest to a connected node and


add the corresponding link to the network (ties for the closest
unconnected node may be broken arbitrarily)

4.

Repeat the previous step until all the nodes have been connected

Note:
The choice of initial node does not affect the final solution in terms of the total
minimum length. However, there may exist more than one minimum spanning tree

Example
Find a minimal spanning tree for the following network.
7

1
5

10

3
4

8
12

Minimal spanning tree for the given network

5
5

3
4

3
4

The minimum length is 27 units

Some Applications
Design of telecommunication networks

Design of transportation networks

Design of a network of pipelines to connect locations

Example
Some oil companies in the country are jointly planning to build an oil pipeline to connect
ten cities as shown in the following network:
120

490

235
7

520

320
270

400
1

175

210
580

250

10

8
750

The distance (in miles) between cities are shown besides each link. Determine a pipeline
system that will connect all 10 cities using the minimum number of miles of pipe.

A pipeline system with minimum total length of pipe is shown below

120

175

235

2
400

10

270

8
1

Total length of the pipeline system is 2400 miles

The Wirehouse Lumber Company will soon begin logging eight groves of trees in the
same general area. Therefore, it must develop a system of dirt roads that makes each
grove accessible from every other grove. The distance (in miles) between every pair of
groves is as follows:

Management wishes to determine between which pairs of groves the roads should be
constructed to connect all groves with a minimum total length of road. What is the best
way to do this?

Shortest Path Problem


Given
An undirected and connected network with two special nodes called

the origin and the destination


A positive distance, time or cost is associated with each of the links
Objective
To find the shortest path (the path with the minimum total distance or

with minimum total time or with minimum total cost) from the origin
to the destination

Algorithm
Features of the algorithm

Starting from the origin, the algorithm successively finds out the shortest
path to each of the nodes of the network in the ascending order of their
shortest distances from the origin. The problem is solved when the
destination node is reached.

It is an iterative algorithm

In every iteration, we reach the next best destination in terms of distance,


time or cost

Steps of the algorithm

Objective of nth Iteration: Find the nth nearest node to the origin (to be repeated for n = 1,
2, . . . until the nth nearest node is the destination

Input for nth iteration: n-1 nearest nodes to the origin (solved for at the previous iterations),
including their shortest path and distance from the origin. (These nodes, plus the origin, will
be called solved nodes; the others are unsolved nodes.)

Candidates for nth nearest node: Each solved node that is directly connected by a link to one
or more unsolved nodes provides one candidatethe unsolved node with the shortest
connecting link. (Ties provide additional candidates.)

Calculation of nth nearest node: For each such solved node and its candidate, add the
distance between them and the distance of the shortest path from the origin to this solved
node. The candidate with the smallest such total distance is the nth nearest node (ties
provide additional solved nodes), and its shortest path is the one generating this distance.

Example
A

4
Origin

1
6

O
5

7
D

1
4
E

5
C

Destination

Solved Nodes
Directly Connected
to Unsolved Nodes

Closest
connected
unsolved node

Total Distance
Involved

nth Nearest Node

Minimum
Distance

Last Connection

OA

O
A

C
B

5
4+1 = 5

C
B

5
5

OC
AB

A
B
C

D
E
E

4+7 =11
5 +4 = 9
5+5 = 10

BE

A
B
E

D
D
D

4+7 = 11
5+5 = 10
9+1 = 10

D
D

10

BD
ED

D
E

T
T

10+6 = 16
9+8 = 17

16

DT

The shortest routes are


OA AB BD DT and OA AB BE ED DT

Applications

Minimize the total distance travelled between two points

Minimize the total cost of a sequence of activities

Minimize the total time of a sequence of activities

Example
A concrete company makes concrete at location 1 and delivers it to construction sites at
locations 2, 3, 4, 5, 6, 7 and 8. The following network shows the possible routes and distances
(in miles) from the concrete plant to the seven construction sites. Determine the shortest
route a concrete truck would take from plant at node 1 to all the construction sites.
14

2
12

10

20
17

8
7

15

4
24

10
28
8

18
3
12

18

Solved Nodes Directly


Closest connected
Connected to Unsolved Nodes
unsolved node

Total Distance
Involved

nth Nearest
Node

Minimum
Distance

Last
Connection

12

12

1,2

1
2

4
5

17
26

17

1,4

1
2
4

3
5
6

18
26
26

18

2
3
4

5
6
6

26
30
26

4
5
6

7
7
8

32
34
44

4
6
7

8
8
8

45
44
42

1,3
2,5
26

4,6

32

4,7

42

7,8

Maximum Flow Problem


Given

A connected network with a source (the node at which all the flow originates) and
another node called the sink (at which all the flow terminates). All the remaining
nodes are transshipment nodes

The capacity of each arc (the maximum number of units allowed to flow through the
arc)

Objective

To maximize the total amount of flow (total number of units flowing) from source to
sink

(The total amount of flow can be measured as either the total amount leaving the
source or as total amount entering the sink)

Residual Network, Residual Capacity and


Augmenting Path

Initially, before any flows have been assigned, the residual network is the original network.
After some flows have been assigned to the arcs, the residual network shows the remaining
arc capacities (called residual capacities) for assigning additional flows.

Augmenting path: A directed path from source to sink in the residual network along which
every arc has a residual capacity greater than zero

Residual Capacity of an augmenting path: The minimum of the residual capacities among all
the residual capacities along an augmenting path is called the residual capacity of the
augmenting path

Algorithm
Augmenting Path Algorithm
The augmenting path algorithm repeatedly selects some augmenting path and adds a flow
equal to its residual capacity to that path in the original network. This process continues until
there are no more augmenting paths, so the flow from the source to the sink cannot be
increased further.
Steps:
1.

Identify an augmented path in the residual network

2.

Identify minimum of the residual capacities, say c* on this path. Increase the flow
in this path by c*.

3.

Decrease by c* the residual capacity of each arc on this augmenting path. Increase
by c* the residual capacity of each arc in the opposite direction on this
augmenting path. Return to step 1.

Example
The Express Parcel Services has established various truck and air routes around the country over
which it ships parcels. The holiday season is approaching, which means a dramatic increase in the
number of packages that will be sent. The service wants to know the maximum flow of packages
it can accommodate (in Tons) from station 1 to station 7. The routes and the flow capacities (in
Tons of packages per day) are shown in the following network. Determine the maximum
tonnage of packages that can be transported per day from station 1 to station 7, and indicate the
flow along each arc.
0

2 2

1
2

4
4 6

2
3 5

6
3

9
0

4
2 6 4

0 2
2

5
0 3

4
6

9
2
5
3

67

0 7
0

4
0

7
2 6 1

3 2
2
3

4
4
2 6

1
5
6
0 3

7
4

9
2
5
3

0 7
0

7
2 6 1

5 2
0
1

1
6
0 3

4
4 4
7
4
5
3

2 7
0

7
4
0

7
2 6 1

5 2
0
1

1
6
4 3

7
0

4
4 4
7
4
5
3

3
2 7
4

7
2 6 1

5 2
0

1
6
5 3

4
4 4

6
4
4 5

3 7
4

Maximum flow from source to sink is 10 Tons of packages

A new airlines has been granted license and the permitted several routes between city A and
city B are shown in the following network. The flights per day for each route are also given
Determine the maximum number of flights the airline can schedule per day from city A to city
B and indicate the number of flights along each route.
8
S 6
2

8
10 P 7
4 5
9
R 4
0 7

10
7
A
5

5
3

4
2 Q 6

7 T
5

U
1

8
S 6
2

8
10 P 7
4 5
9
R 4
0 7

10
7
A
5

5
3

7 T
5

2 Q 6

U
1

14
S 0
2

2
16 P 7
4 5
9
R 4
0 7

4
7
A
5

5
3

4
2 Q 6

U
1

7 T
5

14
S 0
2

2
16 P 7

4 5
9
R 4
0 7

4
7
A
0

9
B
10
3

U
6

12 T 0
2
16 P 7

7 Q 1

14
S 0
2
9
13
B
10

4 5
13
R 0
0 7

4
3
A
0

4
7 Q 1

U
6

12 T 0

14
S 0
2

2
16 P 7
4
0
A
0

9
13
B
13

4 5
16
R 0
0 4
6
4

7 Q 1

U
6

12 T 0

The maximum number of flights from city A to city B is 18

Applications

Maximize the flow of vehicles through a transportation network

Maximize the flow of oil through a system of pipelines

Maximize the flow of commodities from factories to customers through a


supply network

An example where more than one source and more than one sink
is present
The ABC Petroleum Corporation has two oil fields, three refineries and two
distribution centers. Using units of thousands of barrels of crude oil (and its equivalent
in refined products), the following table shows the maximum number of units that
can be shipped per day from each oil field to each refinery and from each refinery to
each distribution center. Determine a plan for how many units to ship from each oil
field to each refinery and from each refinery to each distribution center that will
maximize the total number of units reaching the distribution centers.
Refineries

Oil
Fields

R1

R2

R3

O1

11

O2

Refineries

Distribution Centers
D1

D2

R1

R2

R3

5
9

R1
11
20
Source

Dummy
Source

17

O1

D1

2
5

17

8
R2

Sink

O2 4
8

D2
4
R3

22

Dummy
Sink

Minimum Cost Flow Problem


Given

A directed and connected network with at least one of the nodes as supply node
and at least one of the nodes as demand node. All the remaining nodes are
transshipment nodes

The capacity of each arc and the cost per unit flow through each arc. The cost of
flow is proportional to the amount of flow

Capacities of the arcs are sufficient to carry total supply of the supply nodes to
demand nodes.

Objective

To minimize the total cost of sending the available supply through the network to
satisfy the given demand. (An alternative objective is to maximize the total profit
from doing this.)

Applications
Mainly, the types of problems that involve determining a plan for shipping
goods from their sources (factories, etc.) to intermediate storage facilities
(as needed) and then on to the customers at the least cost.

Model Formulation

Decision variable xij = The flow through arc i j

cij

= Cost per unit flow through arc i j

uij = arc capacity for arc i j


bi

= net flow generated at node i


bi > 0 if node i is a supply node
bi < 0 if node i is a demand node
bi = 0 if node i is a transshipment node

Model Formulation

Minimize Z =
=1 =1

Subject to

(summations are taken only over existing arcs)

- = bi
=1

=1

and 0 xij uij for all arc i j


This is a linear programming problem

Example
3

Formulation
Minimize Z = 200 X12 + 400 X13 + 900 X14 + 300 X23 + 100 X35 + 300 X45 + 200 X54
Subject to

X12 + X13 + X14 = 50


X23 X12 = 40

X35 X13 X23 = 0


X45 X14 X54 = -30
X54 X45 X35 = -60
X12 10, X35 80, and all Xij 0

You might also like