Trees/Paths/Flows Flashcards

1
Q

Name the condition under which Dijkstra’s algorithm correctly determines the shortest path between a starting vertex and all other vertices in a graph

A

Where none of the edges have negative edge weights

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

What algorithm can find the shortest path even despite negative weights?

A

Algorithms like the Bellman-Ford Algorithm

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

What is a spanning forest?

A

a spanning forest of a graph is family of subgraphs such that each subgraph is a tree, the trees don’t overlap and every vertex in the spanning forest is contained in a tree

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

What does vertex disjoint mean?

A

Two trees that are vertex disjoint don’t overlap

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

How many vertices must a spanning tree have to be considered a tree?

What must a graph be to be considered a tree?

A

1 or more vertices

it must be acyclic (must not contain cycles)

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

What is a spanning tree?

A

a spanning tree is a spanning forest consisting of a single tree.

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

Does Ford’s algorithm always terminate?

A

No if the graph contains cycles with edges with negative weights

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

What is a vertex cut?

A

Partitions a graph into two non-empty sets

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

What is a crossing edge?

A

The edge that joins two sets, by connecting a vertex in one set to a vertex in another set

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

What is the cut property?

A
  • provides criteria for selecting edges in the MST
  • For any vertex cut, the crossing edge between the sets with the most minimum weight is in the MST
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the steps in Prim’s algorithm to find the MST:

A

1) Start at a random vertex
2) add the edge with the smallest weight to the MST
3) move to the next vertex, do the same
4) if adding the edge with the smallest weight will create a cycle, don’t add it and add the edge with the next smallest weight
5) repeat until we have n-1 edges, for n vertices.

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

Why does Prim’s algorithm work

A
  • We start from a spanning forest where every vertex is its own tree.
  • We start at a vertex and keep picking the minimum edge to add to our tree.
  • Adding an edge from the spanning forest won’t cause an error, as we only add it if it won’t cause a cycle, so we keep doing this until we have n-1 edges, for n vertices.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the steps in Kruskal’s algorithm to find the MST:

A

1) order edges by ascending order of edge weight
2) initialise tree as empty
3) go through list of edges adding the edge to tree as long as it doesn’t cause a cycle
4) return the tree

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

Why does Kruskal’s algorithm work

A
  • Initially our graph holds trivial trees (made of 1 vertex each).
  • Whenever we add an edge we connect two trees.
  • If we add an edge with the current most minimum weight, until we can’t add anymore edges without creating a cycle, we will have a spanning tree with all the smallest weights.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do we encode a graph problem?

A

xe for each e ∈ E (decision variable for each edge)

objective is maximise or minimise either weight times edge or just whether to include the edge

constraints: each edge should be 0 or 1, so xe ∈ {0,1}
and flow constraints should hold, how many times each edge should be in set.

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

What is LP relaxation:

A

Relaxing the constraints of an ILP to change the problem into an LP, so it’s easier to solve

17
Q

What are ILP?

A

Integer linear programs are where the decision variables must be integers, so only integer solutions are allowed

18
Q

What is the convex hull?

A

The convex hull conv(S) of a set S ∈ R^n consists of all the convex combinations of points in S

19
Q

When is a convex set integral?

A

If the convex hull of it’s integer points is the same as the set itself

20
Q

What ILP constraint says the entire graph edges should sum to 1 less than the number of vertices?

A

Sum of xe for e ∈ E = |V| - 1 where V is the set of all vertices

21
Q

What ILP constraint says the all subsets of vertices should not contain any cycles?

A
  • They should contain vertices in subsets-1 edges for subsets that aren’t empty and aren’t V:

Sum of xe for e ∈ S <= |S|-1 for ∅ ⊂ S ⊂ V

22
Q

How can we prove we have the optimal solution for an ILP:

A
  • By constructing the dual of the ILP encoding and relaxing it, by strong duality, it will show the primal ILP is optimal
  • or show that complementary slackness holds for the dual
23
Q

When is a digraph considered simple?

A

If it has no loops (cycles) or parallel arcs

24
Q

What is the definition of a feasible potential

25
Q

What does a feasible potential provide?

A

The lower bound for the shortest path costs

26
Q

What constraint says we want incoming edges - outgoing edges = 0 for every vertex except the source and the sink:

A

Sum of xuv (u,v) ∈ E - Sum of xvw, (v,w) ∈ E = 0 for v ∈ V \ {S, T}

27
Q

For an ILP graph problem what do we assume to get an optimal solution?

A

That the edges weights are all non-negative

28
Q

What ILP constraint says we want the total of outgoing edges to be 1 for the source?

A

Sum of xsv = 1, (s,v) ∈ E

29
Q

What ILP constraint says we want the total of incoming edges to be 1 for the target?

A

Sum of xvt = 1, (v,t) ∈ E

30
Q

What does it mean if there’s a negative cost cycle in the graph:

A

Then the LP is unbounded

31
Q

What condition tells us which edges we need to take for the shortest path?

A

The feasible potential

32
Q

What is true if u is not a feasible potential after n-1 iterations:

A

There is a negative cost cycle

33
Q

In the min-flow max cut problem, what must there be for the flow to be improved?

A

There must be an augmenting path (a path where there is still flow left)

34
Q

What is a residual network?

A

It shows flow that is leftover along edges (where there is flow remaining that can be pushed along an edge)

35
Q

what condition proves that the dual of the max flow min cut problem gives an optimal solution?

A

Total unimodularity