Dinic's algorithm

from Wikipedia, the free encyclopedia

The dinic's algorithm is an algorithm of the graph theory for determining a maximum flux in a network . It was developed by EA Dinic (Jefim (Chaim) Dinic) and published in 1970. It is a further development of the Edmonds-Karp algorithm , which Dinic developed independently of Jack Edmonds and Richard M. Karp . Dinic's algorithm differs from the Edmonds-Karp algorithm in that, in each pass, not only a single shortest st-path is augmented, but sometimes larger st-flows that are composed of several shortest st-paths.

The algorithm

In the following, the directional graph in the network , the capacity function ( indicating the capacity of an edge ), the node from which the flow starts, and the destination node of the flow. denotes the set of nodes of the graph and the set of edges. For a flow denotes the residual graph and the layer graph, i.e. the graph that shares with the set of nodes and consists of precisely those edges that belong to any node and to a shortest sv-path of . In particular, it also contains all edges that belong to a shortest st-path in . denotes the residual capacity belonging to the residual graph. A blocking flow (also called a blocking flow) in is an st-flow that utilizes at least one edge in every st-path . For an edge denotes the associated rear edge of the residual graph.

The algorithm works as follows:

  1. Bet for each edge .
  2. Determine the shift graph .
  3. Determine a blocking flow in .
  4. If the flow is zero, we're done, otherwise augment along (i.e. for each edge set: (with , if )) and jump to 2.

At the end there is a maximum st-flow, since there is no longer an st-path in the residual graph.

Find blocking flow

Step 3 of the algorithm, a barrier can flow in for example be calculated as follows:

  1. Bet for each edge .
  2. Set .
  3. BEGIN
    • (Way out of only one knot without edges)
    • jump to FORWARD.
  4. IN FRONT
    • If no edge leaves the knot , jump to BACK.
    • Otherwise
      • Select an edge from .
      • Extend at .
      • If so , go to FORWARD.
      • If so , skip to AUGMENT.
  5. AUGMENT
    • Augmentiere along as much as possible (i. E. For set for each ).
    • Remove the edges that are being busy.
    • Jump to START.
  6. BACK
    • If so, the flow is blocked, i.e. STOP.
    • Otherwise
      • Be last edge on .
      • Shorten by .
      • Remove and remove any edges that may be incident with it .
      • Jump to FORWARD.

At the end of this procedure, lock flow is in . Be and . This method requires a running time of to calculate a blocking flow . Because every call of AUGMENTATE requires runtime and each of these calls takes an edge from the graph, so there are at most these calls (because the layer graph has at most edges). Because the layer graph does not contain any directed circles, each node can be reached at most once by a VOR operation between two AUGMENTATION calls, so a maximum of these are carried out in total ; a VOR operation can be executed in constant runtime. In the BACK operations, a node is removed each time, so they are performed at most two times, all BACK operations together have a running time of .

annotation

Instead of the layer graph, EA Dinic worked with a subgraph that consists precisely of the nodes and edges that lie on the shortest st paths. The use of the layer graph works in the same way, but simplifies the description of the algorithm.

running time

Be and . Dinic's algorithm requires at most passes. The layer graph can be calculated in runtime using breadth-first search . A blocking flow in can be calculated in runtime using the method given above . This results in a total running time of . This is also the running time, which was proven by Dinic in 1970. However, the Goldberg-Tarjan algorithm works faster.

With an improvement by Alexander Karzanov from 1974, a running time of can also be achieved for the Dinic algorithm .

swell

Web links