[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Need a graph layout that uses edge weights
From: |
Gabor Csardi |
Subject: |
Re: [igraph] Need a graph layout that uses edge weights |
Date: |
Tue, 12 Jun 2007 19:26:32 +0200 |
User-agent: |
Mutt/1.5.12-2006-07-14 |
Rick,
The Fruchterman-Reingold layout now has a parameter to provide edge
weights. Weights bigger than 1 result more "attraction" along the
edges, weights less than 1 do the opposite. (Maybe you can even do
negative weights which result repulsion. I've no idea whether this is
good for anything.) It seems to work well:
> g <- graph.ring(10)
> E(g)$weight <- 1:2
> E(g)$weight
[1] 1 2 1 2 1 2 1 2 1 2
> l <- layout.fruchterman.reingold(g, weights=E(g)$weight)
> plot(g, layout=l)
You can download a 0.5 C library or R source package from
http://cneurocvs.rmki.kfki.hu/igraph/download
G.
On Tue, Jun 05, 2007 at 02:29:31PM -0400, Rick Borovoy wrote:
> Hi,
>
>
>
> Can anyone help me find / make a layout algorithm that factors in edge
> weights? For example, in the case of a spring-type algorithm, the spring
> constants would be greater on larger-weighted edges.
>
>
>
> The real problem: I want to draw a network diagram where the nodes
> correspond to groups of people, and the link weights correspond to how
> many connections there are between two groups. It should get laid out so
> that groups that have the most connections between them are close to each
> other in the graph.
>
>
>
> As a work-around, I created a graph with n edges between a given pair of
> nodes, where n = the number of connections between the two groups. It did
> not produce the desired effect, however, when I laid it out using Spring,
> Fructerman-Rheingold, Kamanda.Kawai, etc.
>
>
>
> Any guidance would be much appreciated.
>
>
>
> Thanks,
>
> Rick Borovoy
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
--
Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK