aryagraph.sim.linear_threshold#
- aryagraph.sim.linear_threshold(g: Any, seeds: Any, thresholds: Any = None, *, weight: str | Callable[[Hashable, Hashable, dict], float] | None = None, seed: int | Generator | None = None, max_steps: int | None = None) SimulationResult[source]#
Simulate the linear threshold model from seeds.
- Parameters:
thresholds –
None(independent uniform thresholds on (0, 1], drawn from seed for every node), a number for all nodes, a node-attribute name, or a{node: threshold}mapping.weight – Arc influence before normalisation by in-weight (
None: all 1).
- Returns:
SimulationResult – One frame per step;
edge_activity[t]holds, for each node activated at stept, the arcs from the previous step’s newly active nodes whose influence tipped it over.meta["thresholds"]is aNodeMap.
Notes
Node
vactivates when the normalised weight of its active in-neighbours is at leastθ_v(compared with a relative tolerance of 1e-12 so thatθ = 1is reachable despite rounding) and at least one in-neighbour is active; a threshold above 1 can never be reached.