igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] network layout 'grouping' by vertex attribute


From: Tamás Nepusz
Subject: Re: [igraph] network layout 'grouping' by vertex attribute
Date: Thu, 29 Aug 2013 12:22:37 +0200

> Maybe some has faced the following situation: vertices in a  network have an 
> attribute (think of - for example - a sport they play frequently), which has 
> a role in how they are related (within-attribute edges are more frequent and 
> stronger than outside-attribute).  Would it be possible to layout the network 
> in a way that graphically 'groups' the attributes (sport teams) and then 
> still shows the vertices and their edges in a sensible way?
You can probably use the weighted Fruchterman-Reingold layout in igraph. Set up 
the edge weights such that edges within a group have significantly larger 
weight than edges between groups, and then run the layout algorithm. That 
should do the trick. In case the layout algorithm is not able to figure out an 
appropriate layout on its own, you can "help" it by providing it with a seed 
layout where the nodes in the different groups are already separated to some 
extent. For instance, if you have k groups, then choose k points along the 
circumference of a circle with a sufficiently large radius, and place the nodes 
in group i around point i, adding some random noise to avoid nodes ending up at 
exactly the same position. Then pass this seed layout to the weighted 
Fruchterman-Reingold layout with appropriate weights.

All the best,
-- 
T.




reply via email to

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