Skip to main content

Find Mother Vertex in a Graph

A "mother vertex" in a directed graph is a vertex from which every other vertex can be reached via a directed path. In other words, if we start from the mother vertex and traverse the graph in the direction of the edges, we can reach every other vertex in the graph.

Find Mother Vertex in a Graph

More formally, a vertex is a mother vertex if and only if there exists a directed path from it to every other vertex in the graph.

It is possible for a graph to have multiple mother vertices or none at all. If a graph has more than one mother vertex, they are all considered as mother vertices. If a graph has no mother vertex, it means there is no single vertex that can reach every other vertex in the graph.

Program List





Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment