Max-flow min-cut theorem

Last updated

In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the source to the sink is equal to the total weight of the edges in a minimum cut, i.e., the smallest total weight of the edges which if removed would disconnect the source from the sink.

Contents

This is a special case of the duality theorem for linear programs and can be used to derive Menger's theorem and the Kőnig–Egerváry theorem. [1]

Definitions and statement

The theorem equates two quantities: the maximum flow through a network, and the minimum capacity of a cut of the network. To state the theorem, each of these notions must first be defined.

Network

A network consists of

Flows

A flow through a network is a mapping denoted by or , subject to the following two constraints:

  1. Capacity Constraint: For every edge ,
  2. Conservation of Flows: For each vertex apart from and (i.e. the source and sink, respectively), the following equality holds:

A flow can be visualized as a physical flow of a fluid through the network, following the direction of each edge. The capacity constraint then says that the volume flowing through each edge per unit time is less than or equal to the maximum capacity of the edge, and the conservation constraint says that the amount that flows into each vertex equals the amount flowing out of each vertex, apart from the source and sink vertices.

The value of a flow is defined by

where as above is the source and is the sink of the network. In the fluid analogy, it represents the amount of fluid entering the network at the source. Because of the conservation axiom for flows, this is the same as the amount of flow leaving the network at the sink.

The maximum flow problem asks for the largest flow on a given network.

Maximum Flow Problem. Maximize , that is, to route as much flow as possible from to .

Cuts

The other half of the max-flow min-cut theorem refers to a different aspect of a network: the collection of cuts. An s-t cutC = (S, T) is a partition of V such that sS and tT. That is, an s-t cut is a division of the vertices of the network into two parts, with the source in one part and the sink in the other. The cut-set of a cut C is the set of edges that connect the source part of the cut to the sink part:

Thus, if all the edges in the cut-set of C are removed, then no positive flow is possible, because there is no path in the resulting graph from the source to the sink.

The capacity of an s-t cut is the sum of the capacities of the edges in its cut-set,

where if and , otherwise.

There are typically many cuts in a graph, but cuts with smaller weights are often more difficult to find.

Minimum s-t Cut Problem. Minimize c(S, T), that is, determine S and T such that the capacity of the s-t cut is minimal.

Main theorem

In the above situation, one can prove that the value of any flow through a network is less than or equal to the capacity of any s-t cut, and that furthermore a flow with maximal value and a cut with minimal capacity exist. The main theorem links the maximum flow value with the minimum cut capacity of the network.

Max-flow min-cut theorem. The maximum value of an s-t flow is equal to the minimum capacity over all s-t cuts.

Example

A maximal flow in a network. Each edge is labeled with f/c, where f is the flow over the edge and c is the edge's capacity. The flow value is 5. There are several minimal s-t cuts with capacity 5; one is S={s,p} and T={o, q, r, t}. Max flow.svg
A maximal flow in a network. Each edge is labeled with f/c, where f is the flow over the edge and c is the edge's capacity. The flow value is 5. There are several minimal s-t cuts with capacity 5; one is S={s,p} and T={o, q, r, t}.

The figure on the right shows a flow in a network. The numerical annotation on each arrow, in the form f/c, indicates the flow (f) and the capacity (c) of the arrow. The flows emanating from the source total five (2+3=5), as do the flows into the sink (2+3=5), establishing that the flow's value is 5.

One s-t cut with value 5 is given by S={s,p} and T={o, q, r, t}. The capacities of the edges that cross this cut are 3 and 2, giving a cut capacity of 3+2=5. (The arrow from o to p is not considered, as it points from T back to S.)

The value of the flow is equal to the capacity of the cut, showing that the flow is a maximal flow and the cut is a minimal cut.

Note that the flow through each of the two arrows that connect S to T is at full capacity; this is always the case: a minimal cut represents a 'bottleneck' of the system.

Linear program formulation

The max-flow problem and min-cut problem can be formulated as two primal-dual linear programs. [2]

Max-flow (Primal)

Min-cut (Dual)

variables

[two variables per edge, one in each direction]

[a variable per edge]

[a variable per non-terminal node]

objective

maximize

[max total flow from source]

minimize

[min total capacity of edges in cut]

constraints

subject to

[a constraint per edge and a constraint per non-terminal node]

subject to

[a constraint per edge]

sign constraints

The max-flow LP is straightforward. The dual LP is obtained using the algorithm described in dual linear program: the variables and sign constraints of the dual correspond to the constraints of the primal, and the constraints of the dual correspond to the variables and sign constraints of the primal. The resulting LP requires some explanation. The interpretation of the variables in the min-cut LP is:

The minimization objective sums the capacity over all the edges that are contained in the cut.

The constraints guarantee that the variables indeed represent a legal cut: [3]

Note that, since this is a minimization problem, we do not have to guarantee that an edge is not in the cut - we only have to guarantee that each edge that should be in the cut, is summed in the objective function.

The equality in the max-flow min-cut theorem follows from the strong duality theorem in linear programming, which states that if the primal program has an optimal solution, x*, then the dual program also has an optimal solution, y*, such that the optimal values formed by the two solutions are equal.

Application

Cederbaum's maximum flow theorem

The maximum flow problem can be formulated as the maximization of the electrical current through a network composed of nonlinear resistive elements. [4] In this formulation, the limit of the current Iin between the input terminals of the electrical network as the input voltage Vin approaches , is equal to the weight of the minimum-weight cut set.

Generalized max-flow min-cut theorem

In addition to edge capacity, consider there is capacity at each vertex, that is, a mapping denoted by c(v), such that the flow f has to satisfy not only the capacity constraint and the conservation of flows, but also the vertex capacity constraint

In other words, the amount of flow passing through a vertex cannot exceed its capacity. Define an s-t cut to be the set of vertices and edges such that for any path from s to t, the path contains a member of the cut. In this case, the capacity of the cut is the sum the capacity of each edge and vertex in it.

In this new definition, the generalized max-flow min-cut theorem states that the maximum value of an s-t flow is equal to the minimum capacity of an s-t cut in the new sense.

Menger's theorem

In the undirected edge-disjoint paths problem, we are given an undirected graph G = (V, E) and two vertices s and t, and we have to find the maximum number of edge-disjoint s-t paths in G.

Menger's theorem states that the maximum number of edge-disjoint s-t paths in an undirected graph is equal to the minimum number of edges in an s-t cut-set.

Project selection problem

A network formulation of the project selection problem with the optimal solution Max-flow min-cut project-selection.svg
A network formulation of the project selection problem with the optimal solution

In the project selection problem, there are n projects and m machines. Each project pi yields revenue r(pi) and each machine qj costs c(qj) to purchase. Each project requires a number of machines and each machine can be shared by several projects. The problem is to determine which projects and machines should be selected and purchased respectively, so that the profit is maximized.

Let P be the set of projects not selected and Q be the set of machines purchased, then the problem can be formulated as,

Since the first term does not depend on the choice of P and Q, this maximization problem can be formulated as a minimization problem instead, that is,

The above minimization problem can then be formulated as a minimum-cut problem by constructing a network, where the source is connected to the projects with capacity r(pi), and the sink is connected by the machines with capacity c(qj). An edge (pi, qj) with infinite capacity is added if project pi requires machine qj. The s-t cut-set represents the projects and machines in P and Q respectively. By the max-flow min-cut theorem, one can solve the problem as a maximum flow problem.

The figure on the right gives a network formulation of the following project selection problem:

Project r(pi)

Machine c(qj)

1100200

Project 1 requires machines 1 and 2.

2200100

Project 2 requires machine 2.

315050

Project 3 requires machine 3.

The minimum capacity of an s-t cut is 250 and the sum of the revenue of each project is 450; therefore the maximum profit g is 450 − 250 = 200, by selecting projects p2 and p3.

The idea here is to 'flow' each project's profits through the 'pipes' of its machines. If we cannot fill the pipe from a machine, the machine's return is less than its cost, and the min cut algorithm will find it cheaper to cut the project's profit edge instead of the machine's cost edge.

Image segmentation problem

Each black node denotes a pixel. Image segmentation.jpg
Each black node denotes a pixel.

In the image segmentation problem, there are n pixels. Each pixel i can be assigned a foreground value fi or a background value bi. There is a penalty of pij if pixels i, j are adjacent and have different assignments. The problem is to assign pixels to foreground or background such that the sum of their values minus the penalties is maximum.

Let P be the set of pixels assigned to foreground and Q be the set of points assigned to background, then the problem can be formulated as,

This maximization problem can be formulated as a minimization problem instead, that is,

The above minimization problem can be formulated as a minimum-cut problem by constructing a network where the source (orange node) is connected to all the pixels with capacity fi, and the sink (purple node) is connected by all the pixels with capacity bi. Two edges (i, j) and (j, i) with pij capacity are added between two adjacent pixels. The s-t cut-set then represents the pixels assigned to the foreground in P and pixels assigned to background in Q.

History

An account of the discovery of the theorem was given by Ford and Fulkerson in 1962: [5]

"Determining a maximal steady state flow from one point to another in a network subject to capacity limitations on arcs ... was posed to the authors in the spring of 1955 by T.E. Harris, who, in conjunction with General F. S. Ross (Ret.) had formulated a simplified model of railway traffic flow, and pinpointed this particular problem as the central one suggested by the model. It was not long after this until the main result, Theorem 5.1, which we call the max-flow min-cut theorem, was conjectured and established. [6] A number of proofs have since appeared." [7] [8] [9]

Proof

Let G = (V, E) be a network (directed graph) with s and t being the source and the sink of G respectively.

Consider the flow f computed for G by Ford–Fulkerson algorithm. In the residual graph (Gf) obtained for G (after the final flow assignment by Ford–Fulkerson algorithm), define two subsets of vertices as follows:

  1. A: the set of vertices reachable from s in Gf
  2. Ac: the set of remaining vertices i.e. V − A

Claim.value(f) = c(A, Ac), where the capacity of an s-t cut is defined by

.

Now, we know, for any subset of vertices, A. Therefore, for value(f) = c(A, Ac) we need:

To prove the above claim we consider two cases:

Both of the above statements prove that the capacity of cut obtained in the above described manner is equal to the flow obtained in the network. Also, the flow was obtained by Ford-Fulkerson algorithm, so it is the max-flow of the network as well.

Also, since any flow in the network is always less than or equal to capacity of every cut possible in a network, the above described cut is also the min-cut which obtains the max-flow.

A corollary from this proof is that the maximum flow through any set of edges in a cut of a graph is equal to the minimum capacity of all previous cuts.

See also

Related Research Articles

The Ford–Fulkerson method or Ford–Fulkerson algorithm (FFA) is a greedy algorithm that computes the maximum flow in a flow network. It is sometimes called a "method" instead of an "algorithm" as the approach to finding augmenting paths in a residual graph is not fully specified or it is specified in several implementations with different running times. It was published in 1956 by L. R. Ford Jr. and D. R. Fulkerson. The name "Ford–Fulkerson" is often also used for the Edmonds–Karp algorithm, which is a fully defined implementation of the Ford–Fulkerson method.

In computer science, the Edmonds–Karp algorithm is an implementation of the Ford–Fulkerson method for computing the maximum flow in a flow network in time. The algorithm was first published by Yefim Dinitz in 1970, and independently published by Jack Edmonds and Richard Karp in 1972. Dinitz's algorithm includes additional techniques that reduce the running time to .

<span class="mw-page-title-main">Maximum flow problem</span> Computational problem in graph theory

In optimization theory, maximum flow problems involve finding a feasible flow through a flow network that obtains the maximum possible flow rate.

In mathematics, a unimodular matrixM is a square integer matrix having determinant +1 or −1. Equivalently, it is an integer matrix that is invertible over the integers: there is an integer matrix N that is its inverse. Thus every equation Mx = b, where M and b both have integer components and M is unimodular, has an integer solution. The n × n unimodular matrices form a group called the n × n general linear group over , which is denoted .

<span class="mw-page-title-main">Flow network</span> Directed graph where edges have a capacity

In graph theory, a flow 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.

In graph theory, a cut is a partition of the vertices of a graph into two disjoint subsets. Any cut determines a cut-set, the set of edges that have one endpoint in each subset of the partition. These edges are said to cross the cut. In a connected graph, each cut-set determines a unique cut, and in some cases cuts are identified with their cut-sets rather than with their vertex partitions.

In mathematical optimization theory, duality or the duality principle is the principle that optimization problems may be viewed from either of two perspectives, the primal problem or the dual problem. If the primal is a minimization problem then the dual is a maximization problem. Any feasible solution to the primal (minimization) problem is at least as large as any feasible solution to the dual (maximization) problem. Therefore, the solution to the primal is an upper bound to the solution of the dual, and the solution of the dual is a lower bound to the solution of the primal. This fact is called weak duality.

In mathematical optimization, the push–relabel algorithm is an algorithm for computing maximum flows in a flow network. The name "push–relabel" comes from the two basic operations used in the algorithm. Throughout its execution, the algorithm maintains a "preflow" and gradually converts it into a maximum flow by moving flow locally between neighboring nodes using push operations under the guidance of an admissible network maintained by relabel operations. In comparison, the Ford–Fulkerson algorithm performs global augmentations that send flow following paths from the source all the way to the sink.

<span class="mw-page-title-main">Minimum cut</span> Partition of a graph by removing fewest possible edges

In graph theory, a minimum cut or min-cut of a graph is a cut that is minimal in some metric.

<span class="mw-page-title-main">Kőnig's theorem (graph theory)</span> Theorem showing that maximum matching and minimum vertex cover are equivalent for bipartite graphs

In the mathematical area of graph theory, Kőnig's theorem, proved by Dénes Kőnig (1931), describes an equivalence between the maximum matching problem and the minimum vertex cover problem in bipartite graphs. It was discovered independently, also in 1931, by Jenő Egerváry in the more general case of weighted graphs.

The minimum-cost flow problem (MCFP) is an optimization and decision problem to find the cheapest possible way of sending a certain amount of flow through a flow network. A typical application of this problem involves finding the best delivery route from a factory to a warehouse where the road network has some capacity and cost associated. The minimum cost flow problem is one of the most fundamental among all flow and circulation problems because most other such problems can be cast as a minimum cost flow problem and also that it can be solved efficiently using the network simplex algorithm.

The circulation problem and its variants are a generalisation of network flow problems, with the added constraint of a lower bound on edge flows, and with flow conservation also being required for the source and sink. In variants of the problem, there are multiple commodities flowing through the network, and a cost on the flow.

The multi-commodity flow problem is a network flow problem with multiple commodities between different source and sink nodes.

<span class="mw-page-title-main">Vehicle routing problem</span> Optimization problem

The vehicle routing problem (VRP) is a combinatorial optimization and integer programming problem which asks "What is the optimal set of routes for a fleet of vehicles to traverse in order to deliver to a given set of customers?" It generalises the travelling salesman problem (TSP). It first appeared in a paper by George Dantzig and John Ramser in 1959, in which the first algorithmic approach was written and was applied to petrol deliveries. Often, the context is that of delivering goods located at a central depot to customers who have placed orders for such goods. The objective of the VRP is to minimize the total route cost. In 1964, Clarke and Wright improved on Dantzig and Ramser's approach using an effective greedy algorithm called the savings algorithm.

The Price of Anarchy (PoA) is a concept in economics and game theory that measures how the efficiency of a system degrades due to selfish behavior of its agents. It is a general notion that can be extended to diverse systems and notions of efficiency. For example, consider the system of transportation of a city and many agents trying to go from some initial location to a destination. Let efficiency in this case mean the average time for an agent to reach the destination. In the 'centralized' solution, a central authority can tell each agent which path to take in order to minimize the average travel time. In the 'decentralized' version, each agent chooses its own path. The Price of Anarchy measures the ratio between average travel time in the two cases.

Dinic's algorithm or Dinitz's algorithm is a strongly polynomial algorithm for computing the maximum flow in a flow network, conceived in 1970 by Israeli computer scientist Yefim Dinitz. The algorithm runs in time and is similar to the Edmonds–Karp algorithm, which runs in time, in that it uses shortest augmenting paths. The introduction of the concepts of the level graph and blocking flow enable Dinic's algorithm to achieve its performance.

In combinatorial optimization, the Gomory–Hu tree of an undirected graph with capacities is a weighted tree that represents the minimum s-t cuts for all s-t pairs in the graph. The Gomory–Hu tree can be constructed in |V| − 1 maximum flow computations. It is named for Ralph E. Gomory and T. C. Hu.

Approximate max-flow min-cut theorems are mathematical propositions in network flow theory. They deal with the relationship between maximum flow rate ("max-flow") and minimum cut ("min-cut") in a multi-commodity flow problem. The theorems have enabled the development of approximation algorithms for use in graph partition and related problems.

Cederbaum's theorem defines hypothetical analog electrical networks which will automatically produce a solution to the minimum s–t cut problem. Alternatively, simulation of such a network will also produce a solution to the minimum s–t cut problem. This article gives basic definitions, a statement of the theorem and a proof of the theorem. The presentation in this article closely follows the presentation of the theorem in the original publication.

In dual decomposition a problem is broken into smaller subproblems and a solution to the relaxed problem is found. This method can be employed for MRF optimization. Dual decomposition is applied to markov logic programs as an inference technique.

References

  1. Dantzig, G.B.; Fulkerson, D.R. (9 September 1964). "On the max-flow min-cut theorem of networks" (PDF). RAND Corporation: 13. Archived from the original (PDF) on 5 May 2018.
  2. Trevisan, Luca. "Lecture 15 from CS261: Optimization" (PDF).
  3. Keller, Orgad. "LP min-cut max-flow presentation".
  4. Cederbaum, I. (August 1962). "On the optimal operation of communication nets". Journal of the Franklin Institute. 274: 130–141.
  5. L. R. Ford Jr. & D. R. Fulkerson (1962) Flows in Networks, page 1, Princeton University Press MR 0159700
  6. L. R. Ford Jr. and D. R. Fulkerson (1956) "Maximal flow through a network", Canadian Journal of Mathematics 8: 399-404
  7. P. Elias, A. Feinstein, and C. E. Shannon (1956) "A note on the maximum flow through a network", IRE. Transactions on Information Theory, 2(4): 117–119
  8. George Dantzig and D. R. Fulkerson (1956) "On the Max-Flow MinCut Theorem of Networks", in Linear Inequalities, Ann. Math. Studies, no. 38, Princeton, New Jersey
  9. L. R. Ford & D. R. Fulkerson (1957) "A simple algorithm for finding the maximum network flows and an application to the Hitchcock problem", Canadian Journal of Mathematics 9: 210–18