Closed nicolaspayette closed 6 years ago
In discussion with Bill Rand, the idea of simply adding a generate-preferential-attachment-with-min-degree
came up: the only difference would be an additional min-degree
parameter that would correspond to numEdgeToAttach
in Jung or k in the original algorithm.
yes, that's all that is necessary - how many edges to add with each node (min-degree). The only trick is that you have to create a complete (all nodes connect to all other nodes) graph with min-degree nodes before adding the individual nodes. But it's not a hard thing to code for a user (onne they have worked out the joys of the rnd:weighted-n-of syntax), though I guess having it built in would make it quicker.
A fixed degree generator would also be useful.
Fixed by e8741ba8dbaa2774cc27370941f30bf78579d655!
Currently, the
nw:generate-preferential-attachment-primitive
uses a fixed value of 1 for thenumEdgesToAttach
parameters and automatically runs the algorithm for a number of iterations equals to the specified desired number of vertices.Maybe we could have, in addition to that simplified way of doing things, other primitives for sophisticated users:
nw:barabasi-albert-init
with number of initial vertices and number of edges to attachnw:barabasi-albert-step
to iterate the algorithmThis would require to keep track of which vertices where created by the current instance of the algorithm. It is doable, but not trivial.