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 step t, the arcs from the previous step’s newly active nodes whose influence tipped it over. meta["thresholds"] is a NodeMap.

Notes

Node v activates when the normalised weight of its active in-neighbours is at least θ_v (compared with a relative tolerance of 1e-12 so that θ = 1 is reachable despite rounding) and at least one in-neighbour is active; a threshold above 1 can never be reached.