|
From: Jim Langston on 12 Apr 2008 06:26 I have developed a type of linked list, but each entry can have multiple children and multiple parents. This data actually represents routers on the internet pointing to each other. For example, one RouterEntry may have 2 parents and 10 children (just guessing). My problem is I wish to draw this. Eventually it will be graphically, but right now I just have to figure out how to go through the data and build.. something. I already have the data structures and am able to add entries. I have a list (map) of Routers, and each Router contains pointers to parents and children. What do I need to google for to represent this data? How to step through it and biuld something graphically. -- Jim Langston tazmaster(a)rocketmail.com
From: Malcolm McLean on 12 Apr 2008 06:57 "Jim Langston" <tazmaster(a)rocketmail.com> wrote in message > > What do I need to google for to represent this data? How to step through > it and biuld something graphically. > Check out Lisp. Essentially a tree is just a series of nested parentheses ((fred, jim, bert) harry ((alf) joe ed)) is a simple example. If you write in Newick tree format, you can download a visual tool to display the data. There's a Newick format reader on my website. Writing is trivial onmce you have the tree in an internal structure. -- Free games and programming goodies. http://www.personal.leeds.ac.uk/~bgy1mm
From: Alex Fraser on 12 Apr 2008 06:58 Jim Langston wrote: > I have developed a type of linked list, but each entry can have multiple > children and multiple parents. This data actually represents routers on the > internet pointing to each other. Sounds like a graph. [snip] > What do I need to google for to represent this data? How to step through it > and biuld something graphically. Graph drawing algorithms. HTH, Alex
From: Richard Heathfield on 12 Apr 2008 07:21 Jim Langston said: > I have developed a type of linked list, but each entry can have multiple > children and multiple parents. Best to call it a graph, then, eh? > This data actually represents routers on > the internet pointing to each other. > > For example, one RouterEntry may have 2 parents and 10 children (just > guessing). My problem is I wish to draw this. man dot Let me give you an example: $cat jim.dot # sorry about the uninspiring router names digraph "G" { router1 -> router3; router2 -> router3; router1 -> router4; router2 -> router4; router1 -> router5; router2 -> router6; router3 -> router5; router4 -> router7; router5 -> router2; router6 -> router3; router7 -> router8; router8 -> router4; router4 -> router9; } $cat jim.dot | dot -Tps -o jim.ps $convert jim.ps jim.png (Some dots can output png directly - mine struggles to do that, because of font issues.) See the result at <http://www.cpax.org.uk/~rjh/jim.png> -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999
From: Willem on 12 Apr 2008 08:27 Malcolm wrote: ) ) "Jim Langston" <tazmaster(a)rocketmail.com> wrote in message )> )> What do I need to google for to represent this data? How to step through )> it and biuld something graphically. )> ) Check out Lisp. ) ) Essentially a tree is just a series of nested parentheses Except that the OP doesn't want a tree. Check the 'multiple parents' bit. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT
|
Next
|
Last
Pages: 1 2 Prev: Help me sort though some complex math Next: Traversa of heap structured search trees |