def walk_graph(bitmap, graph)
      index    = Array.new(graph.size, nil)
      traversed = Set.new

      graph.nodes do |node|
        next if traversed.include?(node)
        traverse(node, traversed, index, [], bitmap, graph)
      end
    end
def walk_graph(bitmap, graph)
      index    = Array.new(graph.size, nil)
      traversed = Set.new

      graph.nodes do |node|
        next if traversed.include?(node)
        traverse(node, traversed, index, [], bitmap, graph)
      end
    end
traverse a directed graph
 each entry in 'bitmap' corresponds to a graph node
 after the traversal, the bitmap for each node will be the union of its
 original value, and ALL the values for all the nodes which are reachable
 from it