Questions tagged [ruby-rgl]

Ruby Graph Library (RGL) is a Ruby module for implementing graph algorithms.

Ruby Graph Library (RGL) is a Ruby module for implementing graph algorithms.

6 questions
2
votes
1 answer

why dot file is generated rather jpg file in Ruby Graph Library (RGL)?

I have written the following code. When I run this file graph.dot file is generated rather than graph.jpg. I can't understand why so. Does any body have any idea? My code is as: require 'rgl/adjacency' require 'rgl/dot'…
VenkatK
  • 1,295
  • 1
  • 9
  • 21
0
votes
1 answer

Efficiently Finding all paths between 2 nodes in a directed graph - RGL Gem

I am struggling to find 1 efficient algorithm which will give me all possible paths between 2 nodes in a directed graph. I found RGL gem, fastest so far in terms of calculations. I am able to find the shortest path using the Dijkstras Shortest Path…
Md. Farhan Memon
  • 6,055
  • 2
  • 11
  • 36
0
votes
1 answer

Can we convert graph into set in ruby

How to convert following graph into 'set'. Because i have one graph. i need to check that graph is subset of this graph. require 'rgl/adjacency' dg = RGL::DirectedAdjacencyGraph[1,2,3,4,5,6,3,2,4] thanks.
Guru
  • 1
  • 1
0
votes
1 answer

How to add vertices at run time in ruby by using Ruby Graph Library?

I used the following code to create a graph. How to +add vertices at the run time? require 'rgl/adjacency' dg = RGL::DirectedAdjacencyGraph[1,2,3,4,5,6,7] dg.edges
Guru
  • 1
  • 1
0
votes
1 answer

how to give dynamic input for RGL::DirectedAdjacencyGraph?

I am new to RGL. I want to show a graph of all parent and children type relations. I have written the following code. My code is as: require 'rgl/adjacency' require 'rgl/dot' input_arr = [1,2,2,3,2,4,4,5,6,4,1,6] We need to give input as…
VenkatK
  • 1,295
  • 1
  • 9
  • 21
0
votes
1 answer

Loading a DOT file using RGL

RGL supports writing DOT files from a graph, is it possible to create a graph from a DOT file? (Obviously I can parse the DOT file myself and create a graph, but I'm wondering if this functionality exists already).
oz10
  • 153,307
  • 27
  • 93
  • 128