# File lib/kwala/lib/cycle_detector.rb, line 335 def print_cycle_path(path) # Group up the adjacent items into pairs path[0..-2].zip(path[1..-1]) do |head, tail| vkey = "#{head},#{tail}" # Only print the unvisited nodes if !@visited.key?(vkey) puts " \"#{ head }\" -> \"#{ tail }\";" @visited[vkey] = true end end end