Lecture 11: Kosaraju (SCCs) and Intro Prim's Algorithm (MST) Flashcards

1
Q

Explain connectivity in a directed and undirected graph (connected, weakly connected, strongly connected)

A

Directed graph

We say it’s connected when there’s simply an edge between any two vertices

Directed Graphs

Strongly connected: If there’s a directed path between any two vertices

Weakly connected: When there’s any undirected path between any two vertices disregarding the orientation

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

Directed Graph SCCs (maximal SCCs)

A

An SCCs of a graph G is an equivalence class on the relation uRv, where uRv if u->v and v->u via some directed path.

When we talk about SCCS we mean maximal SCCs meaning we cannot add another vertex and still maintain the relation

Every node is in precisely one
strongly connected component,
since the equivalence classes
partition the set of nodes.

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

Can you devise a directed graph G that’s a counterexample and demonstrates why a simple DFS with a wrapper loop fails to try to locate all SCCs of a graph?

A

A->B, B->A, A->C

DFS will conclude that ABC is an SCC but we have no way of getting back to A from C

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

Kosaraju’s SCC Algorithm

A

Kosaraju’s Algorithm

  1. Run DFS on G
  2. Compute the transpose or reverse of G, Grev. The graph with arcs reversed
  3. Run DFS on Grev

Run time: Ø(V+E)

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

How is a tree a graph

A

A tree is a connected graph without cycles

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

What is a spanning tree and its properties

A

A spanning tree is a subset of a graph G, which has all the vertices covered with a minimum number of edges

  • Must be connected
  • Must be acyclic (obviously BCS its a tree)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Minimum spanning tree and properties

A

is a spanning tree that minimizes the sum of weights on the edges of spanning trees

  • connects all vertices together with the minimal total weight of edges
  • if edges are unique, the MST will be unique otherwise, there can be more than one.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly