Application of Ford-Fulkerson Algorithm To Maximum Flow in Water Distribution Pipeline Network
Application of Ford-Fulkerson Algorithm To Maximum Flow in Water Distribution Pipeline Network
ISSN 2250-3153
DOI: 10.29322/IJSRP.8.12.2018.p8441
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441
Abstract- In this paper, well known Ford-Fulkerson algorithm in edge in G is a non-negative number. This number represents the
graph theory is used to calculate the maximum flow in water capacity of the edge and it is denoted by 𝑐𝑖𝑗 for the directed edge
distribution pipeline network. The maximum flow problem is one from node 𝑖 to node 𝑗 in G [5]. We consider a network of
of the most fundamental problems in network flow theory and pipelines of water distribution system and the case of network of
has been investigated extensively. The Ford-Fulkerson algorithm pipes having values allowing flows only in one direction. This
is a simple algorithm to solve the maximum flow problem and type of network is represented by weighted connected digraph in
based on the idea of searching augmenting path from a started which District Metered Areas (DMA) are represented by vertices
source node to a target sink node. It is one of the most widely and lines which given water flows through by edges and
used algorithms in optimization of flow networks and various capacities by weights. To provide the maximum flow from
computer applications. The implementations for the detail steps source vertex to sink vertex is one of the most important things in
of algorithm will be illustrated by considering the maximum flow all transmission network. Source vertex is produced flows along
of proposed water distribution pipeline network in Pyigyitagon the edges of the digraph G and sink vertex is received [1]. The
Township, Mandalay, Myanmar as a case study. The goal of this residual graph can be defined by providing a systematic way in
paper is to find the maximum possible flow from the source node order to find the maximum flow. The residual capacity of an
s to the target node t through a given proposed pipeline network. edge can be obtained by using the formula 𝑐𝑓𝑖𝑗 = 𝑐𝑖𝑗 − 𝑓𝑖𝑗 and a
residual network can be defined by giving the amount of
Index Terms- Flow network, Ford-Fulkerson algorithm, Graph available capacity.
Theory, Maximum flow, Water distribution network.
A. Problem Definition
The maximum flow problems involve finding a possible
I. INTRODUCTION maximum flow through a single-source to single-sink flow
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441 www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 8, Issue 12, December 2018 307
ISSN 2250-3153
∆𝑖𝑗 𝑖𝑓 𝑖 = 1
and ∆𝑗 = � III. RESULTS AND DISCUSSION
min(∆𝑖 , ∆𝑖𝑗 ) 𝑖𝑓 𝑖 > 1
In this paper, the application of graph theory to find the
and label j with a “forward label” (𝑖 + , ∆𝑗 )or if 𝑓𝑖𝑗 > 0, maximum flow of water distribution network has been illustrated
compute ∆𝑗 = min�∆𝑖 , 𝑓𝑗𝑖 � and label j by a “backward by using the Ford-Fulkerson algorithm [1] to the proposed water
label” (𝑖 − , ∆𝑗 ). distribution pipeline network of Pyigyitagon Township in
Mandalay, Myanmar. One who wants to know the possible
If no such j exists then OUTPUT f . Stop. maximum flow required the detail implementation of this
Else continue (i.e., go to step 4). algorithm. The weights on the links are referred as capacities and
current flows for corresponding edges.
Step 4. Repeat Step 3 until t is reached.
[This gives a flow augmenting path 𝑃: 𝑠 → 𝑡.]
If it is impossible to reach t, then OUTPUT ƒ. Stop. Else
continue (i.e., go to Step 5).
Step 5. Backtrack the path P, using the labels.
Step 6. Using P, augment the existing flow by∆𝑡 . Set 𝑓 = 𝑓 +
∆𝑡
Step 7. Remove all labels from vertices 2, … , 𝑛. Go to Step 3.
This is the end of the algorithm. The flowchart illustrating for
the maximum flow of water distribution network is as follow:
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441 www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 8, Issue 12, December 2018 308
ISSN 2250-3153
The flow network of pipeline is a directed graph with two Augmented flow 𝑓 = 70 + 15 = 85.
distinguished nodes; source and sink. Since the sizes of pipes
Step 7 Remove labels on vertices 2 … , 6. Go to Step 3.
used in this network may not be the same, the capacity for each
pipe may also be different. So it can only maintain a flow of a
certain amount of water. Anywhere those pipes meet, the total
amount of water coming into that junction must be equal to the
amount going out. Each edge between two nodes has a non-
negative capacity 𝑐 and receives a flow 𝑓 where amount of flow
on an edge cannot exceed its capacity [3]. The first number on
each edge represents capacity and the second number represents Fig. 4 Flow augmenting path 1-2-3-6
current flow (liter/sec). In this pipeline network, we denote the
source node 1 as “s” and the sink (target) node 6 as “t” as shown Step 3 Scan 1
in Fig. 3.
Compute ∆12 = 100 − 65 = 35 = ∆2 . Label 2 by (1+ , 35)
Compute ∆14 = 50 − 20 = 30 = ∆4 . Label 4 by (1+ , 30)
Step 4 Scan 2.
Compute ∆24 = 25 − 10 = 15, ∆4 = min(∆2 , ∆24 ).
∆4 = min(35, 15) = 15. Label 4 by (2+ , 15).
Scan 4.
Compute ∆43 = 20 − 15 = 5, ∆3 = min(∆4 , ∆43 )
Fig. 3 Representation of digraph for proposed network of water pipeline in
Pyigyitagon Township, Mandalay, Myanmar ∆3 = min(15, 5) = 5. Label 3 by (4+ , 5).
A. Implementation of the Algorithm Scan 3.
The implementation of the Ford-Fulkerson algorithm is Compute ∆36 = 65 − 60 = 5, ∆6 = min(∆3 , ∆36 ).
illustrated to find the maximum flow for proposed water
distribution pipeline network in Pyigyitagon Twonship, ∆6 = min(5, 5) = 5. Label 6 by (3+ , 5).
Mandalay from source node s to sink node t. We can choose any Step 5 𝑃: 𝑠 = 1 → 2 → 4 → 3 → 6 = 𝑡 is a flow augmenting
path from source to sink for each iteration step as an augmenting path.
path by using the edge with the non-zero residual capacity in
previous step. This means that the edge with maximum flow Step 6 ∆𝑡 = 5. Augmentation gives 𝑓12 = 70, 𝑓24 = 15,
cannot be used as a segment of augmenting path. 𝑓43 = 20, 𝑓36 = 65.
The detail implementation of algorithm can be seen as Augmented flow 𝑓 = 85 + 5 = 90.
follows:
Step 7 Remove labels on vertices 2 … , 6. Go to Step 3.
Step 1 An initial flow 𝑓 = 50 + 20 = 70(Given).
Step 2 Label (𝑠 = 1) by ∅. Mark 2, 3, 4, 5, 6 “unlabelled”
Step 3 Scan 1
Compute ∆12 = 100 − 50 = 50 = ∆2 . Label 2 by
(1+ , 50).
Compute ∆14 = 50 − 20 = 30 = ∆4 . Label 4 by (1+ , 30).
Step 4 Scan 2.
Compute∆23 = 55 − 40 = 15, ∆3 = min(∆2 , ∆23 )
Fig. 5 Flow augmenting path 1-2-4-3-6
∆3 = min(50, 15) = 1. Label 3 by (2+ , 15).
Step 3 Scan 1
Scan 3.
Compute ∆14 = 50 − 20 = 30 = ∆4 . Label 4 by (1+ , 30).
Compute∆36 = 65 − 45 = 20, ∆6 = min(∆3 , ∆36 )
Step 4 Scan 4.
∆6 = min(15, 20) = 15. Label 6 by (3+ , 15).
Compute ∆45 = 35 − 15 = 20, ∆5 = min(∆4 , ∆45 ).
Step 5 𝑃: 𝑠 = 1 → 2 → 3 → 6 = 𝑡 is a flow augmenting path.
∆5 = min(30, 20) = 20. Label 5 by (4+ , 20).
Step 6. ∆𝑡 = 15. Augmentation gives 𝑓12 = 65,
Scan 5.
𝑓23 = 55, 𝑓36 = 60.
Compute ∆56 = 50 − 25 = 25, ∆6 = min(∆5 , ∆56 ).
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441 www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 8, Issue 12, December 2018 309
ISSN 2250-3153
∆6 = min(20, 25) = 20. Label 6 by (5+ , 20). structure [6]. The comparison for calculation times can be
checked in the following table [4].
Step 5 𝑃: 𝑠 = 1 → 4 → 5 → 6 = 𝑡 is a flow augmenting path.
Step 6 ∆𝑡 = 20. Augmentation gives 𝑓14 = 40, 𝑓45 = 35, TABLE I
COMPARISON FOR TIME COMPLEXITY OF MAXIMUM FLOW ALGORITHMS
𝑓56 = 45.
Augmented flow 𝑓 = 90 + 20 = 110. Maximum-flow Algorithm Time Complexity*
Ford-Fulkerson 𝑂(𝑛𝑚 𝑐)
Edmonds-Karp 𝑂(𝑛𝑚2 )
𝑛2
Goldberg-Tarjan 𝑂 �𝑚𝑛 log � ��
𝑚
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441 www.ijsrp.org
International Journal of Scientific and Research Publications, Volume 8, Issue 12, December 2018 310
ISSN 2250-3153
Naing, Professor and Head, Faculty of Computing, University of [6] Zhipeng Jiang1, Xiaodong Hu1, and Suixiang Gao. “A Parallel Ford-
Fulkerson Algorithm For Maximum Flow Problem”. Chinese Academy of
Computer Studies, Hinthada, for his invaluable comments and Sciences, Beijing, China.
perfect supervision throughout my research. Her special thanks
[7] L. R. Ford, JR. and D.R. Fulkerson, “Maximal Flow Through a Network”.
are due to U Myo Thant, Head of Water and Sanitation Rand Corporation, Santi Monica, California. September 20, 1955.
Department, Mandalay City Development Committee, Mandalay,
[8] M. Shokry, “New Operators on Ford-Fulkerson Algorithm”. IOSR Journal
Myanmar for his supports to get required data and information to of Mathematics (IOSR-JM). Vol. 11, Issue 2. Mar-Apr. 2015. pp. 58-67.
her research. Finally, the author’s thanks are to her beloved
[9] Tun Win U, “Proposed Water Supply Master Plan and Existing
mother, brothers and sister because her research cannot be done Wastewater Management System in Mandalay Industrial Hub”. Mandalay
successfully unless they support it. City Development Committee. 2016.
[10] Markus Josefsson, Martin Mützell, “Max Flow Algorithms, Comparison in
REFERENCES regards to practical running time on different types of randomized flow
networks”. Degree Project in Computer Science, DD143X. Sweden,
[1] Erwin Kreyszig, Advanced Engineering Mathematics, 10th edition.
Stockholm 2015.
Copyright © 2011 John Wiley & Sons, Inc. All rights reserved.
[2] Meysam Effati, Analysis of Uncertainty Considerations in Path Finding
Applications [Online] Available: http://5thsastech.khi. ac.ir/data1/
civil/1%20%2812%29.pdf. AUTHORS
[3] Ola M. Surakhi, Mohammad Qatawneh, Hussein A. al Ofeishat, “A First Author – Myint Than Kyi, Lecturer, Department of
Parallel Genetic Algorithm for Maximum Flow Problem,” (IJACSA)
International Journal of Advanced Computer Science and Applications,
Engineering Mathematics, Technological University (Mandalay).
Vol. 8, No. 6, 2017. [Online] Available: http://thesai.org Mandalay Division, Myanmar.
/Downloads/Volume8No6/Paper_20-A_Parallel_Genetic _Algorithm_ Email address: [email protected]
for_Maximum.pdf. Second Author – Dr. Lin Lin Naing, Professor and Head,
[4] Flow network [Online] Available: https://en.wikipedia.org/ wiki/ Faculty of Computing, University of Computer Studies,
Flow_network#Augmenting_paths. Hinthada, Ayeyarwady Division, Myanmar.
[5] Santanu Saha Ray, Graph Theory with Algorithms and its Applications In Email Address: [email protected]
Applied Science and Technology, Copyright Springer India. 2013. ISBN
978-81-322-0750-4.
http://dx.doi.org/10.29322/IJSRP.8.12.2018.p8441 www.ijsrp.org