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 following to generate graph.
dg=RGL::DirectedAdjacencyGraph[1,2,2,3,2,4,4,5,6,4,1,6]
dg.write_to_graphic_file('jpg')
But I want to give the array dynamically, ie I want to pass input_arr. But it is not working. can anybody explain how to go?