Departamento de Inform´atica

Jonatan Schroeder
Andr´e Pires Guedes
Elias P. Duarte Jr.

Computing the Minimum Cut and Maximum
Flow of Undirected Graphs

Relat´orio T´ecnico
RT-DINF 003/2004

Curitiba, PR
2004

br Abstract This work presents an algorithm for computing the maximum flow and minimum cut of undirected graphs. it cannot be used in the other way. which is described in section 2. otherwise it would not satisfy the skew simmetry. Keywords: Graph Theory. Maximum Flow.elias}@inf. of Informatics P.andre. This figure contains an example of undirected graph (A) and its corresponding directed graph (B). Minimum Cut 1 Introduction This work presents an algorithm for computing the maximum flow of undirected graphs. The new algorithm is equivalent to just applying Ford and Fulkerson algorithm to the directed graph obtained from original graph but with two directed arcs for each edge in the graph. One of the applications of the new algorithm is the computation routes between two hosts in a computer network. which is based on the computation of flow augmenting paths. and if it’s used in a way. Box 19081 CEP 81531-990 Curitiba PR Brazil {jonatan. one in each way.O. We present a proof of correctness and experimental results. 1 . based on the well-known algorithm presented by Ford and Fulkerson for directed graphs. the other arc cannot be used. since in undirected graphs an edge can be used in both ways.Computing the Minimum Cut and Maximum Flow of Undirected Graphs Jonatan Schroeder Andr´e Pires Guedes Elias P. The new algorithm is equivalent to just applying Ford and Fulkerson algorithm to the directed graph obtained from original graph but with two directed arcs for each edge in the graph. when an arc is used in a flow. The reason that the original algorithm by Ford and Fulkerson can be applied is that.ufpr. The algorithm is based in the same concept used by Ford and Fulkerson in [4]. This algorithm differs from those applied to directed graphs (or digraphs). one in each way. as shown in figure 1. Duarte Jr. as presented by [6]. These paths take an existing flow and construct a new flow that is greater than the original flow. Federal University of Paran´ a . considering the two arcs between a given pair of vertices.Dept.

f (u. the net flow from a node to itself is 0. Definition: Given a connected digraph G = (V. v) ∀u. says that the net flow from node u to node v is the negative of the net flow in the reverse direction. indicates that the resources used by a flow in an edge cannot be greater than the capacity of that edge. let c : E → R∗+ be the capacity of the edges in G. 2. v ∈ V. we make a brief description of that algorithm in section 2. called respectivelly source and sink. A flow in G is a function f : V × V → R such that: ∀u. f (u. known as the capacity constraint property. u) = 0. and finally section 6 contains our conclusions. u) X ∀u ∈ V − {s. E). v) = −f (v. equation 1. v) = 0 (1) (2) (3) v∈V In other words. E). we briefly describe a Java implementation of the algorithm. f (u. so that in each iteration the flow is greater. t}. known as the skew simmetry property. known as the flow conservation property. v) = f (v. In section 3 we present the new algorithm considering undirected edge-weighted graphs. 2 A Brief Description of Ford & Fulkerson Algorithm One of the most well known algorithms for computing the maximum flow of a digraph is the algorithm presented by Ford and Fulkerson [4].a b a b c c d d f f e e (A) (B) Figure 1: Example of an undirected graph and its corresponding directed graph. As the proposed algorithm is based on Ford and Fulkerson’s algorithm. In section 4 we present the proof of correctness of the proposed algorithms. Thus. says that the sum of all flows that enter in a node (negative flows) plus the sum of all flows that leave that node (positive flows) is 0. v ∈ V. v) ≤ c(u. since for all nodes. Equation 2. In section 5. t) v∈V v∈V 2 . u) implies that f (u. Equation 3. f (u. t ∈ V . This algorithm uses flow-augmenting paths to increase existing flows in the digraph. and a pair of nodes s. We give a brief description of the problem and the algorithm below. u) = −f (u.1 Algorithm Specification Definition: Given a connected digraph G = (V. The value of the flow f is defined as: X X |f | = f (s. Let f be a flow in G.

v) = c(u. Let f be a flow in G. The residual network of G induced by f is graph Gf = (V. where V is a set of nodes and E is a set of edges between these nodes (E ⊆ V × V ). or cf (u.. u] ← 0 while there exists a path p from s to t with no cycles in the residual network Gf do ∆ ← min{cf (u. v] + ∆ f [v. v) in p do f [u. Problem: Given a connected digraph G = (V. u] ← −f [u. v] ← f [u. there is no flow between any pair of nodes. It is used basically in the definition of the so called residual network. the minimum residual capacity of all pairs corresponds to the amount that can be increased in all node pairs so that the capacity is not overrun. E). E). The residual capacity of the pair (u. the flow amount in the edges is increased. Since the residual network contains edges only where the residual capacity is positive. given below. v) ∈ p} for each edge (u. Definition: Given a connected digraph G = (V. v).for each edge (u. v) > 0} The residual network is an auxiliar graph used by the algorithm descripted below. and considering a pair of nodes u. v) ∈ E do f [u. When no path is found. and the algorithm searches a new path in the residual network. E). i. Ef ). Let f be a flow in G. 3 . a randomly chosen path is obtained from the residual network. where: Ef = {(u. v) ∈ V × V : cf (u. v) − f (u. v) The residual capacity is used by the algorithm to determine how much flow can pass through a pair of nodes. v] ← 0 f [v. a capacity c : E → R∗+ and two nodes s and t. as proved in [2]. the algorithm presented in figure 2 creates an initial flow that is empty. is given by: cf (u. the path obtained will be composed by nodes that can increase the flow. so it is the maximum flow. Let f be this flow1 . find a maximum flow (a flow whose value is maximal) from source s to sink t in G. v) : (u.e. Definition: Given a connected digraph G = (V. than the flow cannot be increased. The value of a flow is the total flow that leaves s and. In this path. v). v ∈ V . v] Figure 2: The algorithm proposed by Ford and Fulkerson. is equal to the total flow that enters t. Initially. Finally. Next.

4 .a 12 8 s 4 6 5 9 b a e 7 9 f 12 3 t 9 b 4 15 11 8 d 6 13 2 11 6 g 5/12 8 s 2 11 5/9 5 3 9 f 5 7 t 8 s 8 12 g 12 c 8 s 5 6 4 2 5/11 8 8 s 6 10/11 13 2 c 5 2 g a 5 8 s t 10 8 d 5 b 13 2 1 10/10 4 6 4 15 e 7 5 7 3 5/9 f t 4 15 8 d 10 5 1 5 2 c g 3 5 f 4 5 5/7 5/12 10 (F) 4 5/6 8 7 e 4 t 5 g 5/9 b 5 d c 6 5/5 9 f 10 5/7 7 3 4 4 13 6 (E) 5/12 e 2 10/10 5/12 a g 5 b 4 5 d 6 5 6 t 5/15 13 c 8 s 9 f 5 7 3 4 5/9 b 5 2 7 e 7 5/5 8 (D) a 5/12 5 t 5 6 (C) a 10 d 5/7 9 f 4 13 3 4 5 b 2 11 5/10 e 6 4 d 6 g 7 5/15 13 c a 4 4 10 7 12 c e 6 b t (B) 7 5/5 8 d (A) a 9 f 15 10 7 12 c 3 4 13 2 4 6 5 8 s e 7 g 7 (G) (H) Figure 3: Example execution of the algorithm by Ford and Fulkerson.

) Example execution of the algorithm by Ford and Fulkerson. 5 .a 5/12 4/8 s 5 6 5/5 4 2 10/11 9/9 f 4 s t 8 9 4 10 d 1 5 5/12 g 7 4/8 s 4 11/11 5 1/3 9/9 f 7 9 4 11 1 5/12 6/8 s 4 11/11 2 1/13 g c a 5 3/3 9/9 f 7 12 t 15 8 d 10 5 1 5 2 c g 3 9 f 5 5/7 5/12 9 4 11 10/10 4 6 b 2 3 8 d 2 3 6 s t e 3 4 15 5/6 2 7 4 9/9 b 10 (L) 6 2/5 5 c e 3/7 t 5 (K) a 8 5 g 5/12 1 9 f d 5/7 5/6 2 15 12 3 10/10 4 6 b 4 8 d 4 1 4 s t e 1 6 15 1/13 c a 4 9/9 b 2 (J) 6 4/5 10 2 c e 1/7 t 5 (I) a 8 5 g 5/12 9 f d 5/7 5/6 3 15 13 2 1 10/10 4 6 b 4 e 7 5 7 15 13 c 3 4 9/9 b a e 7 g 7 (M) (N) Figure 3: (cont.

b). path (s. path (s. This figure contains a sequence of graphs that represent the obtained flow step by step. in this case. f. that had been used before. d). t) increases in 5 units. When only one number is found. c. In these graphs. as shown in (C). f ). g. (a. and the new residual network in (F). resulting in the flow shown in (I). t). In this case. c. a). Next the same procedure is repeated for path (s. b) is equal to 1 We use brackets when we treat an identifier – such as f – as a mutable field. 6 . Its corresponding residual network is shown in (J). in this order. g. becoming equal to 0. t) is considered. equal to -5 (by the skew simmetry). (d. Note that. In the residual network. The initial graph is presented in (A). 2. and its corresponding residual network is the graph shown in (B). shown in (F). a. c. b. which is equal to 5. than there is no flow passing through the arc. (b. The first augmenting path found is the path (s. is increased in 5 units. the flow used in pairs (s. and. the smallest capacity is the capacity of arc (a. the flow used in that arc and its capacity. c) is -1. d. the flow of the pair (b.2 Example Execution An example showing the execution of this algorithm is shown in figure 3. b. The result is shown in (E). The new flow is presented in (G). and we use parenthesis when we treat it as a function. f. t). the new flow formed by this augmenting path does not use pair (f. t). the residual capacity cf (c. d. t) is found. and the corresponding residual network is shown in (H). (f. the flow used between pair (d. the labels of the arcs contain. So. resulting in the flow in (K). Next. also shown in (B). Consequently. b) is +1. d). e. b). f. and in the new residual network in (D). g) and (g. b. the flow of the pair (c. a. by skew simmetry. f ). In this path.a 3/12 8/8 s 4 6 5 6/9 b 4 13 2/2 11/11 8/12 3/3 9/9 f t 1/9 b 15 3/8 10/10 5/7 5/6 8/12 c a 8/12 4/8 s 1/9 b 1/4 10/11 6/13 2 9/9 f 5/12 3/3 g t 6/8 s e 3/7 4 6 2/5 9/9 b 4 15 10/10 11/11 1/13 2 6/12 (C) 8 d 10/10 5/7 5/6 c t 15 7/7 g 3/3 9/9 f 3/8 d 6/6 c a 4/4 1/6 5 10/10 6/7 (B) e 7/7 t 3/8 7/12 (A) 9/9 f d 6/6 g 3/3 15 3/13 2 6/11 4/4 1/6 5 8/8 s e 7/7 4 d c a e 3/7 5/12 g (D) Figure 4: Feasible maximum flows for graph shown in figure 3. The same process runs with path (s. So.

Finally. This residual network contains no path between s and t. Using edges not used in the flow. In the algorithm. b. in many cases. t) is taken. we can obtain paths that increase the flow. or edges partially used. for the graph shown in figure 3(A). Consider as an example the graph shown in figure 5. only a portion of the graph is represented. path (s. Augmenting paths are paths from the source to the sink of the flow that increase the existing flow. since none of the edges in the path is already used in the flow. In order to simplify the example. since there are. This way. The dashed edges can contain more nodes not visible in the figure. so that the flow shown in (M) is the maximum flow. We can use the path formed by the path between s and a. the path between a and t. Some graphs can contain more than one flow that has a maximal value. e. 3 Finding the Maximum Flow of Undirected Graphs The main concept behind the algorithm is to obtain individual augmenting paths that can be used to increment an existing flow. we consider the path formed by the path between s and b. so that it can be re-used in another augmenting path. all flows shown in figure 4 are feasible maximum flows. we will obtain an augmenting path. the edge between b and a and the path between a and t.edge path a s t b Figure 5: Example of the use of algorithm. These results in the residual network shown in (L). and between nodes s and b. The flow is then formed uniquely by this path. But we can also decrease the used capacity for a used edge. a. and the residual capacity cf (b. more than one possible augmenting path for each step of the algorithm. whose residual network is shown in (N). On the other hand. The edge between b and a has been already used but in the other direction (from a to b). 13 − (+1) = 12. Next. since we can find a flow that combines both paths. There is a path between nodes s and a. this edge is marked as unused. the edge between a and b and the path between b and t. the path between s and b and the path 7 . Consider initially an empty flow between s and t. In the example. and between nodes b and t. among other possible for that graph. The maximum flow is not always unique. There is also a path between nodes a and t. resulting in the flow shown in (M). As an example. the resulting flow will be composed by the path between s and a. there is only an edge between nodes a and b. The result will depend on the augmenting paths used. c) is equal to 2 − (−1) = 3.

are the connection points.e. t}. The connection between a and b can be used again by another path. The residual network of G induced by f is digraph Gf = (V. but are adapted to undirected graphs. E). who finally sends it to t. Ef ). considering the nodes and edges not shown in figure. Suppose that initially s sends water to a. 3. find a maximum flow (a flow whose value is maximal) from source s to sink t in G. t) v∈V v∈V Definition: Given a connected undirected graph G = (V. either for directed or undirected graphs. v}) ∀u. v) = f (v. E). v) = c({u. f (u. v). Problem: Given a connected undirected graph G = (V. Let f be a flow in G.1 Algorithm Specification These definitions are similar to the corresponding definitions shown in section 2 for digraphs. or cf (u. v ∈ V . 8 . A flow in G is a function f : V × V → R such that: ∀u. v) ≤ c({u. called respectivelly source and sink. say a and b. The value of the flow f is defined as: X X |f | = f (s. where V is a set of nodes and E is a set of edges between these nodes (E ⊆ {{u. but considering undirected graphs. But someone deduces that s can also start sending water to b. With this modification. consider. let c : E → R∗+ be the capacity of the edges in G. v) Definition: Given a connected undirected graph G = (V. and considering a pair of nodes u. and a pair of nodes s. v ∈ V }). the volume of water that is sent increases. The edge between a and b can then be used again by the algorithm to compose a new flow augmenting path. The residual capacity of the pair (u. u) X ∀u ∈ V − {s. v}) − f (u. t ∈ V . as well as the associated capacity. v) = −f (v. v) > 0} The residual network is always directed. who sends it to b. In other words. Let f be this flow. E). The algorithm presented in figure 6 is similar to the algorithm by Ford and Fulkerson. is given by: cf (u. v) ∈ V × V : cf (u. E). where: Ef = {(u. f (u. v) = 0 (4) (5) (6) v∈V Definition: Given a connected undirected graph G = (V. v} : u. E). as an example.between b and t. and the edges are the connections. a capacity c : E → R∗+ and two nodes s and t. v ∈ V. i.. and then a stops to send water to b and starts sending to t. Let f be a flow in G. Let f be a flow in G. f (u. v). that node s is a water producer and node t is a water consumer. the order of nodes connected by an edge does not matter. v ∈ V. as water is flowing from s to t both through a and b. Definition: Given a connected undirected graph G = (V. The other nodes of the graph.

f ). also shown in (B). t). f. c. b. 3. f. from edge (d. In the sequence. whose residual network is shown in (P). t) is considered. The corresponding residual network is shown in (D). f. In this node. resulting in the flow shown in (G) and in the residual network shown in (H). d. so that the node is not more used in the flow. The next path that is considered is path (s. d. The execution is based on the original graph shown in (A). the process for node (c. so the found flow is a maximum flow. resulting in flow shown in (O). Next. e. The residual network of the original graph is shown in (B). the path (s. the path (s. resulting in the final flow shown in (Q). The new flow is shown in (E). c. d. The new residual network is shown in (F). In the sequence. g. v] ← f [u. c. The path (s. The use of the path as an augmenting path results in the flow shown in (C). u] ← −f [u. c. that had been already used in previous path. the representation of the flow is the same used in directed graphs. v] + ∆ f [v. Note that. and the node is now used in a new direction. path (s. we must show that: 9 . also shown in (D). f. In this path. b. that is equal to 3. t) is taken. v) : (u. a. d). The next augmenting path considered is path (s. Finally. u] ← 0 while there exists a path p from s to t with no cycles in the residual network Gf do ∆ ← min{cf (u. f. t). d). d.2 Example Execution An example showing the execution of this algorithm in shown in figure 7. there is no feasible augmenting path. The minimum capacity in this case is equal to 6. but there is also a half head showing the direction of the flow. The first path that is found is path (s. The execution proceeds with path (s. c. e. In this figure. a. f. and the new flow is shown in (M). v) in p do f [u. b. d. t). 4 Proofs To show that this algorithm constructs a maximum flow from s to t. 3 units are removed from the direction (d → c). v) ∈ p} for each edge (u. resulting in the flow shown in (K) and in the residual network shown in (L).for each edge {u. with the residual network shown in (N). but in the other direction. b. f. v] ← 0 f [v. Note the edge (c. g. in this step. v} ∈ E do f [u. t) is the last path found. t). the minimum capacity is the capacity of edge (b. d) is repeated in the other direction. The remaining 3 units are than used in the direction (c → d). As shown in the residual network in (R). v] Figure 6: The proposed algorithm. g. f. resulting in the flow shown in (I) and in the residual network shown in (J). t) is considered. g.

5 5 a a e 12 15 s 2 5 9 6 b 18 5 3 t 15 s b 20 7 d 6 10 7 d 4 g 1 c 5 a e 2 3/15 9 6 b 18 3/13 f e 5 12 s g 8 (B) 5 5 10 8 (A) 12 7 1 4 8 a t 6 3 11 1 c 13 11 10 18 13 3 20 4 9 f 6 6 11 9 2 5 15 20 18 2 12 6 13 f e 5 12 18 2 12 5 9 2 5 9 6 t 18 s b 18 16 f 6 10 t 12 3/3 6 6 20 20 11 3/7 d 10 11 10 10 d 1 1 1 g c (D) 5 5 a e s 3/15 6/18 2 5 6 3/13 f 5 18 s b 15 16 6 26 d 12 10 d 7 g 1 c (F) 5 5 a e 6/18 2 5/6 b 3/13 f 5 2 5 23 s b 7 d 5 g c (G) 4 5 1 6 c 10 d 2 1 8/8 10 15 14 2/4 16 11 11 5/10 12 7 6 26 3/7 3 f 1 3/3 11 15 11 t 1/6 6/20 24 2 12 6/9 e 5 12 8/15 g 5 (E) s 10 11 3/8 5 4 1 1 12 t 10 11 10 14 a 10 11 1 c 12 12 3/7 3/4 3 f 6 3/3 11 24 2 5 6 t 6/6 6/20 e 5 2 12 6/9 b g 5 12 12 10 11 (C) a 4 1 7 3/8 c 6 11 20 3/4 6 1 16 g (H) Figure 7: Example execution of the algorithm proposed by this paper. 10 t .

11 .5/5 a 10 a e 12 12 s 13/15 6/18 2 5/5 5/6 b 12 1/9 3/13 f 28 s b 10 2 d 16 11 10/10 5 d g 1 16 c (I) 10 a e 12 12 s 13/15 6/18 2 5/5 8/13 f 28 s b 10 21 d 11 11 10/10 9 5 d 7 1 g 1 16 c (K) 10 a e 12 12 s 13/15 6/18 2 5/5 9/13 f 28 s b 10 8 12 22 f 1 t 4 2 3/3 12 6 32 11 24 2 10 11 t 6/6 12/20 e 2 12 1/9 5/6 b g (L) 5/5 a 20 9 1 1 8/8 t 5 12 6 31 c 12 2 2/7 3/4 8 f 1 3/3 11 24 2 10 11 t 6/6 11/20 e 2 12 1/9 5/6 b g (J) 5/5 a 20 9 1 6 c t 5 2 1 8/8 10 11 14 2/4 12 7 6 26 2/7 8 f 1 3/3 11 24 2 10 11 t 1/6 6/20 e 2 3/7 d 11 11 10/10 6 d 20 8 8 4/4 1/1 8/8 c 8 g 2 16 c (M) (N) 5/5 a 10 a e 12 12 s 14/15 6/18 2 5/5 10/13 f 29 s 10 12 b 8 12 f 3 t 1 3/3 12 6 32 11 24 2 10 23 t 6/6 12/20 e 2 12 1/9 6/6 b g 3/7 d 11 11 10/10 6 d 8 20 8 4/4 c 1/1 8/8 8 g c (O) 2 16 g (P) Figure 7: (cont.) Example execution of the algorithm proposed by this paper.

the result is a flow. For the other nodes. . we have fi (u.) Example execution of the algorithm proposed by this paper. Flow conservation property: The augmenting path can be defined as (a0 .5/5 a 10 a e e 14 2/12 s 14/15 2/2 5/5 6/18 6/6 b 12/13 f 24 10 1/9 4 29 s 12 b 12 f 1 t 1 3/3 12 6 32 11 8 24 t 6/6 12/20 10 10 3/7 d 11 11 10/10 6 d 8 20 8 4/4 c 1/1 8/8 8 g c (Q) 2 16 g (R) Figure 7: (cont. Capacity constraint property: For nodes that compound the augmenting path. u) = − fi−1 (v. The proof consists in demonstrating each one of the properties in the resulting flow. Skew simmetry property: In all cases in which the flow is updated. fi (u. v)−∆. 1. 3. a flow must satisfy some properties. satisfying the capacity constraint. v}) − fi−1 (u. the 12 . satisfying the capacity constraint. satisfying the capacity constraint. and fi (u. . In the following. ∆ ≤ cfi−1 (u. Applying this property to the equation above. v}) − fi−1 (u. In each iteration of the algorithm. v) = fi−1 (u. and always with the opposite value. so fi (u. except for the source and the sink. v) ≤ c({u. v}). As ∆ > 0 (by the definition of residual network). v) = fi−1 (u. The proofs of each one of these items will be discussed in this section. v)+∆. v) + c({u. Consider ∆ as the minimum capacity of this augmenting path. This flow is a maximum flow. The algorithm terminates after a finite number of steps. 4. v) = c({u. v}). an = t and aj ∈ V − {s. each pair is updated only once in each step. Since the augmenting path has no cycles. But ∆ is the minimum value of all residual capacities in the augmenting path. an ). we have fi (u. we call fi the flow in step i. we have fi (u. with a0 = s. v) ≤ fi−1 (u. the flow is not modified. v) ≤ c({u. . For each node of the path. The algorithm constructs a flow. u) + ∆ = fi−1 (u. v).1. so the skew simmetry will always be mantained. v). the flow in the reverse direction is also updated. so the final result is also a flow.1 The Algorithm Constructs a Flow As presented in section 3.  For nodes in the opposite direction. t} for each 1 ≤ j ≤ n − 1. v) ≤ c({u. 2. So. v) < fi−1 (u. v) = −fi (v. v}). a2 . a1 .

because every edge from the source side to the sink side carries a flow equal to its capacity. The capacity of the cut. 4. and a pair of nodes s.aj−1 } = X fi−1 (aj . Clearly. v) v∈V −{aj+1 . we need only produce a cut separating s from t whose capacity equals the value of the terminal flow produced by the algorithm. directed or undirected. aj+1) + fi (aj . Clearly. v) v∈V −{aj+1 . T ). there is a set of nodes that is reachable from s in the resulting residual network. Any flow in this graph must be smaller than or equal to the capacity of this cut.aj−1 } = fi−1 (aj . Thus. Consider a cut (S. v) u∈S v∈T Definition: A minimum cut is a cut whose capacity is minimal. there is no flow unit being carried from R′ to R. aj−1) + X fi−1 (aj . Let R be this set of nodes. each edge formed by a given node u ∈ R and a given node v ∈ R′ carries a flow equal to its capacity. otherwise the residual capacity of the pair of nodes would be positive. This is done as follows. Upon termination of the algorithm. v) = fi (aj . represented as c(S. v) v∈V −{aj+1 . v) v∈V =0 resulting that the flow conservation property is preserved. A (s − t) cut is a partition of V into S and T = V − S. R′ = V − R. every flow unit must traverse an arc of this cut at least once. and v would be reachable in the residual network. is given by: XX c(u. aj−1 ) − ∆ + X fi−1 (aj . in the direction u → v. 13 . and no flow unit can traverse this cut more than once. E). R′ ) is a cut. since every flow unit must cross the cut. Since this predication is valid for all cuts and for all flows. t ∈ V . E). such that s ∈ S and t ∈ T . and let R′ be the set of the unreachable nodes.2 The Flow is a Maximum Flow The following proof is based on a similar proof presented in [3]. After the final application of the algorithm.aj−1 }   = fi−1 (aj . Definition: Given a connected graph G = (V. Since all these edges carry the flow in the direction u → v. the total flow from s to t equals the capacity of this cut. In order to demonstrate that the maximum-flow algorithm has indeed produced a maximum flow. aj−1 ) + v∈V X fi (aj .sum of all incident flows of node aj is: X fi (aj . T ) in graph G = (V. we deduce that the value of the maximum flow is never greater than the capacity of the minimum cut. aj+1 ) + ∆ + fi−1 (aj . so pair (R. aj+1) + fi−1 (aj . The algorithm terminates when no augmenting path can be found.

The Massachusetts Institute of Technology Press. R. [6] J. Busca de desvios em redes baseada nos crit´erios de conectividade #C(v) e MCC(v). Since the graph is a finite graph. [4] L. specifically problems related to network routing. CORMEN. Monticello. M. COHEN. LEVINE. RIVEST. so the algorithm will take no more steps than the maximum flow. D. FORD JR. We also present the proof of correctness in terms of that the algorithm construct a flow. [5] D. Fault-Tolerant Routing Based on Network Connectivity. using the library JDigraph. 2001. For irrational numbers. C. P. [3] J. Introduction to Algorithms. available in [7]. specifically for undirected graphs with no capacity (i. R. Princeton University Press. 30th Annual ACM Symp. 69-78. FULKERSON. the algorithm will not finish. H. this flow is a maximum flow and the algorithm terminates after a finite number of steps.2. LEISERSON. S. EVANS. IEEE DRCN. In this case.. 5 Implementation The algorithm has been implemented. [2] T. Future work will use the proposed algorithm for applications related to edge connectivity in computer networks. E. it’s proved that. in each step of the algorithm. 1992. P. in some cases.. 1962. DUARTE JR.. The implementation is developed in Java language [8]. that is a related concept. Budapest. the flow is increased at least by one unit. 2nd edition. MOLINA JR. Flows in Networks. The implementation is used specifically to find the minimum cut. E. 1998. N. Proc. and the complete source code is available in [6]. the maximum flow is also finite. E. 1990.e. Finding Maximum Flows in Undirected Graphs Seems Easier than Bipartite Matching. Dekker.. Further documentation about this cases can be found in [4]. A similar idea can be used to prove that the algorithm is finite for rational numbers. Optimization Algorithms for Networks and Graphs. This work is restricted to cases where edge capacities are rational. Trabalho de 14 . TORRES JR. References [1] J. SCHROEDER. P. MINIEKA.4. as presented in section 4. R. on Theory of Computing. KARGER. 6 Conclusion In this paper we present an algorithm for computing the maximum flow of undirected graphs based on augmenting paths. L. R. R. unitary capacity). The algorithm is used as a part of the implementation of a connectivity simulator.3 The Algorithm Terminates After a Finite Number of Steps Let’s initially accept that all edge capacities are integers..

net. Universidade Federal do Paran´a. WALEND.conclus˜ao de curso. 2003. accessed in Feb’2004.sun. accessed in Feb’2004. 15 . Bacharelado em Ciˆencia da Computa¸ca˜o. http://jdigraph.com. JDigraph. [7] D. [8] Java Technology.sourceforge. http://java.