Skip to content

Conversation

@tomatitito
Copy link

This adds a function to generate small-world graphs as proposed by Barabasi and Albert (1999), also know as preferential attachment graphs or power law graphs, as well as some tests. Please let me know, if you see any problems with the code.

hpcjkour added 26 commits April 19, 2018 14:23
Instead of degree, which then had to be divided by two. That required
making sure we have an even number, which now is not neccessary anymore.
The function takes the number of nodes, a probability and a seed and
returns a vector of additional nodes as described in Newman and Watts
(1999).
Functional composition of gen-circle and add-shortcuts.
So far only the clustering coefficient for a single node can be
computed.
As described in Watts and Strogatz (1998). This is really the average
over all clustering coefficients.
Because of this, the function is not variadic anymore.
This is the preferential attachment graph. Remove to old initializing
function and start with two connected nodes, to which a new one will
attach with equal probability. First test checks for the number of nodes
created and passes.
Either explicitly pass a random seed when creating the graph, or use
System/nanoTime.
Test if function actually constructs a loom graph and for number of
nodes and edges.
Sometimes Node or Edge count are lower than expected. This is because
the construction of the graph involves probabilistic decisions. Because
of this, test if actual number is bigger than some percentage of the
expected count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant