Ruby Graph Library -- add a single knode

Discussion in 'Ruby' started by Ralf Müller, Oct 5, 2004.

  1. Ralf Müller

    Ralf Müller Guest

    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
     
    Ralf Müller, Oct 5, 2004
    #1
    1. Advertising

  2. 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::DirectedAdjacencyGraph.new
    #<RGL::DirectedAdjacencyGraph: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
     
    Horst Duchene, Oct 6, 2004
    #2
    1. Advertising

  3. Ralf Müller

    Hal Fulton Guest

    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
     
    Hal Fulton, Oct 7, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Sakkis
    Replies:
    1
    Views:
    465
    Szabolcs Nagy
    Jan 29, 2007
  2. Dr Ann Huxtable

    Missing Graph.h and (Graph.lib) woes - any help

    Dr Ann Huxtable, Dec 21, 2004, in forum: C Programming
    Replies:
    6
    Views:
    661
    Dr Ann Huxtable
    Dec 21, 2004
  3. Jef Driesen
    Replies:
    3
    Views:
    2,565
    mlimber
    Jan 24, 2006
  4. Almoni
    Replies:
    0
    Views:
    3,117
    Almoni
    Jan 17, 2010
  5. Emilio Mayorga
    Replies:
    6
    Views:
    352
    Martien Verbruggen
    Oct 8, 2003
Loading...

Share This Page