graph_type parameter selects the topology when initialize_graph() builds the graph. Each topology has different connectivity properties that affect how quickly — and whether — a simulation converges.
Built-in topologies
Complete
Every node is connected to every other node. This is the most densely connected topology.num_nodes=5 a complete graph has 5 nodes and 10 edges. Every agent has direct access to every other agent’s state each timestep, so influence spreads in a single hop. Simulations on complete graphs typically converge faster than on sparser topologies.
Emergent builds complete graphs with
nx.complete_graph(num_nodes) from networkx.Cycle
Nodes are arranged in a ring. Each node is connected only to its two immediate neighbors.num_nodes=10 a cycle graph has 10 nodes and 10 edges, each of degree 2. Information must travel hop-by-hop around the ring, so convergence is slower than on a complete graph. The cycle topology is useful for modeling localized influence — agents only respond to adjacent neighbors.
Emergent builds cycle graphs with
nx.cycle_graph(num_nodes) from networkx.Wheel
One hub node at the center is connected to every outer node. The outer nodes form a ring connected only to their ring neighbors and the hub.num_nodes=7 the wheel graph has 7 nodes: node 0 is the hub with degree 6, and nodes 1–6 each have degree 3 (two ring neighbors plus the hub). The hub acts as a broadcast point — its state reaches all other agents in a single timestep, which can accelerate convergence compared to a pure cycle.
Emergent builds wheel graphs with
nx.wheel_graph(num_nodes) from networkx. Note that num_nodes counts the hub, so a wheel with num_nodes=7 has 6 outer nodes.Custom graphs
You can inject anynx.Graph (or subclass) directly, bypassing the built-in topologies entirely.
Scale-free network (Barabási–Albert)
Scale-free network (Barabási–Albert)
Produces a power-law degree distribution where a few high-degree hubs dominate connectivity — common in social and technological networks.
Random network (Erdős–Rényi)
Random network (Erdős–Rényi)
Each possible edge exists independently with probability
p. Good baseline for comparison.Small-world network (Watts–Strogatz)
Small-world network (Watts–Strogatz)
Combines local clustering with short average path lengths — characteristic of many real social networks.
Grid network
Grid network
Agents arranged in a 2D lattice. Useful for spatial simulations.
How topology affects propagation
The graph structure determines the neighborhood available to each agent at every timestep. Key effects to consider:- Diameter: The longest shortest path between any two nodes. A complete graph has diameter 1 — any two nodes can exchange information in one step. A cycle graph has diameter
num_nodes // 2. A larger diameter means slower global propagation. - Degree distribution: Uniform degree (complete, cycle) means all agents have identical reach. Non-uniform degree (wheel, scale-free) creates influential hubs whose state propagates faster.
- Clustering: Highly clustered topologies cause local groups to converge among themselves before reaching a global consensus, which can create long-lasting local equilibria.
num_nodes and graph_type on the model.