igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Edge betweenness


From: Tamas Nepusz
Subject: Re: [igraph] Edge betweenness
Date: Mon, 21 Apr 2008 17:17:20 +0200

Hi Sylvain,

If you could afford calling a _Python_ program instead of a C one, then install the Python interface of the igraph library. This uses the C core of igraph, but makes it accessible from Python. Computing all geodesics in Python is only a few lines:

import igraph
g = igraph.load("my-graph.graphml") # or any other format supported by igraph
for i in range(g.vcount()):
print g.get_all_shortest_paths(i) # note that these are _unweighted_ shortest paths

The same for node betweennesses and closenesses:

import igraph
g = igraph.load("my-graph.graphml") # or any other format supported by igraph
print g.closeness()
print g.betweenness()

If you really want to stick to C, let me know and I'll try to figure out something.

I also remember that Gabor has started to write something like a shell interface to igraph (practically a bunch of command line utilities that allow you to call igraph functions directly from the command line), but I don't know whether it's working now or not.

--
Tamas


On 2008.04.21., at 17:00, Sylvain Brohée wrote:

Dear all,

Since a few months, I have developed a quite powerful tool in Perl doing
efficiently very simple graph analysis (node degree, graph
intersection, ...). This is called NeAT (http://rsat.scmbb.ulb.ac.be/neat/ )
and is publicly available.

However, in some cases, I am very limited by Perl.

It is for example the case, when I want to compute the betweenness and the closeness of the nodes in a graph as for this, I need to compute all geodesic paths. So, I would like to create a small C executable based on the igraph
library that would be called by my Perl program.

Unfortunately, I am complete newbie in C / C++ and I do not know how to start
with.

Could you give some advices?

I want only to load a (directed weighted) graph, calculate the closeness and
the betweenness for each node and to display the output.

I would be very thankful if you could help me,

Sylvain (desperate biologist)


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help





reply via email to

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