igraph-help
[Top][All Lists]

## Re: [igraph] Real Network Analysis

 From: Tamas Nepusz Subject: Re: [igraph] Real Network Analysis Date: Fri, 19 Jun 2009 18:31:38 +0100

(f) I resorted to the R bindings of the igraph library, but can I perform the same tasks with the Python bindings?
I guess it's a little bit complicated with "pure" Python as Python is not a full-fledged statistics software, so it lacks some functions like the power law fitting. However, you can do what you want using a combination of igraph, Scientific Python (SciPy, for calculations) and matplotlib (for plotting). That's what I use.
```
```
(g) Approximately, what is the penalty in using the R/Python bindings rather than the C library directly? A factor 2 or three is not big deal, but one order of magnitude would be.
There shouldn't be an order of magnitude difference between the two as both the R and the Python bindings just convert the input arguments back to C, call the appropriate function in igraph's C core and then convert the result back. So the only overhead is the conversion back and forth between the host language and C. The conversions usually involve constants (which are converted in O(1)) and vectors of numbers (converted in O(n) where n is the number of elements in the vector), so there shouldn't be a significant overhead. I agree with Gabor that in general I wouldn't expect more than a factor of 2. By the way, a common catch is when one tries to calculate all the shortest path lengths of a large graph in igraph using the IPython frontend in interactive mode -- in that case, igraph does its job fairly quickly, but then IPython struggles to _format_ the result (which is a huge list of lists) to be printed on the standard output.
```
--
Tamas

```