|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase-6 illustration: voter model on a small hand-built graph. More...
#include <array>#include <cmath>#include <cstdint>#include <cstdio>#include <random>#include <sstream>#include <string>#include <vector>#include <tpl_ca_graph_automaton.H>Go to the source code of this file.
Functions | |
| int | main () |
Phase-6 illustration: voter model on a small hand-built graph.
Builds a connected 12-node graph (a 3-cycle of triangles meeting at a central hub) and runs the deterministic-seed voter model on it. Prints node states at every step plus a tiny TikZ rendering of the final state suitable for inclusion in a paper.
The voter model on any finite connected graph is a martingale and almost surely reaches consensus; with a fixed seed it does so in a few thousand steps for 12 nodes.
Definition in file ca_voter_model_example.cc.
| int main | ( | void | ) |
Definition at line 150 of file ca_voter_model_example.cc.
References Aleph::blossom_maximum_cardinality_matching(), seed, Aleph::size(), and Aleph::CA::Graph_Synchronous_Engine< Lattice, Rule >::step().