Question

Suppose we are given a directed acyclic graph G with a unique source and a unique sink t. A vertex v ¢ {s,t} is called an (s,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Vertex t will only be reachable from vertex s if performing BFS(Breadth First Search) starting from vertex s will cover vertex t otherwise t will not be reachable from s.

Hence our algorithm will be as follows:-

CUT_VERTEX(G=(V,E),s,t)

1. Cut_vertex_set = {} //initially this set is empty

2. For each vertex v \notin \{s,t\} in V:-

3..........Remove v from G

4..........Perform BFS in G with s as source vertex

5.................If BFS tree contains t then add vertex v back to graph G and continue //since v does not disconnect s and t

6................else //v is the cut vertex

7..........................Cut_vertex_set.Add(v) //add v into the solution set

8..........................Add vertex v back to graph G and continue

9. Return Cut_vertex_set //return the solution

Time complexity = |V|*( Time to remove vertex from G and adding back the vertex + Time to perform BFS)

=O( |V|*(|V|+|E| + |V|+|E|)) = O(|V|2 + |V||E|)

Please comment for any clarification

Add a comment
Know the answer?
Add Answer to:
Suppose we are given a directed acyclic graph G with a unique source and a unique...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT