graph :: Digraph :: has_circuit
vertices
is a circuit of this digraph.var g = new HashDigraph[Int]
g.add_arc(1, 2)
g.add_arc(2, 3)
g.add_arc(3, 1)
assert g.has_circuit([1,2,3,1])
assert not g.has_circuit([1,3,2,1])
# Returns true if and only if `vertices` is a circuit of this digraph.
#
# ~~~
# var g = new HashDigraph[Int]
# g.add_arc(1, 2)
# g.add_arc(2, 3)
# g.add_arc(3, 1)
# assert g.has_circuit([1,2,3,1])
# assert not g.has_circuit([1,3,2,1])
# ~~~
fun has_circuit(vertices: SequenceRead[V]): Bool
do
return vertices.is_empty or (has_path(vertices) and vertices.first == vertices.last)
end
lib/graph/digraph.nit:446,2--459,4