isCyclic(G)
This method checks whether a MixedGraph is cyclic, i.e. contains a directed cycle or a cycle on directed edges.
A directed cycle is a cycle in the Digraph constructed from a mixed graph G by identifying all connected components on bidirected and undirected edges. Such a connected component contains either bidirected edges only or undirected edges only.
In the following example, there are no directed cycles.
|
|
|
|
|
In the next example, there are no cycles inside the digraph of the mixed graph, but there is a directed cycle after you identify the vertices {1,2} and {3,4}.
|
|
|
|
This is a similar example as before, but now the vertices {1,2} are connected by an undirected edge and {3,4} by a bidirected edge.
|
|
|
|
|
In the following example, there is a cycle on the directed edges that is inside a connected undirected component.
|
|