/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} 22E Give an efficient algorithm whic... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Give an efficient algorithm which takes as input a directed graph G(V,E)and determines whether or not there is a vertexs∈V from which all other vertices are reachable.

Short Answer

Expert verified

Algorithm takes as input a directed graph G(V,E) and determines whether or not there is a vertexs∈Vfrom which all other vertices are reachable is proved.

Step by step solution

01

Explain the algorithm for determining a vertex s∈V from which all the vertices are reachable.

A vertex s belongs to G(V,E) where v is the vertex and e is the edges such that all other vertices are reachable from the vertex s and this vertex s is known as mother vertex. And there may be more than one mother vertex present in the graph.

In other words, it states that all other vertices in G are reached by a path from v. Kosaraju's algorithm is used to find strongly connected component in the graph.

02

Determine the mother vertex.

In an undirected graph, here all vertices are act as a mother vertex because from each vertex makes their path towards its every other vertex.

Or to finding the mother vertex in any directed graph here, check all vertices of the given graph and detect from which vertex every other node are connected.

Let a directed graph which contain nine edges and seven vertices. In this graph node 5 is act as a mother vertex from which all other vertices are reachable. For example, the graph is given below:

5is the mother vertex in directed graph.

Here in this graph from vertex five all other vertices are reachable. From 5→2by one vertex in the middle that is 2. From5→4by follow the directions from 5→6→4.

From 5→3by following the path that is5→6→4→1→3there is the direct path from 5→2and at the last from 5→1path is 5→6→0→1.

03

 A directed graph with mother vertices.

Another example is given as the directed graph which contain five edges and five vertices 0,1,2,3,4,5. In this graph node 0, 1 and 2 are act as a mother vertex from which all other vertices are reachable.

From vertices 0,1,2, all other vertices are reachable. From 0 to 1, consider 2 as a middle vertex. Like that from zero all the other vertices are visited. Then from 1 to 3, consider 0 as a middle vertex. Like that from 0, all the other vertices are reachable same as by the mother node 2.

Hence,thealgorithm that determines whether or not there is a vertexs∈Vfrom which all other vertices are reachable is proved.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.