igraph-help
[Top][All Lists]

## Re: [igraph] creating a x-y graph using plot() in python??

 From: Tamas Nepusz Subject: Re: [igraph] creating a x-y graph using plot() in python?? Date: Mon, 03 Jan 2011 10:10:41 +0100 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7

```ok, I guess I asked the wrong question.

```
1)How should I draw a normal graph having x-axis and y-axis using pyhton igraph. I have attached one graph, please see that.
As I said, igraph does not draw "graphs" as in "charts", igraph draws "graphs" as in "2D drawings of abstract mathematical objects consisting of nodes connected by links". If you want to draw charts, you need another package for that in Pytho; e.g., Matplotlib (http://matplotlib.sf.net). You can calculate the *points* of the chart by igraph (if you want to plot something graph-related), but you need Matplotlib to draw the chart.
```
```
2)If I want a list of the number of link-cuts in my graph, which function should I use.
There is no function for that in igraph, especially because that number can be huge. For instance, consider a graph that consists of 2 100-cliques, connected by two edges. Those two connected edges form a minimum cut, hence every cut that includes those two edges will also be a cut. You would have at least 2^(100*99) minimum cuts in that graph.
```
```
Also, what functions should I use to find the size of the largest component in my graph\
Find the connected components using the .clusters() method. This returns a VertexClustering object, and you can use its sizes() method to find the sizes of all the clusters. If g is your graph, then it is g.clusters().sizes().
```
```
```, or to find the average geodesic length.
```
g.average_path_length(): http://packages.python.org/python-igraph/igraph.GraphBase-class.html#average_path_length
3)I have a txt file with some 10,000 nodes and I used the summary function on it, but it seems to take a lot of time to give the results.(In fact, it is still executing after an hour). Is there any other method so that I can get my results quickly. ( The methos works well for small files)
The summary() function calculates the diameter of the graph (among other properties), which may of course take time for larger graphs. If you need only some of the information returned by summary() but not the diameter, you can call other igraph methods to find out what you want. E.g., g.vcount() gives the number of vertices, g.ecount() gives the number of edges, g.maxdegree() gives the maximum degree etc.
```
--
T.

```