|
From: Tom H. <tur...@gm...> - 2005-07-26 10:55:32
|
Great, I'll definitely add it to the Network generators.
-Tom
On 7/26/05, Bj=F6rn Lijnema <li...@gm...> wrote:
> Hello again,
>=20
> I cleaned the code up a little bit, and added a catch for catching
> null parameters (for the classes). Unless someone points out an
> obvious flaw I'll consider it finished, and probably won't be touching
> the code anymore.
>=20
> If you (repast developers) want to add it to Repast, feel free to use
> it. If you add it, you might want to add the following code to the
> NetworkFactory class:
>=20
> /**
> *
> * Creates a Barabasi-Albert network by initially connecting a gi=
ven
> number of nodes to each other, and then
> * incrementally connecting the other nodes. Each new node is
> connected with a preference towards well-connected
> * nodes.
> *
> * @param size The number of nodes in the network
> * @param numContacts The number of connections each node should =
make
> to other nodes
> * @param numInitialNodes The number of nodes initially in the ne=
twork
> * @param node The node class
> * @param edge The edge class
> * @return A List of connected nodes
> */
> public static List createBarabasiAlbertNetwork(int size, int
> numContacts, int numInitialNodes, Class node,
> Class edge) {
> BarabasiAlbertNet net =3D new BarabasiAlbertNet(size, num=
Contacts,
> numInitialNodes, node, edge);
> List list =3D null;
> try {
> list =3D net.createBarabasiAlbertNet();
> } catch (IllegalAccessException ex) {
> SimUtilities.showError("Error creating ScaleFreeN=
et", ex);
> System.exit(0);
> } catch (InstantiationException ex) {
> SimUtilities.showError("Error creating ScaleFreeN=
et", ex);
> System.exit(0);
> }
>=20
> return list;
> }
>=20
>=20
>=20
> Bj=F6rn Lijnema
>=20
>=20
> On 7/25/05, Laszlo Gulyas <lg...@ai...> wrote:
> > Hi,
> >
> > Back in 2001 I was in e-mail correspondence with Prof. Barabasi, and
> > asked the same question. His answer was that they were always using
> > a fully connected initial network, even though 'it should work' with
> > other configurations, too.
> >
> > I hope this helps,
> >
> > -- g
> > --
> > Gulyas Laszlo | Laszlo Gulyas
> > kut.ig. | dir. of research
> > AITIA Rt. | AITIA Inc.
> >
> > <quote who=3D"Bj=F6rn Lijnema">
> > > Hello everyone,
> > >
> > > I managed to find some time to write the Barabasi-Albert network
> > > generator I mentioned on this list a few weeks back. (Actually I
> > > called it a scale free network generator, but Laszlo Gulyas pointed
> > > out my error). I'm afraid it was a bit of a rush job, but I think it
> > > should work correctly.
> > >
> > > There is one issue though, in Emergence of Scaling in Random Network=
s
> > > Barabasi and Albert say that the network can have a small number of
> > > initial vertices, however they do not mention anything about
> > > connecting those initial vertices to each other.
> > >
> > > This would mean, with their formula (the probability formula of the
> > > probability for a new vertex being connected to an existing vertex i
> > > being the number of i's edges divided by the total number of edges)
> > > that you will get unconnected vertices if the number of initial
> > > vertices is not equal to the number of edges each vertex has.
> > >
> > > Of the initial vertices, those that do not have a connection after th=
e
> > > first new vertex has been connected, will never get one since the
> > > probability that a new vertex will connect to them is always zero.
> > >
> > > I chose to just connect all initial nodes to each other, mainly
> > > because I really didn't know what to do. I noticed that JUNG
> > > (jung.sf.net) chose another way to go, by changing p =3D degree(v) / =
|E|
> > > to p =3D (degree(v) + 1) / (|E| + |V|)
> > >
> > >
> > > If someone could look over my code and point out/correct any errors
> > > I've made, and make suggestions for the initial nodes problem, I woul=
d
> > > be most thankful.
> > >
> > >
> > > Bj=F6rn Lijnema
> > >
> >
> >
> >
>=20
>=20
>
|