4

I have the location of the nodes in 2d data file which is written by my program

x0 = 0.12
y0 = 0.22
x1 = 0.12
y2 = 0.22 ..... 18 records for 9 node locations

I also have an adjacency matrix in data file which is written by my program

G00 = 1
G10 = 1
G70 = 0 ........81 records for 9 node locations

Can you guys help me plot those network nodes with connections to adjacent nodes?

Thanks a lot for looking into this.

Naga
  • 65
  • 1
  • 8
  • 2
    As @Nick indicates, yes we can help, but not many of us will do it for you. – High Performance Mark Mar 16 '12 at 09:39
  • I need some guidance on how to approach this. I really don't have any expertise in this area and would really appreciate any suggestion. – Naga Mar 16 '12 at 09:42
  • You need to specify more things. E.g. how does your adjacency matrix look like. Also could you maybe write another format. Gnuplot is easier if you have something like: `node0 x0 y0\n node1 x1 y1` where `x0,y0,x1,y1` represent the respective values – Azrael3000 Mar 16 '12 at 09:51
  • @Azrael3000 Adjacency matrix I have is also data file of 0's and 1's Gij is 1 if its a neighbor. And yes I can output with with format you specified. – Naga Mar 16 '12 at 09:53

1 Answers1

6

One of the most common ways is to use Graphviz. You'll just have to convert your adjacency matrix into a Graphviz script, which is straightforward.

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
  • I just installed Graphviz on my mac. Is there a easy quick start guide for this? That would be great to keep me started. – Naga Mar 16 '12 at 10:28
  • Check out the examples in the gallery. If you click on them. You will see the required code. Use one that resembles what you would like to achieve and modify it accordingly. – Azrael3000 Mar 16 '12 at 10:30
  • Check out the [Gallery](http://www.graphviz.org/Gallery.php) to see what kind of code you need (Click on the picture to view the .gv file). Graphviz scripts are easy to read. Edit: seems like I fortuitously wrote exactly the same reply as Azrael3000 :) – Franck Dernoncourt Mar 16 '12 at 10:31
  • @Azrael3000 Im kinda of confused right now :( my nodes are just points in 2d co-ordinate system like (0.2,0.3), (05.05).... – Naga Mar 16 '12 at 10:34
  • See this code: http://www.graphviz.org/Gallery/directed/fsm.gv.txt You don't specify coordinates, but links. – Franck Dernoncourt Mar 16 '12 at 10:35
  • @FranckDernoncourt coordinates are importnat information for my research. Is there anyway i can capture that information with Graphviz?? – Naga Mar 16 '12 at 10:43
  • http://stackoverflow.com/questions/5343899/how-to-force-node-position-x-and-y-in-graphviz – Franck Dernoncourt Mar 16 '12 at 10:52