module RGL::MutableGraph

def cycles

Returns:
  • (Array) - of all minimum cycles in a graph
def cycles
  g = self.clone
  self.inject([]) do |acc, v|
    acc = acc.concat(g.cycles_with_vertex(v))
    g.remove_vertex(v); acc
  end
end