Watts-Strogatz Graph
- Dominant language
- C
- Stars
- 4.8k
- Forks
- 523
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
The Watts–Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering.
Syntax:
```
ag_catalog.age_create_watts_strogatz_graph(graph_name Name, n int, k int, p float
vertex_label_name Name DEFAULT = NULL,
vertex_properties agtype DEFAULT = NULL,
edge_label_name Name DEAULT = NULL,
edge_properties agtype DEFAULT = NULL,
bidirectional bool DEFAULT = true)
```
Input:
- graph_name - Name of the graph to be created
- n - The number of nodes
- k - Each node is joined with its k nearest neighbors in a ring topology.
- p -The probability of rewiring each edge
- vertex_label_name - Name of the label to assign each vertex to.
- vertex_properties - Property values to assign each vertex. Default is NULL
- edge_label_name - Name of the label to assign each edge to.
- edge_properties - Property values to assign each edge. Default is NULL
- bidirectional - Bidirectional True or False. Default True.
First create a ring over n nodes. Then each node in the ring is joined to its k nearest neighbors (or k-1 neighbors if k is odd). Then shortcuts are created by replacing some edges as follows: for each edge (u,v) in the underlying “n-ring with k nearest neighbors” with probability p replace it with a new edge (u,w) with uniformly random choice of existing node w.
http://worrydream.com/refs/Watts-CollectiveDynamicsOfSmallWorldNetworks.pdf
https://en.wikipedia.org/wiki/Watts%E2%80%93Strogatz_model
https://github.com/JoshInnis/AGE-Machine-Learning/blob/main/graph-creation/create-directed-watts-strogatz-graph.sql
Contributor guide
Assessment
This issue has not been assessed yet.