Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A digraph is called strongly connected, if between any two vertices there is a ( directed ) path. The simplest example for strongly connected digraphs
A digraph is called "strongly connected", if between any two vertices there is a directed path. The simplest example for strongly connected digraphs is the directed cycle graph, that is for n we have the vertices n and the arcs nnn
Now the task is to decide whether an input digraph G is strongly connected. Which of the following algorithms does the job using n for the number of vertices of G
For wrong ticks negative marks are given.
A digraph is called "strongly connected", if between any two vertices there is a directed path. The simplest example for strongly connected digraphs is the directed cycle graph, that is for n we have the vertices n and the arcs nnn
Now the task is to decide whether an input digraph G is strongly connected. Which of the following algorithms does the job using n for the number of vertices of G
For wrong ticks negative marks are given.
Choose a start vertex s
Run BFS with start vertex s If one of the distances is infinity, then G is not strongly connected, and the algorithm terminates.
Now obtain the new digraph G by keeping the vertices, while reversing the direction of the arcs.
Run BFS with start vertex s on G The original G now is strongly connected iff in G none of the distances is infinity.
Run DFS without controlling the vertex order. If a restart was needed, then G is not strongly connected, and the algorithm terminates.
Obtain the new digraph G from G by keeping the vertices, while reversing the direction of the arcs. Run DFS on G again without controlling the vertex order. Now G is strongly connected, iff this run of DFS didn't need a restart.
Run BFS without controlling the vertex order. If from the start vertex which depends on the vertex order we can not reach every other vertex, then G is not strongly connected.
Otherwise obtain the new digraph G from G by keeping the vertices, while reversing the direction of the arcs. Run BFS on G again without controlling the vertex order. If from the start vertex which depends on the vertex order we can not reach every other vertex, then G is not strongly connected, while otherwise G is strongly connected.
Pick any vertex s
Run DFS with start vertex s If finishing time of s is not n then G is not strongly connected, and the algorithm terminates.
Now obtain the new digraph G by keeping the vertices, while reversing the direction of the arcs.
Run DFS with start vertex s on G The original G now is strongly connected iff the finishing time of s is againn
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started