The Maximum Flow Problem - University of Jordansites.ju.edu.jo/sites/Alzalg/Documents/973/pres...

33
Lilia Benakkouche, Hanaa Kerim, and Ibtissem Ben Kemache (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 1 / 22 The University of Jordan Department of Mathematics The Maximum Flow Problem Presented by : Submitted to : Dr. Baha Alzalg Integer and Combinatorial Optimization (0301973) Spring 2018 May 15, 2018

Transcript of The Maximum Flow Problem - University of Jordansites.ju.edu.jo/sites/Alzalg/Documents/973/pres...

  • Lilia Benakkouche, Hanaa Kerim, and Ibtissem Ben Kemache

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 1 / 22

    The University of JordanDepartment of Mathematics

    The Maximum Flow Problem

    Presented by :

    Submitted to :

    Dr. Baha Alzalg

    Integer and Combinatorial Optimization (0301973)Spring 2018

    May 15, 2018

  • Plan work

    1 Introduction

    2 The maximum flow problemThe problemAn exampleThe mathematical model

    3 The Ford-Fulkerson algorithmDefinitionsThe ideaThe algorithmExamples

    4 Conclusion

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 2 / 22

  • Introduction

    Introduction

    The maximum flow problem involves a directed network with arcscarrying flow. The only relevant parameter is the upper bound on arcflow, called arc capacity. The problem is to find the maximum flowthat can be sent through the arcs of the network from some specifiednode s, called the source, to a second specified node t, called thesink.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 3 / 22

  • Introduction

    Introduction

    Applications of this problem include finding the maximum flow oforders through a job shop, the maximum flow of water through astorm sewer system, and the maximum flow of product through aproduct distribution system, among others.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 4 / 22

  • The maximum flow problem The problem

    Definitions

    NetworkA network is a directed graph G (V ,E ), in which a vertex s ∈ V anda vertex t ∈ V are specified as being the source node and the sinknode, respectively. every directed edge (u, v) ∈ E has a positivecapacity c (u, v) > 0 associated to it. If both the edges (u, v) and(v , u) belong to E , we allow their capacities to be different.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 5 / 22

  • The maximum flow problem The problem

    Definitions

    FlowA flow in an network (G , s, t, c) is an assignment of a non-negativenumber f (u, v) to every edge (u, v) ∈ E such that

    For every edge (u, v) ∈ E , f (u, v) ≤ c (u, v).For every vertex v ∈ V ,

    ∑u∈V f (u, v) =

    ∑w∈V f (v ,w), where

    we follow the convention that f (u, v) = 0 if (u, v) /∈ E . (Thisconvention is useful otherwise the second condition would haveto be something like

    ∑u:(u,v)∈E f (u, v) =

    ∑w :(v ,w)∈E f (v ,w).

    The cost of the flow (the throughout of the communication, in thecommunication network example) is∑

    v

    f (s, v) .

    In the maximum flow problem, given a network we want to find aflow of maximum cost.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 6 / 22

  • The maximum flow problem The problem

    Definitions

    FlowA flow in an network (G , s, t, c) is an assignment of a non-negativenumber f (u, v) to every edge (u, v) ∈ E such that

    For every edge (u, v) ∈ E , f (u, v) ≤ c (u, v).

    For every vertex v ∈ V ,∑

    u∈V f (u, v) =∑

    w∈V f (v ,w), wherewe follow the convention that f (u, v) = 0 if (u, v) /∈ E . (Thisconvention is useful otherwise the second condition would haveto be something like

    ∑u:(u,v)∈E f (u, v) =

    ∑w :(v ,w)∈E f (v ,w).

    The cost of the flow (the throughout of the communication, in thecommunication network example) is∑

    v

    f (s, v) .

    In the maximum flow problem, given a network we want to find aflow of maximum cost.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 6 / 22

  • The maximum flow problem The problem

    Definitions

    FlowA flow in an network (G , s, t, c) is an assignment of a non-negativenumber f (u, v) to every edge (u, v) ∈ E such that

    For every edge (u, v) ∈ E , f (u, v) ≤ c (u, v).For every vertex v ∈ V ,

    ∑u∈V f (u, v) =

    ∑w∈V f (v ,w), where

    we follow the convention that f (u, v) = 0 if (u, v) /∈ E . (Thisconvention is useful otherwise the second condition would haveto be something like

    ∑u:(u,v)∈E f (u, v) =

    ∑w :(v ,w)∈E f (v ,w).

    The cost of the flow (the throughout of the communication, in thecommunication network example) is∑

    v

    f (s, v) .

    In the maximum flow problem, given a network we want to find aflow of maximum cost.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 6 / 22

  • The maximum flow problem The problem

    Definitions

    FlowA flow in an network (G , s, t, c) is an assignment of a non-negativenumber f (u, v) to every edge (u, v) ∈ E such that

    For every edge (u, v) ∈ E , f (u, v) ≤ c (u, v).For every vertex v ∈ V ,

    ∑u∈V f (u, v) =

    ∑w∈V f (v ,w), where

    we follow the convention that f (u, v) = 0 if (u, v) /∈ E . (Thisconvention is useful otherwise the second condition would haveto be something like

    ∑u:(u,v)∈E f (u, v) =

    ∑w :(v ,w)∈E f (v ,w).

    The cost of the flow (the throughout of the communication, in thecommunication network example) is∑

    v

    f (s, v) .

    In the maximum flow problem, given a network we want to find aflow of maximum cost.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 6 / 22

  • The maximum flow problem An example

    Example (Preemptive scheduling)

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 7 / 22

  • The maximum flow problem The mathematical model

    The mathematical model

    X Mathematical model Mathematically, the maximum flowproblem can be formulated as follows :

    max bss.t. Af = b

    bt = −bsbi = 0,∀i 6= s, t0 ≤ fij ≤ uij ,∀(i , j) ∈ A,

    where bs is a variable to be optimized. Any flow vector f satisfyingthe above constraints is called a feasible flow and the correspondingvalue of bs is called the value of that flow.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 8 / 22

  • The Ford-Fulkerson algorithm Definitions

    Definitions

    Residual graphA residual graph is a graph which indicates additional possible flow ifthere is such path from source to sink then there is a possibility toadd flow.

    Augmenting pathLet f be a feasible flow vector. An augmenting path is a path from sto t such that fij < uij for all forward arcs, and fij > 0 for allbackward arcs on the path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 9 / 22

  • The Ford-Fulkerson algorithm Definitions

    Definitions

    Residual graphA residual graph is a graph which indicates additional possible flow ifthere is such path from source to sink then there is a possibility toadd flow.Augmenting pathLet f be a feasible flow vector. An augmenting path is a path from sto t such that fij < uij for all forward arcs, and fij > 0 for allbackward arcs on the path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 9 / 22

  • The Ford-Fulkerson algorithm The idea

    The idea

    The Ford-Fulkerson algorithm (FFA) is a greedy algorithm thatcomputes the maximum flow in a flow network. It was published in1956 by Lester Ford and Delbert Fulkersonn.

    The idea behind the algorithm is as follows : As long as there is apath from the source (start node) to the sink (end node), withavailable capacity on all edges in the path, we send flow along one ofthe paths. Then we find another path, and so on. A path withavailable capacity is called an augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 10 / 22

  • The Ford-Fulkerson algorithm The idea

    The idea

    The Ford-Fulkerson algorithm (FFA) is a greedy algorithm thatcomputes the maximum flow in a flow network. It was published in1956 by Lester Ford and Delbert Fulkersonn.The idea behind the algorithm is as follows : As long as there is apath from the source (start node) to the sink (end node), withavailable capacity on all edges in the path, we send flow along one ofthe paths. Then we find another path, and so on. A path withavailable capacity is called an augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 10 / 22

  • The Ford-Fulkerson algorithm The idea

    The idea

    Suppose that we have a feasible flow and that we have found anaugmenting path P . We can then increase the flow along everyforward arc, decrease the flow along every backward arc by the sameamount, and still satisfy all of the problem constraints, we then saythat we are pushing flow along the path P , or that we have a flowaugmentation.

    The amount of flow pushed along P can be no morethan δ(P), defined by

    δ(P) = min

    {min

    (i ,j)∈F(uij − fij), min

    (i ,j)∈Bfij

    },

    where F and B are the sets of forward and backward arcs,respectively, in the augmenting path. If the augmenting path consistsexclusively of forwards arcs, and if all arcs on the path have infinitecapacity, then there is no limit on the amount of flow that can bepushed, and we have δ(P) =∞.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 11 / 22

  • The Ford-Fulkerson algorithm The idea

    The idea

    Suppose that we have a feasible flow and that we have found anaugmenting path P . We can then increase the flow along everyforward arc, decrease the flow along every backward arc by the sameamount, and still satisfy all of the problem constraints, we then saythat we are pushing flow along the path P , or that we have a flowaugmentation.The amount of flow pushed along P can be no morethan δ(P), defined by

    δ(P) = min

    {min

    (i ,j)∈F(uij − fij), min

    (i ,j)∈Bfij

    },

    where F and B are the sets of forward and backward arcs,respectively, in the augmenting path. If the augmenting path consistsexclusively of forwards arcs, and if all arcs on the path have infinitecapacity, then there is no limit on the amount of flow that can bepushed, and we have δ(P) =∞.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 11 / 22

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    The Ford-Fulkerson algorithm

    1 Start with a feasible flow f .

    2 Search for an augmenting path.

    3 If no augmenting path can be found, the algorithm terminates.

    4 If an augmenting path P is found, then :

    If δ(P)

  • The Ford-Fulkerson algorithm The algorithm

    If the algorithm terminates because δ(P) =∞, we have found anaugmenting path without capacity limitations and, using the path, anarbitrarily large amount of flow can be sent to the sink.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 13 / 22

  • The Ford-Fulkerson algorithm Examples

    Examples

    Consider the following network :

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 14 / 22

  • The Ford-Fulkerson algorithm Examples

    Let us start with the zero flow

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 15 / 22

  • The Ford-Fulkerson algorithm Examples

    Step 01 : First augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 16 / 22

  • The Ford-Fulkerson algorithm Examples

    Step 02 : Second augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 17 / 22

  • The Ford-Fulkerson algorithm Examples

    Step 03 : Third augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 18 / 22

  • The Ford-Fulkerson algorithm Examples

    Step 04 : Fourth augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 19 / 22

  • The Ford-Fulkerson algorithm Examples

    Step 05 : Fifth augmenting path.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 20 / 22

  • The Ford-Fulkerson algorithm Examples

    The augmenting path chosen in each step with the δ(P) associatedare shown in the following table :

    Step Augmenting paths δ(P)1 S → A→ D → T 82 S → C → D → T 23 S → C → D → A→ B → T 44 S → A→ D → B → T 25 S → C → D → B → T 3

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 21 / 22

  • Conclusion

    Conclusion

    In combinatorial optimization, network flow problems are a class ofcomputational problems in which the input is a flow network, and thegoal is to construct a flow, numerical values on each edge thatrespect the capacity constraints and that have incoming flow equal tooutgoing flow at all vertices except for certain designated terminals.In this work, we presented one of specific types of network flowproblems which is the maximum flow problem.

    (Integer Optimization–University of Jordan) The Maximum Flow Problem 15-05-2018 22 / 22

    IntroductionThe maximum flow problemThe problemAn exampleThe mathematical model

    The Ford-Fulkerson algorithmDefinitionsThe ideaThe algorithmExamples

    Conclusion