igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Simple syntax questions


From: Jeff G
Subject: [igraph] Simple syntax questions
Date: Mon, 13 Apr 2009 14:42:08 -0400

Wondering if I could get an example.  :-)  I've been struggling to figure it out.
Similar to http://igraph.sourceforge.net/igraphbook/igraphbook-creating.html#id2569368 but in Python.

I'm use to NetworkX, which makes it pretty easy - g.add_edge() or g.add_node().
It seems igraph wants you to tell how many nodes you have before you can create an edge.  Is this correct?  I have no idea, I just want to say "x" is related to "y" and it creates two nodes and one edge.  I then want to say "y" is related to "z" and it creates a "z" node, and a new edge.  I also want to be able to say that x is "red", y is "blue" and in category "xyz".  I want to tell it that the label and color of the edge between "y" and "z" is "this" and "that".  I'm pulling from a database and I have a loop ready to go that says "x" (cat xyz, color blue) is related to "y" (cat abc, color red), next record, "y" is related to "z".   It all seems simple, but I can't figure out how to make it happen. 

Thanks, Jeff

reply via email to

[Prev in Thread] Current Thread [Next in Thread]