Flow network




In graph theory, a flow network (also known as a transportation network) is a directed graph where each edge has a capacity and each edge receives a flow. The amount of flow on an edge cannot exceed the capacity of the edge. Often in operations research, a directed graph is called a network, the vertices are called nodes and the edges are called arcs. A flow must satisfy the restriction that the amount of flow into a node equals the amount of flow out of it, unless it is a source, which has only outgoing flow, or sink, which has only incoming flow. A network can be used to model traffic in a computer network, circulation with demands, fluids in pipes, currents in an electrical circuit, or anything similar in which something travels through a network of nodes.




Contents






  • 1 Definition


  • 2 Flows


  • 3 Intuition


  • 4 Concepts useful to flow problems


    • 4.1 Residuals


    • 4.2 Augmenting paths


    • 4.3 Multiple sources and/or sinks




  • 5 Example


  • 6 Applications


  • 7 Classifying flow problems


  • 8 See also


  • 9 References


  • 10 Further reading


  • 11 External links





Definition


A network is a graph G = (V, E), where V is a set of vertices and E is a set of V’s edges – a subset of V × V – together with a non-negative function c: V × V → ℝ, called the capacity function. Without loss of generality, we may assume that if (u, v) ∈ E then (v, u) is also a member of E, since if (v, u) ∉ E then we may add (v, u) to E and then set c(v, u) = 0.


If two nodes in G are distinguished, a source s and a sink t, then (G, c, s, t) is called a flow network.[1]



Flows


There are various notions of a flow function that can be defined in a flow graph. Flow functions model the net flow of units between pairs of nodes, and are useful when asking questions such as what is the maximum number of units that can be transferred from the source node s to the sink node t? The simplest example of a flow function is known as a pseudo-flow.


A pseudo-flow is a function f : V × V → ℝ that satisfies the following two constraints for all nodes u and v:


  • Skew symmetry: Only encode the net flow of units between a pair of nodes u and v (see intuition below), that is: f (u, v) = −f (v, u).


  • Capacity constraint: An arc's flow cannot exceed its capacity, that is: f (u, v) ≤ c(u, v).





Given a pseudo-flow f in a flow network, it is often useful to consider the net flow entering a given node v, that is, the sum of the flows entering v. The excess function xf : V → ℝ is defined by xf (u) = ∑vVf (v, u). A node u is said to be active if xf (u) > 0, deficient if xf (u) < 0 or conserving if xf (u) = 0.


These final definitions lead to two strengthenings of the definition of a pseudo-flow:


A pre-flow is a pseudo-flow that, for all vV {s}, satisfies the additional constraint:

  • Non-deficient flows: The net flow entering the node v is non-negative, except for the source, which "produces" flow. That is: xf (v) ≥ 0 for all vV {s}.


A feasible flow, or just a flow, is a pseudo-flow that, for all vV {s, t}, satisfies the additional constraint:

  • Flow conservation: The net flow entering the node v is 0, except for the source, which "produces" flow, and the sink, which "consumes" flow. That is: xf (v) = 0 for all vV {s, t}.




The value of a feasible flow f, denoted | f |, is the net flow into the sink t of the flow network. That is, | f | = xf (t).



Intuition


In the context of flow analysis, there is only an interest in considering how units are transferred between nodes in a holistic sense. Put another way, it is not necessary to distinguish multiple arcs between a pair of nodes:



  • Given any two nodes u and v, if there are two arcs from u to v with capacities 5 and 3 respectively, this is equivalent to considering only a single arc between u and v with capacity 8 — it is only useful to know that 8 units can be transferred from u to v, not how they can be transferred.

  • Again, given two nodes u and v, if there is a flow of 5 units from u to v, and another flow of 3 units from v to u, this is equivalent to a net flow of 2 units from u to v, or a net flow of −2 units from v to u (so sign indicates direction) — it is only useful to know that a net flow of 2 units will flow between u and v, and the direction that they will flow, not how that net flow is achieved.


For this reason, the capacity function c: V × V → ℝ, which does not allow for multiple arcs starting and ending at the same nodes, is sufficient for flow analysis. Similarly, it is enough to impose the skew symmetry constraint on flow functions to ensure that flow between two vertices is encoded by a single number (to indicate magnitude), and a sign (to indicate direction) — by knowing the flow between u and v you implicitly, via skew symmetry, know the flow between v and u. These simplifications of the model aren't always immediately intuitive, but they are convenient when it comes time to analyze flows.


The capacity constraint simply ensures that a flow on any one arc within the network cannot exceed the capacity of that arc.



Concepts useful to flow problems



Residuals


The residual capacity of an arc with respect to a pseudo-flow f, denoted cf, is the difference between the arc's capacity and its flow. That is, cf (e) = c(e) - f(e). From this we can construct a residual network, denoted Gf (V, Ef), which models the amount of available capacity on the set of arcs in G = (V, E). More formally, given a flow network G, the residual network Gf  has the node set V, arc set Ef = {eV × V : cf (e) > 0} and capacity function cf.


This concept is used in Ford–Fulkerson algorithm which computes the maximum flow in a flow network.


Note that there can be a path from u to v in the residual network, even though there is no path from u to v in the original network. Since flows in opposite directions cancel out, decreasing the flow from v to u is the same as increasing the flow from u to v.



Augmenting paths


An augmenting path is a path (u1, u2, ..., uk) in the residual network, where u1 = s, uk = t, and cf (ui, ui + 1) > 0. A network is at maximum flow if and only if there is no augmenting path in the residual network Gf.



Multiple sources and/or sinks


Sometimes, when modeling a network with more than one source, a supersource is introduced to the graph.[2] This consists of a vertex connected to each of the sources with edges of infinite capacity, so as to act as a global source. A similar construct for sinks is called a supersink.[3]



Example




A flow network showing flow and capacity


To the left you see a flow network with source labeled s, sink t, and four additional nodes. The flow and capacity is denoted f/c{displaystyle f/c}f/c. Notice how the network upholds skew symmetry, capacity constraints and flow conservation. The total amount of flow from s to t is 5, which can be easily seen from the fact that the total outgoing flow from s is 5, which is also the incoming flow to t. We know that no flow appears or disappears in any of the other nodes.




Residual network for the above flow network, showing residual capacities.


Below you see the residual network for the given flow. Notice how there is positive residual capacity on some edges where the original capacity is zero, for example for the edge (d,c){displaystyle (d,c)}(d,c). This flow is not a maximum flow. There is available capacity along the paths (s,a,c,t){displaystyle (s,a,c,t)}(s,a,c,t), (s,a,b,d,t){displaystyle (s,a,b,d,t)}(s,a,b,d,t) and (s,a,b,d,c,t){displaystyle (s,a,b,d,c,t)}(s,a,b,d,c,t), which are then the augmenting paths. The residual capacity of the first path is
min(c(s,a)−f(s,a),c(a,c)−f(a,c),c(c,t)−f(c,t)){displaystyle min(c(s,a)-f(s,a),c(a,c)-f(a,c),c(c,t)-f(c,t))}min(c(s,a)-f(s,a),c(a,c)-f(a,c),c(c,t)-f(c,t)) =min(5−3,3−2,2−1)=min(2,1,1)=1{displaystyle =min(5-3,3-2,2-1)=min(2,1,1)=1}=min(5-3,3-2,2-1)=min(2,1,1)=1.[citation needed] Notice that as long as there exists some path with a positive residual capacity, the flow will not be maximum. The residual capacity for some path is the minimum residual capacity of all edges in that path.



Applications



Picture a series of water pipes, fitting into a network. Each pipe is of a certain diameter, so it can only maintain a flow of a certain amount of water. Anywhere that pipes meet, the total amount of water coming into that junction must be equal to the amount going out, otherwise we would quickly run out of water, or we would have a buildup of water. We have a water inlet, which is the source, and an outlet, the sink. A flow would then be one possible way for water to get from source to sink so that the total amount of water coming out of the outlet is consistent. Intuitively, the total flow of a network is the rate at which water comes out of the outlet.


Flows can pertain to people or material over transportation networks, or to electricity over electrical distribution systems. For any such physical network, the flow coming into any intermediate node needs to equal the flow going out of that node. This conservation constraint is equivalent to Kirchhoff's current law.


Flow networks also find applications in ecology: flow networks arise naturally when considering the flow of nutrients and energy between different organisms in a food web. The mathematical problems associated with such networks are quite different from those that arise in networks of fluid or traffic flow. The field of ecosystem network analysis, developed by Robert Ulanowicz and others, involves using concepts from information theory and thermodynamics to study the evolution of these networks over time.



Classifying flow problems


The simplest and most common problem using flow networks is to find what is called the maximum flow, which provides the largest possible total flow from the source to the sink in a given graph. There are many other problems which can be solved using max flow algorithms, if they are appropriately modeled as flow networks, such as bipartite matching, the assignment problem and the transportation problem. Maximum flow problems can be solved efficiently with the relabel-to-front algorithm. The max-flow min-cut theorem states that finding a maximal network flow is equivalent to finding a cut of minimum capacity that separates the source and the sink, where a cut is the division of vertices such that the source is in one division and the sink is in another.


























Well-known algorithms for the Maximum Flow Problem
Inventor(s) Year Time
complexity
(with n nodes
and m arcs)
Edmonds–Karp algorithm 1972
O(m2n)
MPM (Malhotra, Pramodh-Kumar and Maheshwari)
algorithm[4]
1978
O(n3)

James B. Orlin[5]
2013
O(mn)

In a multi-commodity flow problem, you have multiple sources and sinks, and various "commodities" which are to flow from a given source to a given sink. This could be for example various goods that are produced at various factories, and are to be delivered to various given customers through the same transportation network.


In a minimum cost flow problem, each edge u,v{displaystyle u,v}u,v has a given cost k(u,v){displaystyle k(u,v)}k(u,v), and the cost of sending the flow f(u,v){displaystyle f(u,v)}f(u,v) across the edge is f(u,v)⋅k(u,v){displaystyle f(u,v)cdot k(u,v)}f(u,v)cdot k(u,v). The objective is to send a given amount of flow from the source to the sink, at the lowest possible price.


In a circulation problem, you have a lower bound l(u,v){displaystyle l(u,v)}l(u,v) on the edges, in addition to the upper bound c(u,v){displaystyle c(u,v)}c(u,v). Each edge also has a cost. Often, flow conservation holds for all nodes in a circulation problem, and there is a connection from the sink back to the source. In this way, you can dictate the total flow with l(t,s){displaystyle l(t,s)}l(t,s) and c(t,s){displaystyle c(t,s)}c(t,s). The flow circulates through the network, hence the name of the problem.


In a network with gains or generalized network each edge has a gain, a real number (not zero) such that, if the edge has gain g, and an amount x flows into the edge at its tail, then an amount gx flows out at the head.


In a source localization problem, an algorithm tries to identify the most likely source node of information diffusion through a partially observed network. This can be done in linear time for trees and cubic time for arbitrary networks and has applications ranging from tracking mobile phone users to identifying the originating village of disease outbreaks.[6]



See also



  • Braess' paradox

  • Centrality

  • Ford–Fulkerson algorithm

  • Dinic's algorithm

  • Flow (computer networking)

  • Flow graph (disambiguation)

  • Max-flow min-cut theorem

  • Oriented matroid

  • Shortest path problem



References





  1. ^ A.V. Goldberg, É. Tardos and R.E. Tarjan, Network flow algorithms, Tech. Report STAN-CS-89-1252, Stanford University CS Dept., 1989


  2. ^  This article incorporates public domain material from the NIST document: Black, Paul E. "Supersource". Dictionary of Algorithms and Data Structures..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"""""""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}


  3. ^  This article incorporates public domain material from the NIST document: Black, Paul E. "Supersink". Dictionary of Algorithms and Data Structures.


  4. ^ Malhotra, V.M.; Kumar, M.Pramodh; Maheshwari, S.N. (1978). "An O(|V|3){displaystyle O(|V|^{3})}O(|V|^{3}) algorithm for finding maximum flows in networks". Information Processing Letters. 7 (6): 277–278. doi:10.1016/0020-0190(78)90016-9.


  5. ^ Orlin, J. B. (2013). "Max flows in O(nm) time, or better" (PDF). Proceedings of the 2013 Symposium on the Theory of Computing: 765–774. Archived at


  6. ^ http://www.pedropinto.org.s3.amazonaws.com/publications/locating_source_diffusion_networks.pdf




Further reading




  • George T. Heineman; Gary Pollice; Stanley Selkow (2008). "Chapter 8:Network Flow Algorithms". Algorithms in a Nutshell. Oreilly Media. pp. 226–250. ISBN 978-0-596-51624-6.


  • Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin (1993). Network Flows: Theory, Algorithms and Applications. Prentice Hall. ISBN 0-13-617549-X.CS1 maint: Multiple names: authors list (link)


  • Bollobás, Béla (1979). Graph Theory: An Introductory Course. Heidelberg: Springer-Verlag. ISBN 3-540-90399-2.


  • Chartrand, Gary & Oellermann, Ortrud R. (1993). Applied and Algorithmic Graph Theory. New York: McGraw-Hill. ISBN 0-07-557101-3.CS1 maint: Multiple names: authors list (link)


  • Even, Shimon (1979). Graph Algorithms. Rockville, Maryland: Computer Science Press. ISBN 0-914894-21-8.


  • Gibbons, Alan (1985). Algorithmic Graph Theory. Cambridge: Cambridge University Press. ISBN 0-521-28881-9.


  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2001) [1990]. "26". Introduction to Algorithms (2nd ed.). MIT Press and McGraw-Hill. pp. 696–697. ISBN 0-262-03293-7.CS1 maint: Multiple names: authors list (link)



External links



  • Maximum Flow Problem

  • Real graph instances

  • Lemon C++ library with several maximum flow and minimum cost circulation algorithms


  • QuickGraph, graph data structures and algorithms for .Net




Popular posts from this blog

鏡平學校

ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

Why https connections are so slow when debugging (stepping over) in Java?