Graphs and Network Flow Flashcards

1
Q

What are the generic loop invariants used for searching a graph starting from some node s

A

Generic loop invariants:
Nodes are considered to be not found, found, not handled, handled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If Found:

If Handled:

A

if node v is found, we can trace a path from s to the node, can be traced backwards.
v, π(v), π(π(v)), π(π(π(v))), . . . , s.

If node v is handled, all neighbours have been found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Extra LI for BFS

A

Nodes have been found in order of their distance from s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Extra LI for DFS

A

Nodes in the stack form a path starting at s going to the current node u being considered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Recursive DFS pre + post cons

A

Pre: A directed or undirected graph is given, some nodes marked found and some node s’ specified
Post: Every node reachable from s’ is found

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Extra LI for Dijkstra’s shortest-weighted paths alg

A

Extra LI are
- Handled: For each handled node v, the values of d(v) and pi(v) give the shortest length and path from s. (Path only contains handled nodes).

  • Found: For each unhandled node v, the values of d( v) and pi(v) give the shortest length and path from s.
    Visit any number of handled nodes starting from s, then follow one last node that may or not be handled.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What data structure does Dijkstra’s alg use?

A

Priority Queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Steps for Network flow Diagram

A

Given flow - > Augmenting Graph -> Augmenting path - > New flow
Repeat until augmenting graph no longer has a augmenting path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to make cut

A

Cut such that flow out of ‘s’ node = flow into cut ‘u’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you get New flow values?

A

On the augmenting graph path, find the bottle neck ‘w’ value. Add/subtract if passing through or backward on each node on the path.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Capacity of cut = ?

A

= Capacity of edges crossing from U to V.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Conclusion to network flow solution

A

All edges across the cut are at capacity in flow. Any edges going from V to U have no flow in them.
Hence, the flow across the cut equals flow out of s in the final Flow equals capacity of the cut.
Rate of final flow = #

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Flow witness statements

A

The flow witnesses the fact that a flow with rate 16 is obtainable.
The cut witnesses the fact that a flow can be no bigger than 16
Hence a max flow of 16 is optimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly