unable to create barabasi albert preferential attachment model

49 views
Skip to first unread message

Srirama Bhamidipati

unread,
Nov 30, 2014, 4:05:17 AM11/30/14
to gama-p...@googlegroups.com
Hi,

Q1. 
I am trying to build a nice "barabasi albert preferential attachment model" . I have looked at examples on classic graph loading, but they did not help me much, especially the layout_types and layout_time. I want to create a nice cluster around preferred nodes, more like a hub and spoke model; please see something like it here 

I admit I have to look more into theories of building networks, but that is not my focus. A scale free network is just a start input of my model and I was hoping there is some operator in GAMA.

Q2. 
If i find some java libraries that can generate some hub-spoke graphs, how can i bring them into GAMA to create my networks?

thanks in advance,
Srirama

Srirama Bhamidipati

unread,
Nov 30, 2014, 4:07:50 AM11/30/14
to gama-p...@googlegroups.com
Well, I understand, that gama creates hub-spoke scale free network, but it is just not clearly visible. :(

Philippe Caillou

unread,
Nov 30, 2014, 6:14:01 AM11/30/14
to gama-p...@googlegroups.com
Hi,

If by "not clearly visible" you mean "it doesn't look nice like on my example picture", you may have a solution with the  SVN Gama version. There is a graph layout plugin "simtools.graphanalysis.fr" adding two operators for graph layouts.
You can find an example in the experimental models (I attach the file and an example result).

Philippe 

2014-11-30 10:07 GMT+01:00 Srirama Bhamidipati <b.sr...@gmail.com>:
Well, I understand, that gama creates hub-spoke scale free network, but it is just not clearly visible. :(

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

loadgraph - CdevGAMAWPs161WP8graphtestmodelsClassic Graph Layout.gaml.jpg
Classic Graph Layout.gaml

Patrick Taillandier

unread,
Nov 30, 2014, 1:43:29 PM11/30/14
to gama-p...@googlegroups.com
Hi Philippe,

If your plug-in is compatible with GAMA 1.6.1, I think it can be a good idea to add it on a update site to give the possibility to GAMA 1.6.1 release version users to use it.

Cheers,

Patrick

Srirama Bhamidipati

unread,
Dec 1, 2014, 12:48:56 AM12/1/14
to gama-p...@googlegroups.com
Thank you Phillippe. I will work on your suggestion. 

Yes Patrick, it would be nice if I am able to update it without svn. Please could you let me know if this is done?

Thank you Phillippe,
Srirama

Srirama Bhamidipati

unread,
Jan 8, 2015, 5:18:13 AM1/8/15
to gama-p...@googlegroups.com
Hi Philippe and Patrick,

I am using the plugin as suggested above. However, with that plugin, it seems that the experiment cannot be reproduced (with a seed value). That is, Everytime I run a barabasi with the Yifan Hu algorithm, the resulting network is different. So I checked only barabasi without Yifan Hu algorithm and it seems to respect the seed value. If the seed value remains the same, I was expecting the force-directed graph to be the same again and again.. 
Could you please confirm, how to rectify this.

Secondly, I want that the network is realigned (force-directed) when model is initialized, so I changed the code suggested by Philippe by replacing the reflex into a loop and moving the whole block into init section of global. Is this the correct way to do it?

regards,
Srirama

Patrick Taillandier

unread,
Jan 8, 2015, 6:47:17 AM1/8/15
to gama-p...@googlegroups.com
Hi,

For the first question, you should add an issue. We have maybe forgot to set the seed of the graph generator with the seed with the current simulation seed.

For the second question, I think so, but I am not sure ... Philippe will help you more on this.

Cheers,

Patrick

--

Srirama Bhamidipati

unread,
Jan 8, 2015, 7:10:21 AM1/8/15
to gama-p...@googlegroups.com
Oki.

By the way, when force-directed, the graph goes beyond the defined world box. This you can see also in the screenshot above in Philippe's response. 
I will add an issue for case 1.

thanks
Srirama

Philippe Caillou

unread,
Jan 8, 2015, 7:50:02 AM1/8/15
to laurent.tocqueville via GAMA
Hi,

For the second question, yes you can make a loop in the init.
If the graph is big, it may however be slow. If you need it, I can add a parameter to set a number of times the layout algorithm is applied for the statement (it would be much faster than a loop, since the conversion gephi graph - gama graph would be done only once).

For the bounded box, if you don't want to go outside the environment, you can either change the layout algorithm parameters, or use the "bounded" versions (they will how ever just set the nodes at the nearest point inside the box after the layout is applied, so it is not a "scaled" version).

Tell me if it is not clear,

Philippe

--

Srirama Bhamidipati

unread,
Jan 8, 2015, 9:54:14 AM1/8/15
to gama-p...@googlegroups.com
Hi Philippe, 

Yes, it would be nice if there is a parameter for "number of times" :):) . For my idea is, this layout algorithm is more useful if it works to initialize a network. In my case, I like the network layed-out and then I do simulation on this layed-out network; that is why I wanted to use it in the init with a loop. I have added an issue.

Additional extra query
Also if the algorithm can return and compare what parameters were achieved against what was set in the initialization. So if there is a number of iterations, may be the parameters cannot be achieved ? Atleast an idea on this would be useful.

Thank you again
Srirama

Philippe Caillou

unread,
Jan 8, 2015, 10:15:33 AM1/8/15
to gama-p...@googlegroups.com
Hi,

Ok i will add the parameter to the statement (or an other statement...)
I don't understand the second request. What do you want to compare? Parameters are given to the algorithms and used to compute the layout, what is "achieved"? The optimal distance? I will look into it but I am not sure there is a feedback on this (for example for Force Atlas 2 algorithm, there is no optimal distance as parameter).

Philippe

--

Srirama Bhamidipati

unread,
Jan 8, 2015, 11:01:19 AM1/8/15
to gama-p...@googlegroups.com
Hi,

I mean, as of now, I let the layout algorithm run till it achieves a layout that no longer changes, lets call this best fit layout (just for namesake). Now if you introduce the 'iterations' parameter, may be the algorithm does not come to its best fit layout? So, I was wondering if this difference can be captured. 

But please ignore this request, I would like a parameter for iterations for my reason of laying out a network before starting the simulation.

regards,
Srirama
Reply all
Reply to author
Forward
0 new messages