History
Yefim Dinitz invented this algorithm in response to a pre-class exercise in Adelson-Velsky's algorithms class. At the time he was not aware of the basic facts regarding the Ford–Fulkerson algorithm. Dinitz mentions inventing his algorithm in January 1969, which was published in 1970 in the journal ''Doklady Akademii Nauk SSSR''. In 1974, Shimon Even and (his then Ph.D. student) Alon Itai at the Technion in Haifa were very curious and intrigued by Dinitz's algorithm as well as Alexander V. Karzanov's related idea of blocking flow. However it was hard for them to decipher these two papers, each being limited to four pages to meet the restrictions of journal ''Doklady Akademii Nauk SSSR''. Even did not give up, and after three days of effort managed to understand both papers except for the layered network maintenance issue. Over the next couple of years, Even gave lectures on "Dinic's algorithm", mispronouncing the name of the author while popularizing it. Even and Itai also contributed to this algorithm by combining BFS andDefinition
Let be a network with and the capacity and the flow of the edge , respectively. :The residual capacity is a mapping defined as, :# if , :#: :# if , :#: :# otherwise. :The residual graph is an unweighted graph , where :: . :An augmenting path is an – path in the residual graph . :Define to be the length of the shortest path from to in . Then the level graph of is the graph , where :: . :A blocking flow is an – flow such that the graph with contains no – path. This means that the subgraph resulting from removing all saturated edges (edges with ) does not contain any path from to . In other terms, the ''blocking flow'' is such that every possible path from to contains a saturated edge.Algorithm
Dinic's Algorithm : ''Input'': A network . : ''Output'': An – flow of maximum value. # Set for each . # Construct from of . If , stop and output . # Find a blocking flow in . # Add augment flow by and go back to step 2.Analysis
It can be shown that the number of layers in each blocking flow increases by at least 1 each time and thus there are at most blocking flows in the algorithm. For each of them: * the level graph can be constructed bySpecial cases
In networks with unit capacities, a much stronger time bound holds. Each blocking flow can be found in time, and it can be shown that the number of phases does not exceed and . Thus the algorithm runs in time. In networks that arise from the bipartite matching problem, the number of phases is bounded by , therefore leading to the time bound. The resulting algorithm is also known as Hopcroft–Karp algorithm. More generally, this bound holds for any ''unit network'' — a network in which each vertex, except for source and sink, either has a single entering edge of capacity one, or a single outgoing edge of capacity one, and all other capacities are arbitrary integers.Example
The following is a simulation of Dinic's algorithm. In the level graph , the vertices with labels in red are the values . The paths in blue form a blocking flow.See also
* Ford–Fulkerson algorithm * Maximum flow problemNotes
References
* * * {{Optimization algorithms, combinatorial Network flow problem Graph algorithms