Question: USING C++ For a directed graph, a strongly connected graph is one where for all pairs of vertices, u and v, a directed path exits
USING C++
For a directed graph, a strongly connected graph is one where for all pairs of vertices, u and v, a directed path exits for u to v and from v to u. A weakly connected graph is a directed graph which becomes strongly connected when all of its directed edges are replaced with undirected edges. A graph with a single vertex is considered strongly connected.
Your job is to add some methods to the Graph class created in class:
bool isStronglyConnected() - returns true if the graph instance is strongly connected.
bool isWeaklyConnected() - returns true if the graph instance is weakly connected.
int largestWeaklyConnectedSubGraph() - returns the number of vertices in the weakly connected sub-graph with the largest number of vertices. In the case of a graph that is at least weakly connected, this should return the number of vertices in the graph.
int largestStronglyConnectedSubGraph() - returns the number of vertices in the STRONGLY connected sub-graph with the largest number of vertices. In the case of a graph that is already strongly connected, this should return the number of vertices in the graph. This is MUCH more difficult than the the weakly connected sub-graph method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
