Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gs-algo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graphstream
gs-algo
Commits
4534a9d3
Commit
4534a9d3
authored
13 years ago
by
Ant01n3
Browse files
Options
Downloads
Patches
Plain Diff
Documented the WattsStrogatzGenerator.
parent
7c0672b4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/graphstream/algorithm/generator/WattsStrogatzGenerator.java
+46
-1
46 additions, 1 deletion
...aphstream/algorithm/generator/WattsStrogatzGenerator.java
with
46 additions
and
1 deletion
src/org/graphstream/algorithm/generator/WattsStrogatzGenerator.java
+
46
−
1
View file @
4534a9d3
...
...
@@ -10,8 +10,53 @@ import static java.lang.Math.*;
* </p>
*
* <p>
* This generator is based on the Watts-Strogatz model.
* This model
* generates a ring of n nodes where each node is connected to its k nearest
* neighbours in the ring (k/2 on each side, which means k must be even).
* Then it process each node of the ring in order following the ring, and "rewiring"
* each of their edges toward the not yet processed nodes with randomly chosen nodes
* with a probability beta.
* </p>
*
* <h2>Usage</h2>
*
* <p>
* You must provide values for n, k and beta at construction time. You must ensure
* that k is event, that n >> k >> log(n) >> 1. Furthermore, beta being a probability
* it must be between 0 and 1.
* </p>
*
* <p>
* By default, the generator will produce a placement for nodes using the ``xyz``
* attribute.
* </p>
*
* <p>
* This generator will produce the ring of nodes once {@link #begin()} has been
* called. Then calling {@link #nextEvents()} will rewire one node at a time
* return true until each node is processed, in which case it returns false.
* You must then call {@link #end()}.
* </p>
*
* <h2>Example</h2>
*
* <pre>
* Graph graph = new SingleGraph("This is a small world!");
* Generator gen = new WattsStrogatzGenerator(20, 2, 0.5);
*
* gen.addSink(graph);
* gen.begin();
* while(gen.nextEvents()) {}
* gen.end();
*
* graph.display(false); // Node position is provided.
* </pre>
*
* <h2>Reference</h2>
*
* <p>
* This generator is based on the Watts-Strogatz model.
* </p>
*
* @reference Watts, D.J. and Strogatz, S.H.
* "Collective dynamics of 'small-world' networks". Nature 393
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment