Examine individual changes
Appearance
This page allows you to examine the variables generated by the Edit Filter for an individual change.
Variables generated for this change
Variable | Value |
---|---|
Edit count of the user (user_editcount ) | 480099 |
Name of the user account (user_name ) | 'Bgwhite' |
Age of the user account (user_age ) | 343611237 |
Groups (including implicit) the user is in (user_groups ) | [
0 => 'sysop',
1 => '*',
2 => 'user',
3 => 'autoconfirmed'
] |
Global groups that the user is in (global_user_groups ) | [] |
Whether or not a user is editing through the mobile interface (user_mobile ) | false |
Page ID (page_id ) | 403165 |
Page namespace (page_namespace ) | 0 |
Page title without namespace (page_title ) | 'Maximum flow problem' |
Full page title (page_prefixedtitle ) | 'Maximum flow problem' |
Last ten users to contribute to the page (page_recent_contributors ) | [
0 => 'Yobot',
1 => 'Cedar101',
2 => '31.48.201.203',
3 => '217.111.70.215',
4 => 'ClueBot NG',
5 => '142.157.133.16',
6 => 'Finog',
7 => '69.157.188.203',
8 => 'Dylan Thurston',
9 => 'Mild Bill Hiccup'
] |
Action (action ) | 'edit' |
Edit summary/reason (summary ) | '[[WP:CHECKWIKI]] error fix #34. Template programming element. Do [[Wikipedia:GENFIXES|general fixes]] and cleanup if needed. - using [[Project:AWB|AWB]] (11971)' |
Whether or not the edit is marked as minor (no longer in use) (minor_edit ) | true |
Old page wikitext, before the edit (old_wikitext ) | '[[File:Max flow.svg|thumb|upright=1.5|A network with an example of maximum flow. The source is ''s'', and the sink ''t''. The numbers denote flow and capacity.]]
In [[Optimization (mathematics)|optimization theory]], '''maximum flow problems''' involve finding a feasible flow through a single-source, single-sink [[flow network]] that is maximum.
The maximum flow problem can be seen as a special case of more complex network flow problems, such as the [[circulation problem]]. The maximum value of an s-t flow (i.e., flow from [[Glossary of graph theory#Direction|source]] s to [[Glossary of graph theory#Direction|sink]] t) is equal to the minimum capacity of an [[Cut (graph theory)|s-t cut]] (i.e., cut severing s from t) in the network, as stated in the [[max-flow min-cut theorem]].
==History==
The maximum flow problem was first formulated in 1954 by [[Ted Harris (mathematician)|T. E. Harris]] and F. S. Ross as a simplified model of Soviet railway traffic flow.<ref>{{Cite journal | last1 = Schrijver | first1 = A. | title = On the history of the transportation and maximum flow problems | doi = 10.1007/s101070100259 | journal = Mathematical Programming | volume = 91 | issue = 3 | pages = 437–445 | year = 2002 | pmid = | pmc = }}</ref><ref>{{Cite book | doi = 10.1007/0-387-25837-X_5 | first1 = Saul I. | last1 = Gass| first2 = Arjang A. | last2 = Assad | chapter = Mathematical, algorithmic and professional developments of operations research from 1951 to 1956 | title = An Annotated Timeline of Operations Research | series = International Series in Operations Research & Management Science | volume = 75 | pages = 79–110 | year = 2005 | isbn = 1-4020-8116-2 | pmid = | pmc = }}</ref><ref>{{cite journal | first1 = T. E. | last1 = Harris | authorlink1 = Ted Harris (mathematician) | first2 = F. S. | last2 = Ross | year = 1955 | title = Fundamentals of a Method for Evaluating Rail Net Capacities | publisher = Rand Corporation | journal = Research Memorandum| url = http://www.dtic.mil/dtic/tr/fulltext/u2/093458.pdf}}</ref>
In 1955, [[Lester R. Ford, Jr.]] and [[D. R. Fulkerson|Delbert R. Fulkerson]] created the first known algorithm, the [[Ford–Fulkerson algorithm]].<ref>{{Cite journal | last1 = Ford | first1 = L. R. | authorlink1 = L. R. Ford, Jr.| last2 = Fulkerson | first2 = D. R. | authorlink2 = D. R. Fulkerson| doi = 10.4153/CJM-1956-045-5 | title = Maximal flow through a network | journal = [[Canadian Journal of Mathematics]]| volume = 8 | pages = 399 | year = 1956 | pmid = | pmc = }}</ref><ref>Ford, L.R., Jr.; Fulkerson, D.R., ''Flows in Networks'', Princeton University Press (1962).</ref>
Over the years, various improved solutions to the maximum flow problem were discovered, notably the shortest augmenting path algorithm of Edmonds and Karp and independently Dinitz; the blocking flow algorithm of Dinitz; the [[Push–relabel maximum flow algorithm|push-relabel algorithm]] of [[Andrew V. Goldberg|Goldberg]] and [[Robert Tarjan|Tarjan]]; and the binary blocking flow algorithm of Goldberg and Rao. The electrical flow algorithm of Christiano, Kelner, Madry, and Spielman finds an approximately optimal maximum flow but only works in undirected graphs.<ref>{{Cite book | last1 = Kelner | first1 = J. A. | last2 = Lee | first2 = Y. T. | last3 = Orecchia | first3 = L. | last4 = Sidford | first4 = A. | chapter = An Almost-Linear-Time Algorithm for Approximate Max Flow in Undirected Graphs, and its Multicommodity Generalizations | doi = 10.1137/1.9781611973402.16 | title = Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms | pages = 217 | year = 2014 | isbn = 978-1-61197-338-9 | url = http://math.mit.edu/~kelner/Publications/Docs/klos_maxflow_main.pdf| arxiv = 1304.2338| pmid = | pmc = }}</ref><ref>{{cite web | url = http://web.mit.edu/newsoffice/2013/new-algorithm-can-dramatically-streamline-solutions-to-the-max-flow-problem-0107.html | title = New algorithm can dramatically streamline solutions to the ‘max flow’ problem | first = Helen | last = Knight | date = 7 January 2014 | accessdate = 8 January 2014 | publisher = MIT News}}</ref>
==Definition==
[[File:MFP1.jpg|thumb|upright=0.8|A flow network, with source s and sink t. The numbers next to the edge are the capacities.]]
Let <math>\scriptstyle N = (V, E)</math> be a network with <math>\scriptstyle s, t \in V</math> being the source and the sink of <math>\scriptstyle N</math> respectively.
: The '''capacity''' of an edge is a mapping <math>\scriptstyle c : E \to \mathbb{R}^+</math>, denoted by <math>\scriptstyle c_{uv}</math> or <math>\scriptstyle c(u, v)</math>. It represents the maximum amount of flow that can pass through an edge.
: A '''flow''' is a mapping <math>\scriptstyle f : E \to \mathbb{R}^+</math>, denoted by <math>\scriptstyle f_{uv}</math> or <math>\scriptstyle f(u, v)</math>, subject to the following two constraints:
:: 1. <math>\scriptstyle f_{uv} \leq c_{uv}</math>, for each <math>\scriptstyle (u, v) \in E</math> (capacity constraint: the flow of an edge cannot exceed its capacity)
:: 2. <math>\scriptstyle \sum_{u:(u, v) \in E} f_{uv} = \sum_{u:(v, u) \in E} f_{vu}</math>, for each <math>\scriptstyle v \in V \setminus \{s, t\}</math> (conservation of flows: the sum of the flows entering a node must equal the sum of the flows exiting a node, except for the source and the sink nodes)
: The '''value of flow''' is defined by <math>\scriptstyle |f| = \sum_{v:(s,v) \in E} f_{sv}</math>, where <math>\scriptstyle s</math> is the source of <math>\scriptstyle N</math>. It represents the amount of flow passing from the source to the sink.
The '''maximum flow problem''' is to maximize <math>\scriptstyle |f|</math>, that is, to route as much flow as possible from <math>\scriptstyle s</math> to <math>\scriptstyle t</math>.
==Solutions==
We can define the '''Residual Graph''', which provides a systematic way to search for forward-backward operations in order to find the maximum flow.
Given a flow network {{mvar|G}}, and a flow {{mvar|f}} on {{mvar|G}}, we define the residual graph <math>G_{f}</math> of {{mvar|G}} with respect to {{mvar|f}} as follows.
# The node set of <math>G_{f}</math> is the same as that of {{mvar|G}}.
# Each edge <math>e = (u, v)</math> of <math>G_{f}</math> is with a capacity of <math>c_{e} - f(e)</math>.
# Each edge <math>e' = (v, u)</math> of <math>G_{f}</math> is with a capacity of <math>f(e)</math>.
{{clear}}
The following table lists algorithms for solving the maximum flow problem.
{| class="wikitable"
! Method
! Complexity
! Description
|-
| [[Linear programming]]
|
| Constraints given by the definition of a [[flow network|legal flow]]. See the [[Max-flow min-cut theorem#Linear program formulation|linear program]] here.
|-
| [[Ford–Fulkerson algorithm]]
| {{math|''O''(''E'' max<nowiki>|</nowiki> ''f'' <nowiki>|</nowiki>)}}
| As long as there is an open path through the residual graph, send the minimum of the residual capacities on the path.
The algorithm is only guaranteed to terminate if all weights are [[rational numbers|rational]]. Otherwise it is possible that the algorithm will not converge to the maximum value. However, if the algorithm terminates, it is guaranteed to find the maximum value.
|-
| [[Edmonds–Karp algorithm]]
| {{math|''O''(''VE''<sup>2</sup>)}}
| A specialization of Ford–Fulkerson, finding augmenting paths with [[breadth-first search]].
|-
| [[Dinic's algorithm|Dinic's blocking flow algorithm]]
| {{math|''O''(''V''<sup>2</sup>''E'')}}
| In each phase the algorithms builds a layered graph with [[breadth-first search]] on the [[residual graph]]. The maximum flow in a layered graph can be calculated in {{math|''O''(''VE'')}} time, and the maximum number of the phases is {{math|''n''-1}}. In networks with unit capacities, Dinic's algorithm terminates in <math>O(E\sqrt{V})</math> time.
|-
|MPM (Malhotra, Pramodh-Kumar and Maheshwari) algorithm<ref>{{Cite journal | last1 = Malhotra | first1 =V.M.| last2 = Kumar | first2 = M.Pramodh| last3 = Maheshwari | first3 = S.N.| doi = 10.1016/0020-0190(78)90016-9| title = An <math>O(|V|^3)</math> algorithm for finding maximum flows in networks| journal = Information Processing Letters| volume = 7| issue = 6| pages = 277–278 | year = 1978}}</ref>
| {{math|''O''(''V''<sup>3</sup>)}}
| Refer to the [http://dx.doi.org/10.1016/0020-0190(78)90016-9 Original Paper].
|-
| [[Dinic's algorithm]]
| {{math|''O''(''VE'' log(''V''))}}
| The [[dynamic trees]] data structure speeds up the maximum flow computation in the layered graph to {{math|''O''(''E'' log(''V''))}}.
|-
| [[Relabel-to-front algorithm|General push-relabel maximum flow algorithm]]
| {{math|''O''(''V''<sup>2</sup>''E'')}}
| The push relabel algorithm maintains a preflow, i.e. a flow function with the possibility of excess in the vertices. The algorithm runs while there is a vertex with positive excess, i.e. an active vertex in the graph. The push operation increases the flow on a residual edge, and a height function on the vertices controls which residual edges can be pushed. The height function is changed with a relabel operation. The proper definitions of these operations guarantee that the resulting flow function is a maximum flow.
|-
| [[Relabel-to-front algorithm|Push-relabel algorithm with ''FIFO'' vertex selection rule]]
| {{math|''O''(''V''<sup>3</sup>)}}
| Push-relabel algorithm variant which always selects the most recently active vertex, and performs push operations until the excess is positive or there are admissible residual edges from this vertex.
|-
| [[Relabel-to-front algorithm|Push-relabel algorithm with dynamic trees]]
| <math>O\left(VE \log \frac {V^2} E \right)</math>
| The algorithm builds limited size trees on the residual graph regarding to height function. These trees provide multilevel push operations.
|-
|KRT (King, Rao, Tarjan)'s algorithm<ref>{{Cite journal | last1 = King | first1 = V.| last2 = Rao | first2 = S.| last3 = Tarjan | first3 = R.| doi = 10.1006/jagm.1994.1044| title = A Faster Deterministic Maximum Flow Algorithm| journal = Journal of Algorithms| volume = 17| issue = 3| pages = 447–474| year = 1994}}</ref>
| <math>O(EV \log_{\frac E {V \log V}}V)</math>
|
|-
|Binary blocking flow algorithm<ref>{{Cite journal | last1 = Goldberg | first1 = A. V. | authorlink1 = Andrew V. Goldberg| last2 = Rao | first2 = S. | doi = 10.1145/290179.290181 | title = Beyond the flow decomposition barrier | journal = [[Journal of the ACM]]| volume = 45 | issue = 5 | pages = 783 | year = 1998 | pmid = | pmc = }}</ref>
| <math>O\left(E \cdot \min(V^{\frac 2 3},\sqrt{E}) \cdot \log \frac {V^2} E \log{U}\right)</math>
|The value ''U'' corresponds to the maximum capacity of the network.
|-
|Jim Orlin's + KRT (King, Rao, Tarjan)'s algorithm<ref>{{Cite journal | last1 = Orlin | first1 = James B.| doi = 10.1145/2488608.2488705| title = Max flows in O(nm) time, or better| journal = STOC '13 Proceedings of the forty-fifth annual ACM symposium on Theory of computing| pages = 765–774| year = 2013}}</ref>
| <math>O(VE)</math>
|[http://jorlin.scripts.mit.edu/Max_flows_in_O(nm)_time.html Orlin's algorithm] solves max-flow in {{math|''O''(''VE'')}} time for <math>E \leq O(V^{{16 \over 15} - \epsilon})</math> while KRT solves it in {{math|''O''(''VE'')}} for <math>E > V^{1+\epsilon}</math>.
|}
For a more extensive list, see<ref>{{Cite journal | last1 = Goldberg | first1 = A. V. | authorlink1 = Andrew V. Goldberg| last2 = Tarjan | first2 = R. E. | doi = 10.1145/48014.61051 | title = A new approach to the maximum-flow problem | journal = [[Journal of the ACM]]| volume = 35 | issue = 4 | pages = 921 | year = 1988 | pmid = | pmc = }}</ref>
==Integral flow theorem==
The integral flow theorem states that
: '''If each edge in a flow network has integral capacity, then there exists an integral maximal flow.'''
==Application==
===Multi-source multi-sink maximum flow problem===
[[File:Multi-source multi-sink flow problem.svg|thumb|right|Fig. 4.1.1. Transformation of a multi-source multi-sink maximum flow problem into a single-source single-sink maximum flow problem]]
Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).
===Minimum path cover in directed acyclic graph===
Given a [[directed acyclic graph]] {{var|G}} = ({{var|V}}, {{var|E}}), we are to find the minimum number of [[Path (graph theory)|vertex-disjoint paths]] to cover each vertex in {{var|V}}. We can construct a bipartite graph {{var|G'}} = ({{var|V}}<sub>out</sub>∪{{var|V}}<sub>in</sub>, {{var|E'}} ) from {{var|G}}, where
# {{var|V}}<sub>out</sub> = {{{var|v}}∈{{var|V}}: {{var|v}} has positive out-degree}.
# {{var|V}}<sub>in</sub> = {{{var|v}}∈{{var|V}}: {{var|v}} has positive in-degree}.
# {{var|E'}} = {({{var|u}},{{var|v}})∈{{var|V}}<sub>out</sub>×{{var|V}}<sub>in</sub>: ({{var|u}},{{var|v}})∈{{var|E}}}.
Then it can be shown, via [[König's theorem (graph theory)|König's theorem]], that {{var|G'}} has a matching of size {{var|m}} if and only if there exists {{var|n}}-{{var|m}} vertex-disjoint paths that cover each vertex in {{var|G}}, where {{var|n}} is the number of vertices in {{var|G}}. Therefore, the problem can be solved by finding the maximum cardinality matching in {{var|G'}} instead.
===Maximum cardinality bipartite matching===
[[File:Maximum bipartite matching to max flow.svg|thumb|right|Fig. 4.3.1. Transformation of a maximum bipartite matching problem into a maximum flow problem]]
Given a [[bipartite graph]] {{var|G}} = ({{var|X}}∪{{var|Y}}, {{var|E}}), we are to find a [[maximum cardinality matching]] in {{var|G}}, that is a matching that contains the largest possible number of edges. This problem can be transformed into a maximum flow problem by constructing a network {{var|N}} = ({{var|X}}∪{{var|Y}}∪{{{var|s}},{{var|t}}), {{var|E'}} }, where
# {{var|E}}' contains the edges in {{var|G}} directed from {{var|X}} to {{var|Y}}.
# ({{var|s}},{{var|x}})∈{{var|E'}} for each {{var|x}}∈{{var|X}} and ({{var|y}},{{var|t}})∈{{var|E'}} for each {{var|y}}∈{{var|Y}}.
# {{var|c}}({{var|e}}) = 1 for each {{var|e}}∈{{var|E}}' (See Fig. 4.3.1).
Then the value of the maximum flow in {{var|N}} is equal to the size of the maximum matching in {{var|G}}.
===Maximum flow problem with vertex capacities===
[[File:Node splitting.svg|thumb|right|Fig. 4.4.1. Transformation of a maximum flow problem with vertex capacities constraint into the original maximum flow problem by node splitting]]
Given a network <math>N = (V, E)</math>, in which there is capacity at each node in addition to edge capacity, that is, a mapping <math>c: V\mapsto \mathbb{R}^{+}</math>, denoted by <math>c(v)</math>, such that the flow {{mvar|f}} has to satisfy not only the capacity constraint and the conservation of flows, but also the vertex capacity constraint
<center><math> \sum_{i\in V} f_{iv} \le c(v) \qquad \forall v \in V \backslash \{s,t\}</math>.</center>
In other words, the amount of flow passing through a vertex cannot exceed its capacity. To find the maximum flow across {{mvar|N}}, we can transform the problem into the maximum flow problem in the original sense by expanding {{mvar|N}}. First, each <math>v\in V</math> is replaced by <math>v_{\text{in}}</math> and <math>v_{\text{out}}</math>, where <math>v_{\text{in}}</math> is connected by edges going into {{mvar|v}} and <math>v_{\text{out}}</math> is connected to edges coming out from {{mvar|v}}, then assign capacity <math>c(v)</math> to the edge connecting <math>v_{\text{in}}</math> and <math>v_{\text{out}}</math> (see Fig. 4.4.1). In this expanded network, the vertex capacity constraint is removed and therefore the problem can be treated as the original maximum flow problem.
===Maximum edge-disjoint path===
Given a directed graph {{var|G}} = ({{var|V}}, {{var|E}}) and two vertices {{var|s}} and {{var|t}}, we are to find the maximum number of edge-disjoint paths from
{{var|s}} to {{var|t}}. This problem can be transformed to a maximum flow problem by constructing a network {{var|N}} = ({{var|V}}, {{var|E}}) from {{var|G}} with {{var|s}} and {{var|t}} being the source and the sink of {{var|N}} respectively and assign each edge with unit capacity.
===Maximum independent (vertex-disjoint) path===
Given a directed graph {{var|G}} = ({{var|V}}, {{var|E}}) and two vertices {{var|s}} and {{var|t}}, we are to find the maximum number of independent paths from {{var|s}} to {{var|t}}. Two paths are said to be independent if they do not have a vertex in common apart from {{var|s}} and {{var|t}}. We can construct a network {{var|N}} = ({{var|V}}, {{var|E}}) from {{var|G}} with vertex capacities, where
# {{var|s}} and {{var|t}} are the source and the sink of {{var|N}} respectively.
# {{var|c}}({{var|v}}) = 1 for each {{var|v}}∈{{var|V}}.
# {{var|c}}({{var|e}}) = 1 for each {{var|e}}∈{{var|E}}.
Then the value of the maximum flow is equal to the maximum number of independent paths from {{var|s}} to {{var|t}}.
==Real world applications==
===Baseball elimination===
[[File:Baseball Elimination Problem.png|thumb|Construction of network flow for baseball elimination problem]]
In the [[baseball]] elimination problem there are ''n'' teams competing in a league. At a specific stage of the league season, ''w''<sub>i</sub> is the number of wins and ''r''<sub>i</sub> is the number of games left to play for team ''i'' and ''r''<sub>ij</sub> is the number of games left against team ''j''. A team is eliminated if it has no chance to finish the season in the first place. The task of the baseball elimination problem is to determine which teams are eliminated at each point during the season. Schwartz<ref>{{Cite journal | last1 = Schwartz | first1 = B. L. | title = Possible Winners in Partially Completed Tournaments | doi = 10.1137/1008062 | journal = [[SIAM Review]]| jstor = 2028206| volume = 8 | issue = 3 | pages = 302 | year = 1966 | pmid = | pmc = }}</ref> proposed a method which reduces this problem to maximum network flow. In this method a network is created to determine whether team ''k'' is eliminated.
Let ''G'' = (''V'', ''E'') be a network with ''s'',''t'' ∈ ''V'' being the source and the sink respectively. One adds a game node {''i'',''j''} with ''i'' < ''j'' to ''V'', and connects each of them from ''s'' by an edge with capacity ''r''<sub>ij</sub> – which represents the number of plays between these two teams. We also add a team node for each team and connect each game node {''i'',''j''} with to team nodes ''i'' and ''j'' to ensure one of them wins. One does not need to restrict the flow value on these edges. Finally, edges are made from team node ''i'' to the sink node ''t'' and the capacity of ''w''<sub>k</sub>+''r''<sub>k</sub>–''w''<sub>i</sub> is set to prevent team ''i'' from winning more than ''w''<sub>k</sub>+''r''<sub>k</sub>.
Let ''S'' be the set of all teams participating in the league and let <math>\scriptstyle r(S - \{k\}) = \sum_{i,j \in \{S-\{k\}\}, i < j} r_{ij}</math>. In this method it is claimed team ''k'' is not eliminated if and only if a flow value of size ''r''(''S'' − {''k''}) exists in network ''G''. In the mentioned article it is proved that this flow value is the maximum flow value from ''s'' to ''t''.
===Airline scheduling===
In the airline industry a major problem is the scheduling of the flight crews. The airline scheduling problem can be considered as an application of extended maximum network flow. The input of this problem is a set of flights ''F'' which contains the information about where and when each flight departs and arrives. In one version of airline scheduling the goal is to produce a feasible schedule with at most ''k'' crews.
In order to solve this problem one uses a variation of the [[circulation problem]] called bounded circulation which is the generalization of [[flow network|network flow]] problems, with the added constraint of a lower bound on edge flows.
Let ''G'' = (''V'', ''E'') be a network with ''s'',''t'' ∈ ''V'' as the source and the sink nodes. For the source and destination of every flight ''i'', one adds two nodes to ''V'', node ''s''<sub>i</sub> as the source and node ''d''<sub>i</sub> as the destination node of flight ''i''. One also adds the following edges to ''E'':
# An edge with capacity [0, 1] between ''s'' and each ''s''<sub>i</sub>.
# An edge with capacity [0, 1] between each ''d''<sub>i</sub> and ''t''.
# An edge with capacity [1, 1] between each pair of ''s''<sub>i</sub> and ''d''<sub>i</sub>.
# An edge with capacity [0, 1] between each ''d''<sub>i</sub> and ''s''<sub>j</sub>, if source ''s''<sub>j</sub> is reachable with a reasonable amount of time and cost from the destination of flight ''i''.
# An edge with capacity [0, ''<big>∞</big>''] between ''s'' and ''t''.
In the mentioned method, it is claimed and proved that finding a flow value of ''k'' in ''G'' between ''s'' and ''t'' is equal to finding a feasible schedule for flight set ''F'' with at most ''k'' crews.<ref name="ITA">{{cite book | author = [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]] | title=[[Introduction to Algorithms]], Second Edition | chapter = 26. Maximum Flow | year = 2001 | publisher = MIT Press and McGraw-Hill | isbn = 0-262-03293-7 | pages=643–668}}</ref>
Another version of airline scheduling is finding the minimum needed crews to perform all the flights. In order to find an answer to this problem, a bipartite graph ''G’'' = (''A'' ∪ ''B'', ''E'') is created where each flight has a copy in set ''A'' and set ''B''. If the same plane can perform flight ''j'' after flight ''i'', ''i''∈''A'' is connected to ''j''∈''B''. A matching in ''G’'' induces a schedule for ''F'' and obviously maximum bipartite matching in this graph produces an airline schedule with minimum number of crews.<ref name="ITA"/> As it is mentioned in the Application part of this article, the maximum cardinality bipartite matching is an application of maximum flow problem.
===Circulation–demand problem===
There are some factories that produce goods and some villages where the goods have to be delivered. They are connected by a networks of roads with each road having a capacity {{mvar|c}} for maximum goods that can flow through it. The problem is to find if there is a circulation that satisfies the demand.
This problem can be transformed into a maximum-flow problem.
# Add a source node {{mvar|s}} and add edges from it to every factory node {{mvar|f<sub>i</sub>}} with capacity {{mvar|p<sub>i</sub>}} where {{mvar|p<sub>i</sub>}} is the production rate of factory {{mvar|f<sub>i</sub>}}.
# Add a sink node {{mvar|t}} and add edges from all villages {{mvar|v<sub>i</sub>}} to {{mvar|t}} with capacity {{mvar|d<sub>i</sub>}} where {{mvar|d<sub>i</sub>}} is the demand rate of village {{mvar|v<sub>i</sub>}}.
Let ''G'' = (''V'', ''E'') be this new network. There exists a circulation that satisfies the demand if and only if :
: {{math|Maximum flow value(''G'')}} <math> = \sum_{i \in v} d_i </math>.
If there exists a circulation, looking at the max-flow solution would give the answer as to how much goods have to be sent on a particular road for satisfying the demands.
==See also==
* [[Closure problem]]
* [[Minimum-cost flow problem]]
==References==
{{reflist}}
==Further reading==
* {{cite journal
| author = [[Joseph Cheriyan]] and [[Kurt Mehlhorn]]
| title = An analysis of the highest-level selection rule in the preflow-push max-flow algorithm
| journal = Information Processing Letters
| volume = 69
| year = 1999
| pages = 239–242
| doi = 10.1016/S0020-0190(99)00019-8
| issue = 5
}}
* {{cite journal
| author = [[Daniel D. Sleator]] and [[Robert E. Tarjan]]
| title = A data structure for dynamic trees
| journal = Journal of Computer and System Sciences
| volume = 26
| year = 1983
| issn = 0022-0000
| pages = 362–391
| doi = 10.1016/0022-0000(83)90006-5
| url = http://www.cs.cmu.edu/~sleator/papers/dynamic-trees.pdf
| issue = 3
}}
* {{cite book | author = Eugene Lawler | authorlink = Eugene Lawler | title = Combinatorial Optimization: Networks and Matroids | chapter = 4. Network Flows | year = 2001 | publisher = Dover | isbn = 0-486-41453-1 | pages = 109–177}}
{{DEFAULTSORT:Maximum Flow Problem}}
[[Category:Network flow]]
[[Category:Mathematical problems]]' |
New page wikitext, after the edit (new_wikitext ) | '[[File:Max flow.svg|thumb|upright=1.5|A network with an example of maximum flow. The source is ''s'', and the sink ''t''. The numbers denote flow and capacity.]]
In [[Optimization (mathematics)|optimization theory]], '''maximum flow problems''' involve finding a feasible flow through a single-source, single-sink [[flow network]] that is maximum.
The maximum flow problem can be seen as a special case of more complex network flow problems, such as the [[circulation problem]]. The maximum value of an s-t flow (i.e., flow from [[Glossary of graph theory#Direction|source]] s to [[Glossary of graph theory#Direction|sink]] t) is equal to the minimum capacity of an [[Cut (graph theory)|s-t cut]] (i.e., cut severing s from t) in the network, as stated in the [[max-flow min-cut theorem]].
==History==
The maximum flow problem was first formulated in 1954 by [[Ted Harris (mathematician)|T. E. Harris]] and F. S. Ross as a simplified model of Soviet railway traffic flow.<ref>{{Cite journal | last1 = Schrijver | first1 = A. | title = On the history of the transportation and maximum flow problems | doi = 10.1007/s101070100259 | journal = Mathematical Programming | volume = 91 | issue = 3 | pages = 437–445 | year = 2002 | pmid = | pmc = }}</ref><ref>{{Cite book | doi = 10.1007/0-387-25837-X_5 | first1 = Saul I. | last1 = Gass| first2 = Arjang A. | last2 = Assad | chapter = Mathematical, algorithmic and professional developments of operations research from 1951 to 1956 | title = An Annotated Timeline of Operations Research | series = International Series in Operations Research & Management Science | volume = 75 | pages = 79–110 | year = 2005 | isbn = 1-4020-8116-2 | pmid = | pmc = }}</ref><ref>{{cite journal | first1 = T. E. | last1 = Harris | authorlink1 = Ted Harris (mathematician) | first2 = F. S. | last2 = Ross | year = 1955 | title = Fundamentals of a Method for Evaluating Rail Net Capacities | publisher = Rand Corporation | journal = Research Memorandum| url = http://www.dtic.mil/dtic/tr/fulltext/u2/093458.pdf}}</ref>
In 1955, [[Lester R. Ford, Jr.]] and [[D. R. Fulkerson|Delbert R. Fulkerson]] created the first known algorithm, the [[Ford–Fulkerson algorithm]].<ref>{{Cite journal | last1 = Ford | first1 = L. R. | authorlink1 = L. R. Ford, Jr.| last2 = Fulkerson | first2 = D. R. | authorlink2 = D. R. Fulkerson| doi = 10.4153/CJM-1956-045-5 | title = Maximal flow through a network | journal = [[Canadian Journal of Mathematics]]| volume = 8 | pages = 399 | year = 1956 | pmid = | pmc = }}</ref><ref>Ford, L.R., Jr.; Fulkerson, D.R., ''Flows in Networks'', Princeton University Press (1962).</ref>
Over the years, various improved solutions to the maximum flow problem were discovered, notably the shortest augmenting path algorithm of Edmonds and Karp and independently Dinitz; the blocking flow algorithm of Dinitz; the [[Push–relabel maximum flow algorithm|push-relabel algorithm]] of [[Andrew V. Goldberg|Goldberg]] and [[Robert Tarjan|Tarjan]]; and the binary blocking flow algorithm of Goldberg and Rao. The electrical flow algorithm of Christiano, Kelner, Madry, and Spielman finds an approximately optimal maximum flow but only works in undirected graphs.<ref>{{Cite book | last1 = Kelner | first1 = J. A. | last2 = Lee | first2 = Y. T. | last3 = Orecchia | first3 = L. | last4 = Sidford | first4 = A. | chapter = An Almost-Linear-Time Algorithm for Approximate Max Flow in Undirected Graphs, and its Multicommodity Generalizations | doi = 10.1137/1.9781611973402.16 | title = Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms | pages = 217 | year = 2014 | isbn = 978-1-61197-338-9 | url = http://math.mit.edu/~kelner/Publications/Docs/klos_maxflow_main.pdf| arxiv = 1304.2338| pmid = | pmc = }}</ref><ref>{{cite web | url = http://web.mit.edu/newsoffice/2013/new-algorithm-can-dramatically-streamline-solutions-to-the-max-flow-problem-0107.html | title = New algorithm can dramatically streamline solutions to the ‘max flow’ problem | first = Helen | last = Knight | date = 7 January 2014 | accessdate = 8 January 2014 | publisher = MIT News}}</ref>
==Definition==
[[File:MFP1.jpg|thumb|upright=0.8|A flow network, with source s and sink t. The numbers next to the edge are the capacities.]]
Let <math>\scriptstyle N = (V, E)</math> be a network with <math>\scriptstyle s, t \in V</math> being the source and the sink of <math>\scriptstyle N</math> respectively.
: The '''capacity''' of an edge is a mapping <math>\scriptstyle c : E \to \mathbb{R}^+</math>, denoted by <math>\scriptstyle c_{uv}</math> or <math>\scriptstyle c(u, v)</math>. It represents the maximum amount of flow that can pass through an edge.
: A '''flow''' is a mapping <math>\scriptstyle f : E \to \mathbb{R}^+</math>, denoted by <math>\scriptstyle f_{uv}</math> or <math>\scriptstyle f(u, v)</math>, subject to the following two constraints:
:: 1. <math>\scriptstyle f_{uv} \leq c_{uv}</math>, for each <math>\scriptstyle (u, v) \in E</math> (capacity constraint: the flow of an edge cannot exceed its capacity)
:: 2. <math>\scriptstyle \sum_{u:(u, v) \in E} f_{uv} = \sum_{u:(v, u) \in E} f_{vu}</math>, for each <math>\scriptstyle v \in V \setminus \{s, t\}</math> (conservation of flows: the sum of the flows entering a node must equal the sum of the flows exiting a node, except for the source and the sink nodes)
: The '''value of flow''' is defined by <math>\scriptstyle |f| = \sum_{v:(s,v) \in E} f_{sv}</math>, where <math>\scriptstyle s</math> is the source of <math>\scriptstyle N</math>. It represents the amount of flow passing from the source to the sink.
The '''maximum flow problem''' is to maximize <math>\scriptstyle |f|</math>, that is, to route as much flow as possible from <math>\scriptstyle s</math> to <math>\scriptstyle t</math>.
==Solutions==
We can define the '''Residual Graph''', which provides a systematic way to search for forward-backward operations in order to find the maximum flow.
Given a flow network {{mvar|G}}, and a flow {{mvar|f}} on {{mvar|G}}, we define the residual graph <math>G_{f}</math> of {{mvar|G}} with respect to {{mvar|f}} as follows.
# The node set of <math>G_{f}</math> is the same as that of {{mvar|G}}.
# Each edge <math>e = (u, v)</math> of <math>G_{f}</math> is with a capacity of <math>c_{e} - f(e)</math>.
# Each edge <math>e' = (v, u)</math> of <math>G_{f}</math> is with a capacity of <math>f(e)</math>.
{{clear}}
The following table lists algorithms for solving the maximum flow problem.
{| class="wikitable"
! Method
! Complexity
! Description
|-
| [[Linear programming]]
|
| Constraints given by the definition of a [[flow network|legal flow]]. See the [[Max-flow min-cut theorem#Linear program formulation|linear program]] here.
|-
| [[Ford–Fulkerson algorithm]]
| {{math|''O''(''E'' max<nowiki>|</nowiki> ''f'' <nowiki>|</nowiki>)}}
| As long as there is an open path through the residual graph, send the minimum of the residual capacities on the path.
The algorithm is only guaranteed to terminate if all weights are [[rational numbers|rational]]. Otherwise it is possible that the algorithm will not converge to the maximum value. However, if the algorithm terminates, it is guaranteed to find the maximum value.
|-
| [[Edmonds–Karp algorithm]]
| {{math|''O''(''VE''<sup>2</sup>)}}
| A specialization of Ford–Fulkerson, finding augmenting paths with [[breadth-first search]].
|-
| [[Dinic's algorithm|Dinic's blocking flow algorithm]]
| {{math|''O''(''V''<sup>2</sup>''E'')}}
| In each phase the algorithms builds a layered graph with [[breadth-first search]] on the [[residual graph]]. The maximum flow in a layered graph can be calculated in {{math|''O''(''VE'')}} time, and the maximum number of the phases is {{math|''n''-1}}. In networks with unit capacities, Dinic's algorithm terminates in <math>O(E\sqrt{V})</math> time.
|-
|MPM (Malhotra, Pramodh-Kumar and Maheshwari) algorithm<ref>{{Cite journal | last1 = Malhotra | first1 =V.M.| last2 = Kumar | first2 = M.Pramodh| last3 = Maheshwari | first3 = S.N.| doi = 10.1016/0020-0190(78)90016-9| title = An <math>O(|V|^3)</math> algorithm for finding maximum flows in networks| journal = Information Processing Letters| volume = 7| issue = 6| pages = 277–278 | year = 1978}}</ref>
| {{math|''O''(''V''<sup>3</sup>)}}
| Refer to the [http://dx.doi.org/10.1016/0020-0190(78)90016-9 Original Paper].
|-
| [[Dinic's algorithm]]
| {{math|''O''(''VE'' log(''V''))}}
| The [[dynamic trees]] data structure speeds up the maximum flow computation in the layered graph to {{math|''O''(''E'' log(''V''))}}.
|-
| [[Relabel-to-front algorithm|General push-relabel maximum flow algorithm]]
| {{math|''O''(''V''<sup>2</sup>''E'')}}
| The push relabel algorithm maintains a preflow, i.e. a flow function with the possibility of excess in the vertices. The algorithm runs while there is a vertex with positive excess, i.e. an active vertex in the graph. The push operation increases the flow on a residual edge, and a height function on the vertices controls which residual edges can be pushed. The height function is changed with a relabel operation. The proper definitions of these operations guarantee that the resulting flow function is a maximum flow.
|-
| [[Relabel-to-front algorithm|Push-relabel algorithm with ''FIFO'' vertex selection rule]]
| {{math|''O''(''V''<sup>3</sup>)}}
| Push-relabel algorithm variant which always selects the most recently active vertex, and performs push operations until the excess is positive or there are admissible residual edges from this vertex.
|-
| [[Relabel-to-front algorithm|Push-relabel algorithm with dynamic trees]]
| <math>O\left(VE \log \frac {V^2} E \right)</math>
| The algorithm builds limited size trees on the residual graph regarding to height function. These trees provide multilevel push operations.
|-
|KRT (King, Rao, Tarjan)'s algorithm<ref>{{Cite journal | last1 = King | first1 = V.| last2 = Rao | first2 = S.| last3 = Tarjan | first3 = R.| doi = 10.1006/jagm.1994.1044| title = A Faster Deterministic Maximum Flow Algorithm| journal = Journal of Algorithms| volume = 17| issue = 3| pages = 447–474| year = 1994}}</ref>
| <math>O(EV \log_{\frac E {V \log V}}V)</math>
|
|-
|Binary blocking flow algorithm<ref>{{Cite journal | last1 = Goldberg | first1 = A. V. | authorlink1 = Andrew V. Goldberg| last2 = Rao | first2 = S. | doi = 10.1145/290179.290181 | title = Beyond the flow decomposition barrier | journal = [[Journal of the ACM]]| volume = 45 | issue = 5 | pages = 783 | year = 1998 | pmid = | pmc = }}</ref>
| <math>O\left(E \cdot \min(V^{\frac 2 3},\sqrt{E}) \cdot \log \frac {V^2} E \log{U}\right)</math>
|The value ''U'' corresponds to the maximum capacity of the network.
|-
|Jim Orlin's + KRT (King, Rao, Tarjan)'s algorithm<ref>{{Cite journal | last1 = Orlin | first1 = James B.| doi = 10.1145/2488608.2488705| title = Max flows in O(nm) time, or better| journal = STOC '13 Proceedings of the forty-fifth annual ACM symposium on Theory of computing| pages = 765–774| year = 2013}}</ref>
| <math>O(VE)</math>
|[http://jorlin.scripts.mit.edu/Max_flows_in_O(nm)_time.html Orlin's algorithm] solves max-flow in {{math|''O''(''VE'')}} time for <math>E \leq O(V^{{16 \over 15} - \epsilon})</math> while KRT solves it in {{math|''O''(''VE'')}} for <math>E > V^{1+\epsilon}</math>.
|}
For a more extensive list, see<ref>{{Cite journal | last1 = Goldberg | first1 = A. V. | authorlink1 = Andrew V. Goldberg| last2 = Tarjan | first2 = R. E. | doi = 10.1145/48014.61051 | title = A new approach to the maximum-flow problem | journal = [[Journal of the ACM]]| volume = 35 | issue = 4 | pages = 921 | year = 1988 | pmid = | pmc = }}</ref>
==Integral flow theorem==
The integral flow theorem states that
: '''If each edge in a flow network has integral capacity, then there exists an integral maximal flow.'''
==Application==
===Multi-source multi-sink maximum flow problem===
[[File:Multi-source multi-sink flow problem.svg|thumb|right|Fig. 4.1.1. Transformation of a multi-source multi-sink maximum flow problem into a single-source single-sink maximum flow problem]]
Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {<nowiki />{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).
===Minimum path cover in directed acyclic graph===
Given a [[directed acyclic graph]] {{var|G}} = ({{var|V}}, {{var|E}}), we are to find the minimum number of [[Path (graph theory)|vertex-disjoint paths]] to cover each vertex in {{var|V}}. We can construct a bipartite graph {{var|G'}} = ({{var|V}}<sub>out</sub>∪{{var|V}}<sub>in</sub>, {{var|E'}} ) from {{var|G}}, where
# {{var|V}}<sub>out</sub> = {{{var|v}}∈{{var|V}}: {{var|v}} has positive out-degree}.
# {{var|V}}<sub>in</sub> = {{{var|v}}∈{{var|V}}: {{var|v}} has positive in-degree}.
# {{var|E'}} = {({{var|u}},{{var|v}})∈{{var|V}}<sub>out</sub>×{{var|V}}<sub>in</sub>: ({{var|u}},{{var|v}})∈{{var|E}}}.
Then it can be shown, via [[König's theorem (graph theory)|König's theorem]], that {{var|G'}} has a matching of size {{var|m}} if and only if there exists {{var|n}}-{{var|m}} vertex-disjoint paths that cover each vertex in {{var|G}}, where {{var|n}} is the number of vertices in {{var|G}}. Therefore, the problem can be solved by finding the maximum cardinality matching in {{var|G'}} instead.
===Maximum cardinality bipartite matching===
[[File:Maximum bipartite matching to max flow.svg|thumb|right|Fig. 4.3.1. Transformation of a maximum bipartite matching problem into a maximum flow problem]]
Given a [[bipartite graph]] {{var|G}} = ({{var|X}}∪{{var|Y}}, {{var|E}}), we are to find a [[maximum cardinality matching]] in {{var|G}}, that is a matching that contains the largest possible number of edges. This problem can be transformed into a maximum flow problem by constructing a network {{var|N}} = ({{var|X}}∪{{var|Y}}∪{{{var|s}},{{var|t}}), {{var|E'}} }, where
# {{var|E}}' contains the edges in {{var|G}} directed from {{var|X}} to {{var|Y}}.
# ({{var|s}},{{var|x}})∈{{var|E'}} for each {{var|x}}∈{{var|X}} and ({{var|y}},{{var|t}})∈{{var|E'}} for each {{var|y}}∈{{var|Y}}.
# {{var|c}}({{var|e}}) = 1 for each {{var|e}}∈{{var|E}}' (See Fig. 4.3.1).
Then the value of the maximum flow in {{var|N}} is equal to the size of the maximum matching in {{var|G}}.
===Maximum flow problem with vertex capacities===
[[File:Node splitting.svg|thumb|right|Fig. 4.4.1. Transformation of a maximum flow problem with vertex capacities constraint into the original maximum flow problem by node splitting]]
Given a network <math>N = (V, E)</math>, in which there is capacity at each node in addition to edge capacity, that is, a mapping <math>c: V\mapsto \mathbb{R}^{+}</math>, denoted by <math>c(v)</math>, such that the flow {{mvar|f}} has to satisfy not only the capacity constraint and the conservation of flows, but also the vertex capacity constraint
<center><math> \sum_{i\in V} f_{iv} \le c(v) \qquad \forall v \in V \backslash \{s,t\}</math>.</center>
In other words, the amount of flow passing through a vertex cannot exceed its capacity. To find the maximum flow across {{mvar|N}}, we can transform the problem into the maximum flow problem in the original sense by expanding {{mvar|N}}. First, each <math>v\in V</math> is replaced by <math>v_{\text{in}}</math> and <math>v_{\text{out}}</math>, where <math>v_{\text{in}}</math> is connected by edges going into {{mvar|v}} and <math>v_{\text{out}}</math> is connected to edges coming out from {{mvar|v}}, then assign capacity <math>c(v)</math> to the edge connecting <math>v_{\text{in}}</math> and <math>v_{\text{out}}</math> (see Fig. 4.4.1). In this expanded network, the vertex capacity constraint is removed and therefore the problem can be treated as the original maximum flow problem.
===Maximum edge-disjoint path===
Given a directed graph {{var|G}} = ({{var|V}}, {{var|E}}) and two vertices {{var|s}} and {{var|t}}, we are to find the maximum number of edge-disjoint paths from
{{var|s}} to {{var|t}}. This problem can be transformed to a maximum flow problem by constructing a network {{var|N}} = ({{var|V}}, {{var|E}}) from {{var|G}} with {{var|s}} and {{var|t}} being the source and the sink of {{var|N}} respectively and assign each edge with unit capacity.
===Maximum independent (vertex-disjoint) path===
Given a directed graph {{var|G}} = ({{var|V}}, {{var|E}}) and two vertices {{var|s}} and {{var|t}}, we are to find the maximum number of independent paths from {{var|s}} to {{var|t}}. Two paths are said to be independent if they do not have a vertex in common apart from {{var|s}} and {{var|t}}. We can construct a network {{var|N}} = ({{var|V}}, {{var|E}}) from {{var|G}} with vertex capacities, where
# {{var|s}} and {{var|t}} are the source and the sink of {{var|N}} respectively.
# {{var|c}}({{var|v}}) = 1 for each {{var|v}}∈{{var|V}}.
# {{var|c}}({{var|e}}) = 1 for each {{var|e}}∈{{var|E}}.
Then the value of the maximum flow is equal to the maximum number of independent paths from {{var|s}} to {{var|t}}.
==Real world applications==
===Baseball elimination===
[[File:Baseball Elimination Problem.png|thumb|Construction of network flow for baseball elimination problem]]
In the [[baseball]] elimination problem there are ''n'' teams competing in a league. At a specific stage of the league season, ''w''<sub>i</sub> is the number of wins and ''r''<sub>i</sub> is the number of games left to play for team ''i'' and ''r''<sub>ij</sub> is the number of games left against team ''j''. A team is eliminated if it has no chance to finish the season in the first place. The task of the baseball elimination problem is to determine which teams are eliminated at each point during the season. Schwartz<ref>{{Cite journal | last1 = Schwartz | first1 = B. L. | title = Possible Winners in Partially Completed Tournaments | doi = 10.1137/1008062 | journal = [[SIAM Review]]| jstor = 2028206| volume = 8 | issue = 3 | pages = 302 | year = 1966 | pmid = | pmc = }}</ref> proposed a method which reduces this problem to maximum network flow. In this method a network is created to determine whether team ''k'' is eliminated.
Let ''G'' = (''V'', ''E'') be a network with ''s'',''t'' ∈ ''V'' being the source and the sink respectively. One adds a game node {''i'',''j''} with ''i'' < ''j'' to ''V'', and connects each of them from ''s'' by an edge with capacity ''r''<sub>ij</sub> – which represents the number of plays between these two teams. We also add a team node for each team and connect each game node {''i'',''j''} with to team nodes ''i'' and ''j'' to ensure one of them wins. One does not need to restrict the flow value on these edges. Finally, edges are made from team node ''i'' to the sink node ''t'' and the capacity of ''w''<sub>k</sub>+''r''<sub>k</sub>–''w''<sub>i</sub> is set to prevent team ''i'' from winning more than ''w''<sub>k</sub>+''r''<sub>k</sub>.
Let ''S'' be the set of all teams participating in the league and let <math>\scriptstyle r(S - \{k\}) = \sum_{i,j \in \{S-\{k\}\}, i < j} r_{ij}</math>. In this method it is claimed team ''k'' is not eliminated if and only if a flow value of size ''r''(''S'' − {''k''}) exists in network ''G''. In the mentioned article it is proved that this flow value is the maximum flow value from ''s'' to ''t''.
===Airline scheduling===
In the airline industry a major problem is the scheduling of the flight crews. The airline scheduling problem can be considered as an application of extended maximum network flow. The input of this problem is a set of flights ''F'' which contains the information about where and when each flight departs and arrives. In one version of airline scheduling the goal is to produce a feasible schedule with at most ''k'' crews.
In order to solve this problem one uses a variation of the [[circulation problem]] called bounded circulation which is the generalization of [[flow network|network flow]] problems, with the added constraint of a lower bound on edge flows.
Let ''G'' = (''V'', ''E'') be a network with ''s'',''t'' ∈ ''V'' as the source and the sink nodes. For the source and destination of every flight ''i'', one adds two nodes to ''V'', node ''s''<sub>i</sub> as the source and node ''d''<sub>i</sub> as the destination node of flight ''i''. One also adds the following edges to ''E'':
# An edge with capacity [0, 1] between ''s'' and each ''s''<sub>i</sub>.
# An edge with capacity [0, 1] between each ''d''<sub>i</sub> and ''t''.
# An edge with capacity [1, 1] between each pair of ''s''<sub>i</sub> and ''d''<sub>i</sub>.
# An edge with capacity [0, 1] between each ''d''<sub>i</sub> and ''s''<sub>j</sub>, if source ''s''<sub>j</sub> is reachable with a reasonable amount of time and cost from the destination of flight ''i''.
# An edge with capacity [0, ''<big>∞</big>''] between ''s'' and ''t''.
In the mentioned method, it is claimed and proved that finding a flow value of ''k'' in ''G'' between ''s'' and ''t'' is equal to finding a feasible schedule for flight set ''F'' with at most ''k'' crews.<ref name="ITA">{{cite book | author = [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]] | title=[[Introduction to Algorithms]], Second Edition | chapter = 26. Maximum Flow | year = 2001 | publisher = MIT Press and McGraw-Hill | isbn = 0-262-03293-7 | pages=643–668}}</ref>
Another version of airline scheduling is finding the minimum needed crews to perform all the flights. In order to find an answer to this problem, a bipartite graph ''G’'' = (''A'' ∪ ''B'', ''E'') is created where each flight has a copy in set ''A'' and set ''B''. If the same plane can perform flight ''j'' after flight ''i'', ''i''∈''A'' is connected to ''j''∈''B''. A matching in ''G’'' induces a schedule for ''F'' and obviously maximum bipartite matching in this graph produces an airline schedule with minimum number of crews.<ref name="ITA"/> As it is mentioned in the Application part of this article, the maximum cardinality bipartite matching is an application of maximum flow problem.
===Circulation–demand problem===
There are some factories that produce goods and some villages where the goods have to be delivered. They are connected by a networks of roads with each road having a capacity {{mvar|c}} for maximum goods that can flow through it. The problem is to find if there is a circulation that satisfies the demand.
This problem can be transformed into a maximum-flow problem.
# Add a source node {{mvar|s}} and add edges from it to every factory node {{mvar|f<sub>i</sub>}} with capacity {{mvar|p<sub>i</sub>}} where {{mvar|p<sub>i</sub>}} is the production rate of factory {{mvar|f<sub>i</sub>}}.
# Add a sink node {{mvar|t}} and add edges from all villages {{mvar|v<sub>i</sub>}} to {{mvar|t}} with capacity {{mvar|d<sub>i</sub>}} where {{mvar|d<sub>i</sub>}} is the demand rate of village {{mvar|v<sub>i</sub>}}.
Let ''G'' = (''V'', ''E'') be this new network. There exists a circulation that satisfies the demand if and only if :
: {{math|Maximum flow value(''G'')}} <math> = \sum_{i \in v} d_i </math>.
If there exists a circulation, looking at the max-flow solution would give the answer as to how much goods have to be sent on a particular road for satisfying the demands.
==See also==
* [[Closure problem]]
* [[Minimum-cost flow problem]]
==References==
{{reflist}}
==Further reading==
* {{cite journal
| author = [[Joseph Cheriyan]] and [[Kurt Mehlhorn]]
| title = An analysis of the highest-level selection rule in the preflow-push max-flow algorithm
| journal = Information Processing Letters
| volume = 69
| year = 1999
| pages = 239–242
| doi = 10.1016/S0020-0190(99)00019-8
| issue = 5
}}
* {{cite journal
| author = [[Daniel D. Sleator]] and [[Robert E. Tarjan]]
| title = A data structure for dynamic trees
| journal = Journal of Computer and System Sciences
| volume = 26
| year = 1983
| issn = 0022-0000
| pages = 362–391
| doi = 10.1016/0022-0000(83)90006-5
| url = http://www.cs.cmu.edu/~sleator/papers/dynamic-trees.pdf
| issue = 3
}}
* {{cite book | author = Eugene Lawler | authorlink = Eugene Lawler | title = Combinatorial Optimization: Networks and Matroids | chapter = 4. Network Flows | year = 2001 | publisher = Dover | isbn = 0-486-41453-1 | pages = 109–177}}
{{DEFAULTSORT:Maximum Flow Problem}}
[[Category:Network flow]]
[[Category:Mathematical problems]]' |
Unified diff of changes made by edit (edit_diff ) | '@@ -101,5 +101,5 @@
===Multi-source multi-sink maximum flow problem===
[[File:Multi-source multi-sink flow problem.svg|thumb|right|Fig. 4.1.1. Transformation of a multi-source multi-sink maximum flow problem into a single-source single-sink maximum flow problem]]
-Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).
+Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {<nowiki />{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).
===Minimum path cover in directed acyclic graph===
' |
New page size (new_size ) | 24975 |
Old page size (old_size ) | 24965 |
Size change in edit (edit_delta ) | 10 |
Lines added in edit (added_lines ) | [
0 => 'Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {<nowiki />{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).'
] |
Lines removed in edit (removed_lines ) | [
0 => 'Given a network {{var|N}} = ({{var|V}},{{var|E}}) with a set of sources {{var|S}} = {{{var|s}}<sub>1</sub>, ..., {{var|s}}<sub>{{var|n}}</sub>} and a set of sinks {{var|T}} = {{{var|t}}<sub>1</sub>, ..., {{var|t}}<sub>{{var|m}}</sub>} instead of only one source and one sink, we are to find the maximum flow across {{var|N}}. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a ''consolidated source'' connecting to each vertex in {{var|S}} and a ''consolidated sink ''connected by each vertex in {{var|T}} (also known as ''supersource'' and ''supersink'') with infinite capacity on each edge (See Fig. 4.1.1.).'
] |
Whether or not the change was made through a Tor exit node (tor_exit_node ) | 0 |
Unix timestamp of change (timestamp ) | 1459406334 |