Skip to content

Commit 76ae648

Browse files
committed
DA
1 parent 2f7cafb commit 76ae648

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

slides/graphtheory/network_flow.key

32.2 KB
Binary file not shown.

slides/graphtheory/network_flow_dinics.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,33 @@ whatever place of interest we desire to go. How can we apply this to solving
3939
for the maximum flow?
4040

4141
In this analogy, you are the source and the coffee shop is the sink. The main
42-
idea behind Dinic’s algorithm is to guide augmenting paths from s -> t using a
42+
idea behind Dinic’s algorithm is to GUIDE augmenting paths from s -> t using a
4343
level graph, and in doing so greatly reducing the runtime.
4444

45+
The way Dinic’s determines which edges make progress towards the sink T and
46+
which do not is by building what is called a level graph.
47+
48+
The levels of the graph are those obtained by doing a BFS from the source.
49+
50+
Furthermore, an edge is only part of the level graph if it makes progress
51+
towards the sink. That is, the edge must go from a node at level L to another
52+
at level L+1.
53+
54+
The requirement that edges must go from L to L+1 prunes backwards and "sideways"
55+
edges (grey edges in this slide).
56+
57+
As yourself, if we're trying to go from s -> t as quickly as possible, does it
58+
make sense to take the red edge going in the backwards direction?
59+
60+
No, taking the red edge doesn’t bring you closer to the sink, so it should only
61+
be taken if a detour is required. This is why backwards edges are omitted in
62+
the level graph.
63+
64+
The same thing can be said about edges which cut across sideways across the same
65+
level since no progress is made.
66+
67+
It’s also worth mentioning that residual edges can be made part of the level
68+
graph, but they must have a remaining capacity, greater than 0.
69+
4570

4671

0 commit comments

Comments
 (0)