[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Error with betweenness() for weighted graph
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Error with betweenness() for weighted graph |
Date: |
Fri, 15 Feb 2013 21:31:30 +0100 |
Oh, I forgot to mention: the workaround for the time being is to calculate the
betweenness score for all the vertices and then extract the value corresponding
to "a" from the result vector:
scores = g.betweenness(weights="weight")
print scores[g.vs.find("a").index]
This won't take longer than calculating the betweenness for "a" only because
the betweenness calculation needs to find all the shortest paths in the graph
even if you want the betwenness of a single node only.
--
T.
On 8 Feb 2013, at 16:29, Manisha <address@hidden> wrote:
> Hello friends,
>
> This is the first time I am using Igraph and I am trying to get some
> information on a weighted graph using the functions available. I want
> to get the betweenness centrality for a node in the graph by passing
> node names as parameter. Here is my graph
>
>>>> g=ig.Graph()
>>>> g.add_vertices(['a','b','c','d'])
>>>> g.add_edge('a','b',weight=0.2)
>>>> g.add_edge('b','c',weight=0.2)
>>>> g.add_edge('c','d',weight=0.5)
>>>> g.add_edge('b','d',weight=0.1)
>
> It works well if I test on unweighted graph i.e.
>>>> g.betweenness('a')
>
> But when I try to execute the same function selecting the weight
> attribute on edge
>
>>>> g.betweenness('a', weights='weight')
>
> It gives some kind of error and blocks my python interpreter. Below is
> the message it is showing
>
> *** glibc detected *** python: corrupted double-linked list:
> 0x000000001a6c8b10 ***
>
> Can anybody understand this and please help me understand what's wrong
> and correct it?
> I will be really thankful for any help.
>
>
> Regards,
> Manisha
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help