I have this graph. The SCCs in this Graph are {a, b, e}, {d, g}, and {c, d, h}. But the cycles in this graph are the same components, right?
So what exactly is the difference between SCCs and directed cycles? Do they only differ in specific cases?
I have this graph. The SCCs in this Graph are {a, b, e}, {d, g}, and {c, d, h}. But the cycles in this graph are the same components, right?
So what exactly is the difference between SCCs and directed cycles? Do they only differ in specific cases?
In a directed graph
G(V,E)
:w
is reachable from a vertexv
if there exists a directed path fromv
tow
.v
andw
inG
there is a directed path fromv
tow
and a directed path fromw
tov
.v
andw
in the strongly connected sub-graphG'(V',E')
whereV' ⊂ V
andE' ⊂ E
there is a directed path fromv
tow
and a directed path fromw
tov
.The difference is that:
If you have the strongly connected component:
Then there is a directed path
C → D → A → B
and a directed pathB → D → A → C
but there is no directed cycle that contains bothB
andC
as the edgeD → A
would have to be visited twice in the cycle.Additionally, there is another (technical) difference that if the directed cycle visits all the vertices then it is a strongly connected directed graph and not a strongly connected component (as a component is a strict sub-graph).