Directed cycles #
A graph, given by a list of vertices and a list of edges, is read as a directed graph through its
arcs (u, v) ∈ G.edges between declared vertices (Cslib.Complexity.Graph.DirAdj), as for the
directed Hamiltonian problems. A directed cycle (Cslib.Complexity.Graph.IsDirCycle) is a
nonempty list of distinct declared vertices whose consecutive vertices, read cyclically
(Cycle.Chain), are joined by arcs; a vertex with a self-loop is a cycle of length one, and two
vertices with arcs both ways form a cycle of length two. A graph is acyclic
(Cslib.Complexity.Graph.IsDirAcyclic) when it has no directed cycle.
The feedback set problems remove vertices (Cslib.Complexity.Graph.deleteVerts) or arcs
(Cslib.Complexity.Graph.deleteArcs) so as to leave an acyclic graph. Removing vertices leaves an
acyclic graph exactly when every directed cycle passes through a removed vertex
(Cslib.Complexity.Graph.isDirAcyclic_deleteVerts_iff).
Through Relation.acyclic_iff_forall_nodup_not_cycle_chain, a graph is acyclic exactly when its
adjacency relation is Relation.Acyclic, and through Relation.acyclic_iff_exists_rank,
exactly when its declared vertices can be numbered below their number so that every arc increases
the number (Cslib.Complexity.Graph.isDirAcyclic_iff_exists_rank): a topological numbering. Such
numberings, listed along the vertex list, are the NP certificates of the feedback set problems
(Cslib.Complexity.mem_NP_of_colorOf).
Main definitions #
Cslib.Complexity.Graph.DirAdj,Cslib.Complexity.Graph.IsDirCycle,Cslib.Complexity.Graph.IsDirAcyclic.Cslib.Complexity.Graph.deleteVerts,Cslib.Complexity.Graph.deleteArcs.
Main results #
Cslib.Complexity.Graph.isDirCycle_iff: directed cycles as closed chains of the arc relation.Cslib.Complexity.Graph.isDirAcyclic_iff_acyclic: acyclicity of the adjacency relation.Cslib.Complexity.Graph.isDirAcyclic_iff_exists_rank,Cslib.Complexity.Graph.exists_rank_of_isDirAcyclic,Cslib.Complexity.Graph.isDirAcyclic_of_rank: acyclicity through topological numberings.Cslib.Complexity.Graph.isDirAcyclic_deleteVerts_iff: removed vertices meet every cycle.
References #
The arc relation of a directed graph: an arc (u, v) ∈ G.edges between declared vertices.
Instances For
G is acyclic: it has no directed cycle.
Instances For
Directed cycles are the nonempty lists without repetitions that are closed chains of the arc relation between declared vertices.
Acyclicity through walks: a graph is acyclic exactly when its adjacency relation is
acyclic (Relation.Acyclic), that is, when no vertex reaches itself by a nonempty walk along arcs
between declared vertices.
An acyclic graph has a topological numbering: its declared vertices get numbers below the number of distinct declared vertices, and every arc between declared vertices increases the number.
Feedback vertex sets meet every cycle: removing the vertices of R leaves an acyclic
graph exactly when every directed cycle passes through a vertex of R.