Skip to content
Snippets Groups Projects
Commit 7ba85175 authored by Ant01n3's avatar Ant01n3
Browse files

Documented the Watts-Strogats generator.

parent 93314348
Branches
Tags
No related merge requests found
......@@ -2,16 +2,44 @@ package org.graphstream.algorithm.generator;
import static java.lang.Math.*;
/**
* A generator following the small-world model of Watts and Strogatz.
*
* <p>
* This generator creates small-world graphs of arbitrary size.
* </p>
*
* <p>
* This generator is based on the Watts-Strogatz model described in:
* <ul>
* <li>Watts, D.J. and Strogatz, S.H.</li>
* <li>Collective dynamics of 'small-world' networks</li>
* <li>Nature 393 (6684): 409–10</li>
* <li>doi:10.1038/30918</li>
* <li>PMID 9623998</li>
* <li>1998</li>
* </ul>
* </p>
*/
public class WattsStrogatzGenerator extends BaseGenerator {
/** The number of nodes to generate. */
protected int n;
/** Base degree of each node. */
protected int k;
/** Probability to "rewire" an edge. */
protected double beta;
/** Current rewired node, used to allo nextEvents() iteration. */
protected int current;
/**
* New Watts-Strogatz generator.
* @param n The number of nodes to generate.
* @param k The base degree of each node.
* @param beta Probability to "rewire" an edge.
*/
public WattsStrogatzGenerator(int n, int k, double beta) {
keepNodesId = true;
keepEdgesId = true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment