GraphTheory[RandomGraphs]
WattsStrogatzGraph
generate Watts-Strogatz random graph
Calling Sequence
Parameters
Options
Description
Definition
Examples
References
Compatibility
WattsStrogatzGraph(n,p,k,options)
n
-
positive integer
p
numeric value between 0.0 and 1.0
k
(optional) positive integer, by default 2
options
(optional) equation(s) of the form seed=value
seed = integer or none
Seed for the random number generator. Equivalent to calling randomize(seed) immediately before invoking this function.
WattsStrogatzGraph(n,p,k,options) creates a Watts-Strogatz random graph on n vertices.
The random number generator used can be seeded using the seed option or the randomize function.
A Watts-Strogatz random graph is a circulant graph with parameters n and k in which each edge has been rewired with probability p.
with⁡GraphTheory:
with⁡RandomGraphs:
G≔WattsStrogatzGraph⁡8,0.5
G≔Graph 1: an undirected graph with 8 vertices and 14 edge(s)
DrawGraph⁡G
The DegreeSequence command returns the degrees of the vertices of a given graph.
DegreeSequence⁡G
3,5,2,3,3,5,4,3
G≔WattsStrogatzGraph⁡100,0.25,3
G≔Graph 2: an undirected graph with 100 vertices and 300 edge(s)
To view the degree distribution of a Watts-Strogatz graph:
Statistics:-Histogram⁡DegreeSequence⁡G
Statistics:-Tally⁡DegreeSequence⁡G
4=6,5=22,6=43,7=24,8=5
Watts, D. J.; Strogatz, S. H. (1998). "Collective dynamics of 'small-world' networks". Nature. 393 (6684): 440–442. (4 June 1998). doi:10.1038/30918. PMID 9623998.
The GraphTheory[RandomGraphs][WattsStrogatzGraph] command was introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
See Also
DegreeSequence
DrawGraph
RandomBipartiteGraph
RandomDigraph
RandomGraph
RandomNetwork
RandomRegularGraph
RandomTournament
RandomTree
Download Help Document