I was trying to solve a problem to design an algorithm to determine whether a direct graph is semi-connected. Someone says it can be done by using topological sort every SCC in the graph. And SCC is guaranteed to be DAG. However, I think SCC graph must be a circle, why it is a DAG since DAG mean no circle.
In the graph theory, is a strongly connected component SCC form a DAG?
1.6k views Asked by XIANG ZUO At
1
You misunderstood the argument.
Suppose you have a graph that has points
A1 <--> A2 <--> A3 --> B1 <--> B2 --> C1 <--> C2
and
A1 A2 A3
,B1 B2
,C1, C2
are SCC.Then you treat
A1 A2 A3
as a single pointA
. Any node connecting to one ofA1 A2 A3
is treated as connecting toA
, Any node connected from one ofA1 A2 A3
is treated as connected fromA
. Same for merging points toB
,C
So it became
A --> B --> C
. It is guaranteed that this is a DAG.