igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Re: working with weighted networks (from pajek .net)


From: Martin Tomko
Subject: Re: [igraph] Re: working with weighted networks (from pajek .net)
Date: Thu, 02 Sep 2010 11:25:59 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3

Thank you Gabor,
that helps heaps.
One last question - I guess the answer must be trivial. Once I get a path (get.shortest.paths(...)) between two vertices in a weighted graph, I would like to know the length of this path (similar to a vlaue I would get if I counted them all using shortes.paths(..., algorithm="dijkstra")). I only get a list of visited vertices, as documented.

Is there a way to get this value?
And is there a way to dientify edges based on input vertices? I read through the documentation and can not find the answer.

Thanks
Martin

On 9/2/2010 11:11 AM, Gábor Csárdi wrote:
On Thu, Sep 2, 2010 at 11:07 AM, Martin Tomko<address@hidden>  wrote:
Thank you guys, that solved my problem.
I suspected that $weight should work, but simple listing of an edge did not
reveal the attribute. Need to find out how to get the full information about
the object...
You mean printing everything on the screen? Attributes are not printed
by default, but you can print them by giving extra arguments to the
print.igraph() function. You can also make printing them the default:

igraph.par("print.edge.attributes", TRUE)
igraph.par("print.graph.attributes", TRUE)
igraph.par("print.vertex.attributes", TRUE)

Best,
Gabor

Cheers
Martin

On 9/2/2010 10:52 AM, Tamas Nepusz wrote:
Sorry, got it working with weights, the appraoch mentionned worked, but
what confused me is that there is no access to a g$weights vector. I am
still not sure how to get the information for any individual edge.

E(g)[edgeindex]$weight seems to work for me in igraph 0.5.3. The only
thing to watch out for is that edges are indexed from zero, not 1, so
E(g)[1]$weight gives the weight of the second edge.











reply via email to

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