RGL provides easy manipulation of graph: require 'rgl/adjacency' g = RGL::DirectedAdjacencyGraph.new IO.foreach(ARGV.shift) {|line| if line =~ /\s*([^\"]+)[\"\s]*->[\"\s]*([^\"\[\;]+)/ g.add_edge $1, $2 end } p "vertices: #{g.num_vertices}…
Quote saved.
Login to quote this blog
Failed to save quote. Please try again later.
You cannot quote because this article is private.