0% found this document useful (0 votes)
56 views

Network Flow Problems: Total Distance From O To F ?

The document describes a network flow problem involving an amusement park with paths between an entrance (O) and various sites (A-F). It then provides 3 questions to optimize aspects of the network: 1) Lay electrical lines along minimum total distance by solving a minimum spanning tree problem. 2) Find the shortest path from O to the popular site F by solving a shortest path problem. 3) Route maximum number of trips from O to F per day without exceeding path limits by solving a maximum flow problem.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Network Flow Problems: Total Distance From O To F ?

The document describes a network flow problem involving an amusement park with paths between an entrance (O) and various sites (A-F). It then provides 3 questions to optimize aspects of the network: 1) Lay electrical lines along minimum total distance by solving a minimum spanning tree problem. 2) Find the shortest path from O to the popular site F by solving a shortest path problem. 3) Route maximum number of trips from O to F per day without exceeding path limits by solving a maximum flow problem.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Network Flow Problems

A Prototypical Example
A new amusement park is being constructed by a large corporation. Cars are not allowed into the park, but
there is a system of narrow, winding pathways for automated people movers and pedestrians. The road
system is shown in the figure below, where O represents the entrance to the park and A-F represent sites of
various popular amusements. The numbers above the arcs give the distances of the arcs.

A F
7
2 5
2

5 4
O B D
7
1 1
3
4

C
E
4
The designers face three questions:

1. Electrical lines must be laid under the pathways to establish communication between all nodes in the
network. Since this is an expensive process, the question to be answered is how this can be
accomplished with a minimum total distance ?

2. Location F is extremely popular with visitors, and it is planned that a small number of people movers
will run directly from the entrance O to site F. The question is which path will provide the smallest
total distance from O to F ?

3. During the peak season the number of people wanting to go from O to F is very large. Thus during this
time various routes may be followed from O to F (irrespective of distance) so as to accommodate the
increased demand through additional trips. However, due to the terrain and the quality of the
construction, there are limits on the number of people mover trips that can run on any given path per
day; these are different for different paths. The question is how to route various trips to maximize the
number of trips that can be made per day without violating the limits on any individual path ?

• Question 1 may be answered by solving a minimum spanning tree problem.

• Question 2 may be answered by solving a shortest path problem.

• Question 1 may be answered by solving a maximum flow problem.


DIJKSTRA'S SHORTEST PATH ALGORITHM
Let us represent the origin by O, and suppose that there are n additional
nodes in the network:

Objective at Iteration i: To find the i th closest node from O, along with the
corresponding path and distance.

Input at Iteration i: The closest, the 2nd closest,...,(i-1)th closest nodes to O,


along with their paths and distances. These are designated as permanent
nodes (P) while the remaining nodes are designated as temporary nodes (T).
Initially, P={O} and T={all other nodes}.

At Iteration i: Determine all nodes in T that are directly linked to at least one
node in P – call this subset of T as Ω.
For each j∈Ω, compute Dj= Minimum{distance of direct link from j to a
permanent node + shortest distance from O to that permanent node}.
Determine the j∈Ω that has the minimum value for Dj. Remove j from T and
add it to P along with the shortest path and distance.

At the end of iteration i the shortest path to each node is available.

Example: Iteration 1
A P={O}; T={A,B,C,D,E,F}

2 Ω = {A, B, C}

5 DA=Min{LOA+0}=2
O B
DB=Min{LOB+0}=5
DC=Min{LOC+0}=4
4
Closest node = {A}
C
Iteration 2
2 A P={O,A}; T={B,C,D,E,F}
2 7
2
Ω = {B, C, D}
5
O B D
DB=Min{LOB+0, LAB+2}=4
DC=Min{LOC+0}=4
4 DD=Min{LAD+2}=9
C

2nd closest node = {C}

Iteration 3
P={O,A,C}; T={B,D,E,F}
2 A
2 7 Ω = {B, D, E}
2

5
DB=
O B D
Min{LOB+0, LAB+2,
LOC+4}=4
1
4
DD=Min{LAD+2}=9
4
C
4 E DE=Min{LCE+4}=8

3rd closest node = {B}

Iteration 4
2 A P={O,A,C,B}; T={D,E,F}
2 7
2
Ω = {D, E}
O 4 B D
4 DD =Min{LAD+2, LBD+4}=8
3
DE =Min{LCE+4, LBE+4}=7
4

C E
4 4
4th closest node = {E}
Iteration 5
P={O,A,C,B,E}; T={D,F}
2 A
Ω = {D, F}
F
2 7
2

DD =
O 4 B D
4 Min{LAD+2, LBD+4,
7
1 LED+7}=8
3
4
DE =Min{LCE+4, LBE+4}=7
C E
4 7

5th closest node = {D}


Iteration 6
2 A
F P={O,A,C,B,E,D}; T={F}
2 5
Ω = { F}
2

8
O 4 B D
4 DF = Min{LED+7, LDF+5}=13
7
1
3
4

4
C
7
E 6th closest node = {F}

DONE!
2 A 13 F

2 5
2

4
O 4 B D 8

1
3
4

C
4 E 7
THE FORD-FULKERSON ALGORITHM FOR THE MAXIMUM
FLOW PROBLEM
STEP 0: Start with some feasible flow (if one isn't obvious let flow in each
arc be equal to zero) from the source node to the sink node.

STEP 1: If flow in arc (i-j) is less than capacity of arc (i-j) assign it to set I
(set of arcs along which amount of flow can be Increased). If flow in arc (i-j)
is greater than zero assign it to set R (set of arcs along which amount of flow
can be Reduced).
NOTE: An arc can belong to both I and R.

STEP 2: LABELING PROCEDURE


Label the source node.

If the flow along an arc (i-j) is from a labeled node to an unlabeled node and
the arc belongs to I, then label the unlabeled node, call the arc a forward arc
and let I(i-j) = Capacity(i-j) - Flow(i-j)
If the flow along an arc is from an unlabeled node to a labeled node and the
arc belongs to R, then label the unlabeled node and call the arc a backward
arc and let R(i-j) = Flow(i-j)

Continue the labeling procedure until (a) the sink has been labeled, or (b) no
more nodes can be labeled.

STEP 4: If the sink has not been labeled, STOP; this is the optimum flow. If
the sink has been labeled go to Step 5.

STEP 5: There is a chain C from source to sink.


If C has only forward arcs, increase the flow in each arc by an amount
∆f = Min (i − j)∈C {I( i − j)}
If C has forward and backward arcs, increase the flow in each forward and
decrease the flow in each backward arc by an amount
∆f = Min {k1 = Min (i− j)∈I∩ C I( i − j), k2 = Min (i− j)∈R∩ C R( i − j)}
Return to Step 2
A F
3 9
5 1
1

O 7 B 4 D
6
2 5 1
1
4

C E
4

A F
3 9
5 1
1

O 7 B 4 D
6
2 5 1
1
4

C E
4
A F
3 9
5 1
1

O 7 B 4 D
6
2 5 1
1
4

C E
4
A F
3 9
5 1
1

O 7 B 4 D
6
2 5 1
1
4

C E
4

A F
3 9
5 1
1

O 7 B 4 D
6
2 5 1
1
4

C E
4

You might also like