Sha256: ef0cbb41639b728e338cafe7c4594b27c48c1f9ba6d6ac358abbe39a544f655a

Contents?: true

Size: 657 Bytes

Versions: 17

Compression:

Stored size: 657 Bytes

Contents

require 'rgl/graphxml'
require 'rgl/adjacency'
require 'rgl/dot'

include RGL
name, nnodes, nedges = '', '', ''

IO.foreach('north/Graph.log') { |line|
  if /name:\s*(.*)\sformat: graphml\s+nodes: (\d+)\s+edges: (\d+)/ =~ line
    name, nnodes, nedges = $1, $2.to_i, $3.to_i
  end

  if name && /directed: (.*)\s+acyclic: (.*)\s+.*connected: (.*)\s+biconnected: (.*)\s+/ =~ line
    directed, acyclic, connected, biconnected = $1, $2, $3, $4
    puts [name, nnodes, nedges].join('-|-')
    File.open('north/' + name + '.graphml') { |file|
      graph = DirectedAdjacencyGraph.from_graphxml(file)
      puts "#{graph.num_vertices} = #{nnodes}"
    }
  end
}

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rgl-0.6.6 examples/north2.rb
rgl-0.6.5 examples/north2.rb
rgl-0.6.4 examples/north2.rb
rgl-0.6.3 examples/north2.rb
rgl-0.6.2 examples/north2.rb
rgl-0.6.1 examples/north2.rb
rgl-0.6.0 examples/north2.rb
rgl-0.5.10 examples/north2.rb
rgl-0.5.9 examples/north2.rb
rgl-0.5.8 examples/north2.rb
rgl-0.5.7 examples/north2.rb
rgl-0.5.6 examples/north2.rb
rgl-0.5.4 examples/north2.rb
rgl-0.5.3 examples/north2.rb
rgl-0.5.2 examples/north2.rb
rgl-0.5.1 examples/north2.rb
rgl-0.5.0 examples/north2.rb