[SOLVED] Layout with variable node size

Algorithms and parameters to put data in space
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
User avatar
martin.pernollet
Posts:18
Joined:05 Oct 2010 12:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[SOLVED] Layout with variable node size

Post by martin.pernollet » 14 Jan 2011 16:53

Hi all,
I am wondering if some of you have some references (and hopefully a gephi implementations) of a layout algorithm able to deal with nodes of different and fixed size. The idea is to have something able to perform a kind of Fruchterman Reingold/Spring layout without any edge overlapping nodes.
When googling this question, I have found papers/ideas discussing how to avoid node overlapping, but it did not seemed to include edge overlapping nodes.
Regards,
Martin

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Layout with variable node size

Post by mbastian » 17 Jan 2011 03:50

Yes the Force Atlas algorithm can take node size in account, check out 'Adjust By size' parameter.

Check out also http://gephi.org/plugins/noverlap/ plugin, which does a great job on that!

For edge overlapping, it is a much more complex issue, though discussed quite a lot by scientists. Recently, NodeXL introduced a edge crossing readability metric, it's worth a look!

User avatar
martin.pernollet
Posts:18
Joined:05 Oct 2010 12:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Layout with variable node size

Post by martin.pernollet » 18 Jan 2011 05:34

Thanks! I'll read details on that! The first Google result about force atlas discuss the linlog algorithm that seems to have stronger mathematical foundations.

User avatar
jacomyma
Gephi Core Developer
Posts:61
Joined:09 Feb 2010 23:23
Contact:

Re: Layout with variable node size

Post by jacomyma » 18 Jan 2011 14:58

Oh yes, LinLog is better, more efficient, and more robust in a theoretical perspective than the forceAtlas (I'm its author).
Actually, forceAtlas is just our "homebrew" layout, and we adapted it to our needs. Because forceAtlas is "our thing" we implemented a way to avoid nodes overlap (we needed it). But of course it's possible to implement this feature in other layouts.

User avatar
martin.pernollet
Posts:18
Joined:05 Oct 2010 12:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Layout with variable node size

Post by martin.pernollet » 20 Jan 2011 22:02

OK, thanks for all your explanations!
Martin

User avatar
martin.pernollet
Posts:18
Joined:05 Oct 2010 12:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Layout with variable node size

Post by martin.pernollet » 16 Feb 2011 10:14

Hi again,

Since I was far away on holidays, I started to adapt -on a paper- the Fruchterman algorithm to consider node border instead of node center. When I've been back, I was eager to try it, and actually it worked quite well.

Then I tried Force Atlas and I found it is superior to any other layout provided in Gephi, considering its ability to avoid crossing edges (is it really a feature or was I lucky?), so I really want to throw my Fruchterman mutant through the window and I would like to see how Force Atlas deals with sized nodes.

I have seen in the source code that it works with NodeData, and that NodeData provides size. How can I set up this size in the Gephi application? Is there any GraphML metadata that is recognized by Gephi?

Regards,

Martin

User avatar
martin.pernollet
Posts:18
Joined:05 Oct 2010 12:42
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Layout with variable node size

Post by martin.pernollet » 17 Feb 2011 01:05

Hi again,
I finally solved the point using the Gephi toolkit, which worked in the minute. For those interested, first build your model this way:

Code: Select all

GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getModel();
Node n = gm.factory().newNode("name");
n.getNodeData().setSize(size);
And then retrieve the result graph view as follow:

Code: Select all

PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
GraphSheet graphSheet = controller.getGraphSheet();
Graph viewGraph = graphSheet.getGraph();
for(org.gephi.preview.api.Node n: viewGraph.getNodes()){
  Point p = n.getPosition();
  float radius = n.getRadius();
}
Your toolkit is both very powerfull and very easy to use guys, congratulation for your work!

Regards,
Martin

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable