Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby Graph Library -- add a single knode

Reply
Thread Tools

Ruby Graph Library -- add a single knode

 
 
Ralf Müller
Guest
Posts: n/a
 
      10-05-2004
Moin Moin,
i'm usung the Ruby Graph Library (rgl.sourceforge.net) to scan function
libraries. If function A is used in function B, i add an edge to the
Graph from B to A.
To indicate, that a function isn't used in any other function, i would
just like to add a single knode without any edge.
I tried 'add_vertex' but no vertices are shown by dotty.

Anybody, who can enlight me ?

Thanks
ralf

 
Reply With Quote
 
 
 
 
Horst Duchene
Guest
Posts: n/a
 
      10-06-2004
Ralf Müller wrote:

> Moin Moin,
> i'm usung the Ruby Graph Library (rgl.sourceforge.net) to scan function
> libraries. If function A is used in function B, i add an edge to the
> Graph from B to A.
> To indicate, that a function isn't used in any other function, i would
> just like to add a single knode without any edge.
> I tried 'add_vertex' but no vertices are shown by dotty.
>
> Anybody, who can enlight me ?
>


This is a bug in rgl/dot.rb. If you use the latest CVS-Version (1.4), you
should see isolated nodes. See this sample irb session:

irb(main):001:0> require 'rgl/dot'
irb(main):002:0> require 'rgl/adjacency'
irb(main):003:0> dg = RGL:irectedAdjacencyGraph.new
#<RGL:irectedAdjacencyGraph:0x402de28c @vertice_dict={},
@edgelist_class=Set>
irb(main):004:0> dg.add_vertex 1
#<Set:0x402d9d54 @store={}>

irb(main):072:0> dg.print_dotted_on
digraph RGL__DirectedAdjacencyGraph {
label = "RGL__DirectedAdjacencyGraph"
"1" [
fontsize = 8,
label = "1"
]

}

# You see the isolated vertex in DOT formatted output. Therefore dotty
should display it also:

irb(main):073:0> dg.dotty

Cheers
Horst
 
Reply With Quote
 
 
 
 
Hal Fulton
Guest
Posts: n/a
 
      10-07-2004
Ralf Mu"ller wrote:
> Moin Moin,
> i'm usung the Ruby Graph Library (rgl.sourceforge.net) to scan function
> libraries. If function A is used in function B, i add an edge to the
> Graph from B to A.
> To indicate, that a function isn't used in any other function, i would
> just like to add a single knode without any edge.
> I tried 'add_vertex' but no vertices are shown by dotty.


I don't know that lib and so can't help you...

But I'm very interesting in this project of yours. I have a few thousand
lines of spaghetti code that I'd like to untangle by discovering all the
relationships.

Is this something you're going to release?


Hal



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Boost Graph Library to create very large graph Almoni C++ 0 01-17-2010 05:13 AM
knode and "Re:" (killing GG) wisdomkiller & pain Computer Support 2 07-27-2007 09:46 AM
Help with initialization of graph (Boost Graph Library) Jef Driesen C++ 3 01-24-2006 01:44 PM
How to open FF in new window from Knode Al. C Firefox 0 02-14-2005 01:14 AM
GD::Graph: "mixed" graph doesn't recognize "area" graph type Emilio Mayorga Perl Misc 6 10-08-2003 02:14 AM



Advertisments