230 likes | 786 Views
Max-flow/min-cut theorem. Theorem : For each network with one source and one sink , the maximum flow from the source to the destination is equal to the minimal cut of this network . Intui tion : Maximal flow is determined by the bottleneck of the sysetm of pipes .
E N D
Max-flow/min-cuttheorem • Theorem: For eachnetworkwith one source and one sink, themaximumflowfromthesource to thedestinationisequal to theminimalcut of thisnetwork. • Intuition: • Maximalflowisdetermined by thebottleneck of thesysetm of pipes. • Minimalcutis a kind of a distributedbottleneck for thewholenetwork.
Max flowandmin cut • Min cut for thenetworkhas a value of 14. • 4 pathsB-E, D-E, F-E andF-G is a bottleneck of thenetwork and theyshould be widened first • But itispossiblethatyoudon’tget 1 unit flowincrease per 1 unit of increasedcapacity for theselectedpaths. • Itisbecause an increasedflowmayactivate a newbottleneck down orupthe„river”. • Flowcapacitiesmaydenotecosts. Thenminimalcutis a minimalcost of blockingtheflowinthewholeriver.
Network flowprogramming • Formulating and solvingnetworkproblems by linearprogrammingiscallednetworkflowprogramming. • Everynetworkflow program may be presented as minimum-costnetworkflowprogram: • Variables: unknownflows for everyarcinthenetwork • Flowconservationconstraint: • SourceSink:
Network flowprogramming • Flowbounds for eacharc:may be lower (minimalprodctionlevelin a factory) {defaultvalueis 0} orupperbounds (maximalflowthrough a pipe) {defaultvalue+∞} • Flowsshould not be negative (we losetransparency) • Cost per unit of flow{defaultvalue0}: (ifitisnegative, thenitisrevenue) • Objectivefunction: • Threeparameters for eacharc: [l, u, c] • Lower boundl • Upper boundu • Cost per unit of flowc
Diagram vslinear program 1: 1relation We will henceforththink of a properlymarked diagram equivalently as of a linear program formulation.
Properties • Coefficients on the LHS of theconstraintstakevalues -1,0 or1 • All pivot operations inthesimplexalgorithmconsisttherefore of addition and subtraction(no need for multiplicationordivision) • Evenbetter: addition and subtraction operations may be replaced by logicalopeartions (based on Boolean algebra)intheNetwork simplexalgorithm • Ifthereareonlyintegervalues on the RHS of alltheconstraints and allpivot operations areaddition and subtraction operations, thenthedecisionvariablesintheoptimalsolution will all be integers as well – unimodularity property • This property isveryusefulincase of solving many integerprograms, e.g. assignmentproblems
Transportation problem • Simple, yetveryusefulinpractice • Consists of productsources (e.g. factories), whicharedirectlyconnectedwithdestinationpoints (e.g. marketsindifferentcities). For eachconnectionthereis a unit flowcost. • Supply not greaterthancapacity of a givenfactory • Demandisequal to thesupplied products • Eacharchas a defaultvalue for upper and lowerbound and a unit flowcost(in brackets)
Assignment problem • Italsoappears as an integer program. • Assigningelmenetsof the set of people to theelments of the set of tasks so thatthetotalcompletion time for allthetasksisminimized. • Each person needscertainamount of time for thetaskorcannotcomplete a taskatall. • Each person should be assignedwithexactly one task.
Assignment problem • Assignment problem may be formulated as a transportation problem: • Each person is a sourcenode, whichintroducesexactly one unit of flowintothenetwork (iftherearemorepersonsthantasks: not morethan one unit) • Eachtaskis a destaintionnode, whichremovesexactly one unit of flowfromthenetwork • Thecost of flow on eacharcisthe time for each person to complete a giventask • Theoptimalflow on thearcs will be equal to 0 or 1 • Due to theunimodularity property, thesolution will be integer-valued, • Since sources and destinationpointshaveinflows and outflowsequal to exactly 1.
Transshipment problem • The same as transportation problem, but additionally: • Therearenodeswhichconserveflow[flowconservingnodes] – thetransshipmentpoints • Thesource and destinationpointsmayserve as transshipmentpoints as well. • B is a source and a transshipment point • G is a destanation and a transshipmentpoint • D and E aretransshipments point
Theshortestrouteproblem • Instead of applying Dijkstra algorithm we cansolveit by networkprogramming program • Theprocedureis as follows: • Draw network diagram • Arclabels: lowerbound0, upperbound+∞, cost= arclength, e.g. [0, ∞,12] • Starting point is a sourcenodewithexactly one unit of flowwithout a cost[1,1,0] • Final point is a destinationnodewithexactly one unit of flowwithout a cost[1,1,0] • Arcswithpositiveflow will be on theshortestroute. • Due to theunimodularity property theoptimalflow on eacharc will be either 0 or 1.
Theshortestroutetreeproblem • The same as theshortestroute problem, but theremay be many (if not all) destinationnodes. • Problem is to findtheshortestpathfromthestarting point to each of thefinalpoints • We couldsolve many shortestrouteproblems, changingthefinal point. Itiseasirehowever to do itin one problem. • Assumethereare many destaintionnodes. Procedure: • Draw network diagram • Arclabels: lowerbound 0, upperbound +∞, cost = arclength, e.g. [0, ∞,12] • Starting point is a sourcenodewithexactly nunit of flowwithout a cost[n,n,0] • Final point is a destinationnodewithexactly one unit of flowwithout a cost[1,1,0] • In the optimum, ther will be onlyintegervalues (unimodularity). One shouldmarkallarcswhichhavepositiveflow. Theshortestpathisfoundbackwards.
Max flow/ Min cut problem • Instead of applyingFord-Fulkersonalgorithm, we canapply minimum costnetworkflow program • Procedure: • Draw network diagram • Arclabels: lowerbound 0, upperboundmaximalflow on thisarc, cost = 0, e.g. [0, 25,0] • Starting point is a sourcenodewitha very big upperboundwithouta cost:[0,M,0], where M isvery big • Final point is a destinationnodewitha very big upperboundwitha cost of -1: [0,M,-1], where M isvery big • In the optimum: Considerdestinationnode. Cost per unit of flowis -1. Objectiveis to minimizecost, hencethe program will try to let as many units of flowthroughthisnode. In thesourcenodeit will try to let as many units of flow as well. Upper bounds for theflow on eacharc will be theonly limit.
Max flow / Min cutproblem • Thesolution will provideuswiththefollowinginformation: • Theoutflowinthedestinationnode. Isequal to themaximalflow of thenetwork. • Theflows on eacharc will givetheflowpattern of themaximumflow problem • The minimum cutisfoundthe same way, as aftertermination of theFord-Fulkersonalgorithm. • Whatis a goodvalue for M? • Not toosmall – has to be not smallerthanthemaximumflowwhich we search for • Not toolarge – to avoidnumericalproblems • Goodsuggestion– a random cutvalueinthenetwork; we knowfromthe max flow/min cuttheorem, thatthecutvalue will be not smallerthanthamaximumflowinthenetwork
Generalized networks, networkwithsideconstraints, processing networks • In a generalizednetwork, arcshavegainfactors: thesearethenumbers by which we multiplytheenteringflow to gettheoutflow: • E.g. theincrease/decreasecoefficient 0.9 maydenotetheleakingpipeline • E.g. theincreasecoefficient of 1.1 maydenotevalueinrease of theobject • Networks withsideconstraints– itmay be necessary to introduceadditionalconstraintswhichare not networkconstraints, e.g. • Specializedalgorithmswhichsolvethenetwork part via networksimplexalgorithms and therestwith a normalsimplex and thenthesolutionsarecombined. • Processing networks – veryuseful to model engineering systems: additionalprocessingnodes, inwhichflowsintheneighbouringnodesshouldappearin a specifiedproportions