[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] Re: [statnet_help] Re: gplot.layout with valued edges
From: |
Alexander |
Subject: |
[igraph] Re: [statnet_help] Re: gplot.layout with valued edges |
Date: |
Mon, 16 Mar 2009 20:34:59 -0400 |
Thanks for the reply, and thanks also for igraph!
I mix igraph and network/sna exactly as you say - I've found that
igraph is faster than network, but then there are some functions in
sna that I need - like brokerage.
I was looking over the python interface documentation and I noticed
the function shortest_paths_dijkstra.
I would like to be able to calculate these two measures on my graphs:
Newman's measure of betweeness centrality for scientific collaborations [1]
Fowler's adaptation of this measure to directed networks (of
cosponsorship in the US Congress) [2]
Judging from the arguments that shortest_path_dijkstra takes Newman's
measure should be:
shortest_paths_dijkstra(vertices,weights,mode=all)
where the weights are 1/sum of papers between the authors (in my case
it's just the weight of the edge as calculated by count.multiple(g),
then simplify(g) on a graph made from the edgelist with all (ie
multiple) ties between the nodes.
and in the case of Fowler's adaptation it is:
shortest_paths_dijkstra(vertices,weights, mode=in)
where the weights are the same as above, and the direction of the tie
is from alter to ego.
I've included links to the papers:
[1] http://www.cam.cornell.edu/~ariel/scientific_ideas/scient_coll2.pdf
[2] http://jhfowler.ucdavis.edu/legislative_cosponsorship_networks.pdf
or http://jhfowler.ucsd.edu/best_connected_congressperson.pdf
Best,
Alexander
On 3/16/09, Gábor Csárdi <address@hidden> wrote:
> Alexander,
>
> the 'weight' argument was added to igraph after porting the function
> from SNA. It was not present in the original SNA implementation. But
> you can easily convert networks between igraph and sna, so you can use
> the best of both packages. See the graph.adjacency() and the
> get.adjacency() functions in igraph.
>
> Best,
> Gabor
>
> On Mon, Mar 16, 2009 at 8:52 PM, Alexander <address@hidden> wrote:
>> Some follow-up information:
>>
>> The igraph package implements a version of the fruchterman-reingold
>> layout which takes a weights argument that "multiplies the attraction
>> along the edges". I tried this on a small graph and it seems to do
>> what I want. My question now is if there is corresponding argument in
>> the sna implementation? The igraph layout "is ported from sna"
>> according to the man page [1].
>>
>> Best regards,
>>
>> Alexander Jerneck
>>
>> [1] http://igraph.sourceforge.net/doc/R/layout.html
>>
>> On 3/16/09, Alexander <address@hidden> wrote:
>>> Hi,
>>>
>>> First of all, thanks for creating sna and network.
>>>
>>> I have a question about representing two different networks with these
>>> properties:
>>>
>>> 100/450 nodes
>>> 5000-10000 ties
>>> each tie has a value, 'weight', which represents the number of tie
>>> actions between the nodes.
>>> ties are directed.
>>> nodes belong to two different groups.
>>>
>>> I want to plot these networks using a layout that puts nodes closer to
>>> each other the higher the tie value ('weight') between them is. I'll
>>> just use vertex.col for identifying the groups. I thought of using
>>> edge.lwd for the tie value, but there are so many ties that the lines
>>> become indistinguishable.
>>>
>>> From reading ?gplot.layout I gather that I should use the 'mds' or
>>> 'princoord', or maybe 'eigen' layouts because they can be based on a
>>> matrix other than the dichomous adjacency matrix - I guess I want
>>> layout.par$vm=as.sociomatrix(g,'weight'),
>>> but how do I go from here? - how do I figure out what distance
>>> function to use for example?
>>>
>>> Best regards,
>>>
>>> Alexander Jerneck
>>>
>>> Department of Sociology, University of Pennsylvania.
>>>
>> _______________________________________________
>> statnet_help mailing list
>> address@hidden
>> http://mailman2.u.washington.edu/mailman/listinfo/statnet_help
>>
>
>
>
> --
> Gabor Csardi <address@hidden> UNIL DGM
>
- [igraph] Re: [statnet_help] Re: gplot.layout with valued edges,
Alexander <=