Skip to main content

Module models

Module models 

Source
Expand description

Information diffusion models

Provides four simulation models on an adjacency representation:

ModelDescription
IndependentCascadeEach active node activates each inactive neighbour with probability p(u,v)
LinearThresholdNode activates when total in-weight from active neighbours ≥ per-node threshold
SIRModelEpidemic SIR: β infection probability per edge, γ recovery probability per step
SISModelEpidemic SIS: β/γ as SIR but recovered nodes return to susceptible

Structs§

IndependentCascade
Independent Cascade (IC) diffusion model configuration.
LinearThreshold
Linear Threshold (LT) diffusion model configuration.
SIRModel
SIR epidemic model (Susceptible–Infected–Recovered).
SISModel
SIS epidemic model (Susceptible–Infected–Susceptible).
SimulationResult
Outcome of a single diffusion simulation.

Enums§

SirState
State of a node in the SIR / SIS epidemic model.

Functions§

expected_spread
Estimate the expected spread of a seed set under the IC model using Monte-Carlo averaging over num_simulations independent runs.
simulate_ic
Simulate one run of the Independent Cascade model.
simulate_lt
Simulate one run of the Linear Threshold model.
simulate_sir
Simulate one run of the SIR epidemic model.
simulate_sis
Simulate one run of the SIS epidemic model.

Type Aliases§

AdjList
Compact edge representation: (target_id, edge_weight).