Network Flows Flashcards
What is a Bipartite graph?
A graph where the vertices V are partitioned into two disjoint sets L, R s.t. every edge has one endpoint in L and one endpoint in R.
What is a matching?
In G set of edges E’ s.t. every vertex is adjacent to at most one edge in E’.
What concepts constitute Network Flows?
- Greedy and local-search heuristics :
- non-trivial greedy/local search algorithms
- heuristic on choosing next step crucial for performance
- Reductions and completeness
- If solution for A, then reduce B to A and use solution for A. Map output of A to output of B through a function
- Complete for efficient solutions
- Duality:
- optimum solution to max and min is the same
True or False
Any problem that can be solved in poly-time can be encoded as an instance of Network Flows.
True!
This is because Net flows are complete for problems with efficient solutions.
True or False
In network flows, solution for maximization = solution for minimization
True! This is due to duality
Define a Network Flow
- Directed graph G=(V,E)
- source node (no incoming edges)
- target node (no outgoing edges)
- Each edge e has a capacity c(e) ≥ 0 (usually integers or rationals)
What is a flow in a network flow G?
- Positive number for each edge e f(e) satisfying:
- capacity constraint
- flow conservation
What are the capacity constraints?
- For each edge e, 0 ≤ f(e) ≤ c(e)
What is the flow conservation?
- For each vertex v, s.t. v≠s or v≠t,
- → sum of flow into v = sum of flow leaving v
What is the value of a flow?
sum of flow leaving source node.
Define the Max Flow problem
- Input:
- Network flow G with s, t, and c(e) for all edges
- Output:
- Flow f with maximum value
What naive way does not work to solve the Max Flow problem and what is the solution?
- Picking an s-t path and pushing all the flow we can on that path. Stop when we can’t push any more
- SOLUTION:
- re-routing
What is a residual graph?
- Graph which will record all possible ways in which we can reroute the flow
- G_f copy of network flow G but:
- Forward edges:
- c(e) - f(e)
- Backward edges:
- f(e)
- Forward edges:
Define what a simple s-t path is.
Path with no repeating vertices.
What is an augmenting path?
- G network flow
- f flow on G
- G_f residual graph
- augmenting path P is any simple s-t path in G_f
In your own words, describe the steps of the function Augment
-
Input: net flow G=(v,E), flow f, augmenting path P on G_f
- Get the minimum value on an edge of P = b
- For every edge in P:
- if (u,v) in E (in net flow) → f’(e) = f(e) + b
- so augment the flow on that edge by b
- if (v,u) in E (in net flow) → f’(e) = f(e) - b
- so augment the flow but backwards.
- if (u,v) in E (in net flow) → f’(e) = f(e) + b
- Return the augmented flow f’
Describe on your own words the steps in Ford-Fulkerson
-
Input: Network flow G=(V,E) with s and t
- Initialize f(e) = 0 for all edges
- Construct residual graph G_f
- while there is an augmenting path P:
- f’ = Augment(f,P)
- Update G_f
- Return f
True or False
The augmenting path chosen through Ford-Fulkerson will negatively affect finding the correct optimal solution.
FALSE
You can take any augmenting path and will ALWAYS get to the correct solution.
True or False
The choice of augmenting path in Ford-Fulkerson will affect the run-time of the algorithm.
True
It heavily affects the run-time
What is the runtime of Ford-Fulkerson?
O(|E| * C)
Where C = total capacity of edges leaving s
What can greatly affect the runtime of Ford-Fulkerson?
- The Augmenting Path choice in FF
- The total capacity of the edges coming from s
- ex) they can add to C = 1000000 then the runtime is O(|E| * 1000000 )
True or False
val(f) ≤ C
- TRUE
- val(f) is the sum of the flows on edges leaving s
- C sum of capacities on edges leaving s
Explain why Ford-Fulkerson is O(|E|*C)
- Finding an augmenting path can take O(|V| + |E|) = O(|E|)
- the while loop will trigger at most C times (increase flow by 1 each time)
- So we get O(|E|*C)
True or False
Runtime of FF is actually exponential in the length of its input.
TRUE
- integers are encoded in binary:
- integer c is actually O(log c)
- which makes C exponentially on it’s lenght
What are the two properties that weill always be true of the output of FF?
- Let U be the set of vertices reachable from s in the output graph of FF
- every edge leaving U is saturated
- sum of flow of all edges leaving U = val(f)
CONCLUSION: U is an s-t cut
What is an s-t cut?
- Let U be a subset of vertices such that s is in U but t is not.
- c(U) = sum of the capacities of the edges leaving U