Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimal addition to strongly connected graph

I have a set of nodes and set of directed edges between them. The edges have no weight.

How can I found minimal number of edges which has to be added to make the graph strongly connected (ie. there should be a path from every node to all others)? Does this problem have a name?

like image 606
Jan Langer Avatar asked Jan 13 '13 16:01

Jan Langer


People also ask

What is the minimum number of edges you must add to G to make it strongly connected?

(d) What is the minimum number of edges you must add to this graph to make it strongly connected? Ans: Two directed edges (one directed from E to B, and the other from C to E), when added, will make the graph G with no source or sink node.

What is the minimum number of edges on a strongly connected graph on vertices?

Explanation: Adding a directed edge joining the pair of vertices {3, 1} makes the graph strongly connected. Hence, the minimum number of edges required is 1.

How can the number of strongly connected components of a graph change if a new edge is added?

1) If the new edge connects two vertices that belong to a strongly connected component, the number of strongly connected components will remain the same.

What is the minimum edges of a graph to guarantee that the graph is connected?

The minimum number of edges for undirected connected graph is (n-1) edges. To see this, since the graph is connected then there must be a unique path from every vertex to every other vertex and removing any edge will make the graph disconnected.


1 Answers

It's a really classical graph problem.

  1. Run algorithm like Tarjan-SCC algorithm to find all SCCs. Consider each SCC as a new vertice, link a edge between these new vertices according to the origin graph, we can get a new graph. Obviously, the new graph is a Directed Acyclic Graph(DAG).
  2. In the DAG, find all vertices whose in-degree is 0, we define them {X}; find all vertices whose out-degree is 0, we define them {Y}.
  3. If DAG has only one vertice, the answer is 0; otherwise, the answer is max(|X|, |Y|).
like image 123
Jun HU Avatar answered Oct 21 '22 05:10

Jun HU