cs126 reachability

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

Define reachability.

The existence of a path between two vertices.

2
New cards

Define strong connectivity.

Each vertex can reach all other vertices.

3
New cards

Describe how a DFS can be used to check if a graph is strongly connected.

  1. Pick a vertex v in G

    1. Perform a DFS from v in G

    2. If there’s a node w that is not visited, then print “no”

  2. Let G’ be G with edges reversed

    1. Perform a DFS from v in G’

    2. If there’s a node w that is not visited, then print “no”

    3. Else, print “yes”

4
New cards

What is the worst-case time cost of using a DFS to confirm strong connectivity?

O(n+m)

5
New cards

Define strongly connected components (SCC).

Maximal subgraphs, where each vertex can reach all other vertices.

6
New cards

Describe Kosoraju’s algorithm.

  1. Run DFS on G and mark the finish times for all vertices

  2. Compute G’ by reversing the edges of G

  3. Run DFS on G’ in the order of decreasing finish times

  4. Each tree from the previous step represents a SCC

7
New cards

What strategy does Tarjan’s algorithm employ?

It uses a stack.

8
New cards

Define transitive closure.

  • Transitive closure of G is the digraph G* such that:

    • G* has the same vertices as G

    • If G has the a path from u to v, G* has a directed edge (u,v)

  • It provides reachability information about a graph

9
New cards

What is the cost of computing the transitive

closure of a graph using DFS?

O(n x (n+m))

Explore top flashcards

322 Exam 1
Updated 991d ago
flashcards Flashcards (78)
abdomen
Updated 815d ago
flashcards Flashcards (29)
Exam 2 Top 300
Updated 620d ago
flashcards Flashcards (56)
25.1!!!
Updated 205d ago
flashcards Flashcards (23)
georgaphy
Updated 989d ago
flashcards Flashcards (42)
Theatre Post 1950
Updated 535d ago
flashcards Flashcards (32)
Substance Abuse
Updated 4d ago
flashcards Flashcards (41)
322 Exam 1
Updated 991d ago
flashcards Flashcards (78)
abdomen
Updated 815d ago
flashcards Flashcards (29)
Exam 2 Top 300
Updated 620d ago
flashcards Flashcards (56)
25.1!!!
Updated 205d ago
flashcards Flashcards (23)
georgaphy
Updated 989d ago
flashcards Flashcards (42)
Theatre Post 1950
Updated 535d ago
flashcards Flashcards (32)
Substance Abuse
Updated 4d ago
flashcards Flashcards (41)