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
7ba85175
Commit
7ba85175
authored
13 years ago
by
Ant01n3
Browse files
Options
Downloads
Patches
Plain Diff
Documented the Watts-Strogats generator.
parent
93314348
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
+29
-1
29 additions, 1 deletion
...aphstream/algorithm/generator/WattsStrogatzGenerator.java
with
29 additions
and
1 deletion
src/org/graphstream/algorithm/generator/WattsStrogatzGenerator.java
+
29
−
1
View file @
7ba85175
...
...
@@ -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
;
...
...
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