+ All Categories
Home > Documents > Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie...

Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie...

Date post: 30-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
66
Rejection-Based Simulation of Stochastic Spreading Processes on Complex Networks Gerrit Großmann Verena Wolf Saarland University img © Michael Kreil
Transcript
Page 1: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rejection-Based Simulation of Stochastic Spreading Processes

on Complex NetworksGerrit Großmann

Verena Wolf Saarland University

img © Michael Kreil

Page 2: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

2

• Friendship networks • Online social networks • Telecommunication networks • Infrastructure networks • Biological and Ecological Networks • …

Networks are everywhere

Complex Networks

img © Michael Kreil

Page 3: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Motivation

3

• Infectious diseases • Computer viruses • Rumours/opinions/emotions • Blackouts • …

Understand spreading phenomena of

img © Michael Kreil

Page 4: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Spreading Process• Fixed graph topology • Continuous time dynamics • Nodes have local states • Nodes' states change randomly w.r.t. rules

4

Classical example: SIS model• 2 local states (infected, susceptible) • 2 rules (infection, recovery)

Page 5: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

SIS Model

Infection (edge-based) Recovery (node-based)

5

• 2 local states (infected, susceptible) • 2 rules (infection, recovery)

(rate depends on neighborhood) (rate does not depend on neighborhood)

Page 6: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation

�6

0.0

Page 7: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation0.0123

�7

0.0

Page 8: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation0.0123

1.2

�8

0.0

Page 9: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation0.0123

0.0111.2

�9

0.0

Page 10: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation0.0123

0.011

0.02110.1

1.2

�10

0.0

Page 11: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:Rules:

1 3

SIS Naïve Simulation0.0123

0.011

0.02110.1

1.2

�11

0.0

Page 12: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rules:

1 3

0.0123

0.011

0.02110.1

1.2

SIS Naïve Simulation

�12

0.0

Page 13: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

0.0123

0.011

0.02110.1

1.2

0.0 0.011

SIS Naïve Simulation

�13

Rules:

1 3

Page 14: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

0.0123

0.011

0.02110.1

1.2

0.0 0.011

SIS Naïve Simulation

�14

Iteration over all nodes is very slow.:(

Page 15: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Stochastic Simulation Approaches

• Standard Gillespie Algorithm

• Optimized Gillespie Algorithm

• Event-Based Rejection Simulation (Our Method)

15

Page 16: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Stochastic Simulation Approaches

• Standard Gillespie Algorithm

• Optimized Gillespie Algorithm

• Event-Based Rejection Simulation (Our Method)

16

Page 17: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie

1 2

3 4

0

!17

Page 18: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie

1 2

3 4

0

!18

Page 19: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie

1 2

3 4

0

!19

2

4

2

4

Page 20: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie2

4

2

4

2

0

2

2

1

2

1

0

1 2

3 4

0

!20

Page 21: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie

1 2

3 4

0

!21

Page 22: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Standard Gillespie

1 2

3 4

0

!22

Iteration over all neighbours of the updated node is needed.

:(

Page 23: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Stochastic Simulation Approaches

• Standard Gillespie Algorithm

• Optimized Gillespie Algorithm

• Event-Based Rejection Simulation (Our Method)

23

Page 24: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

1 2

3 4

0

!24[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

What is the maximal rate at which an infected node attacks its neighbours?

(under all network configurations)

Page 25: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

1 2

3 4

0What is the maximal rate at which an infected node attacks its neighbours?

(under all network configurations)

Maximal degree: 3

!25[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

Page 26: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

1 2

3 4

0

!26[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

Page 27: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

1 2

3 4

0

!27[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

(upper bound)

Page 28: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

1 2

3 4

0 43 2

!28

Actual (effective) rate:

Upper bound:

[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

(upper bound)

Page 29: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

Rejection step with probability:

!29

Actual (effective) rate:

Upper bound:

[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

(upper bound)

1 2

3 4

0 43 2

Page 30: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

Rejection step with probability:

!30

Rejection probability = Maximal rate - Effective rateMaximal rate

Actual (effective) rate:

Upper bound:

[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

(upper bound)

1 2

3 4

0 43 2

Page 31: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Optimized Gillespie

Actual (effective) rate:

Upper bound:

Rejection step with probability:

Not necessary to update whole neighbourhood of node 4

Potentially large number of rejections

:):(

!31

Rejection probability = Maximal rate - Effective rateMaximal rate

[1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks

1 2

3 4

0 43 2

Page 32: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

!32

Rejection ProbabilitiesMaximal degree: 3Effective degree: 2

Degree: 2Susceptible neighbors: 1

Reject with probabilityReject with probabilityUpper bound

Page 33: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

!33

Rejection ProbabilitiesMaximal degree: 3Effective degree: 2

Degree: 2Susceptible neighbors: 1

Reject with probabilityReject with probabilityUpper bound

Rejection step with probability:

Page 34: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

!34

Rejection Probabilities

Degree: 2Susceptible neighbors: 1

Reject with probability

(high rejection probability when degree differences are large)

(high rejection probability for many infected nodes)

Maximal degree: 3Effective degree: 2

Reject with probability

Page 35: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Stochastic Simulation Approaches

• Standard Gillespie Algorithm

• Optimized Gillespie Algorithm

• Event-Based Rejection Simulation (Our Method)

35

Page 36: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Event-Driven SimulationIn each step

!36

1. Take first event from event queue.

2. Apply event to the network.

3. Generate new event(s).

Recovery of node 2

Infection from node 1 to 2

Page 37: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Event-Driven Simulation

!37

Infection from node 1 to 2

In each Step1. Take first event from event queue.

2. Check if event is applicable to network:

A. If Yes: apply event - Else: ignore

3. Generate new event(s).

Recovery of node 2

Page 38: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Event-Driven Simulation

!38

In each Step1. Take first event from event queue.

2. Check if event is applicable to network:

A. If Yes: apply event - Else: ignore

3. Generate new event(s) and check the events will be rejected

later.

A. If Yes: go back to 3B. Else: add events(s) to queue

Recovery of node 2

Infection from node 1 to 2

Page 39: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Event-Driven Simulation

!39

In each Step1. Take first event from event queue.

2. Check if event is applicable to network:

A. If Yes: apply event - Else: ignore

3. Generate new event(s) and check the events will be rejected

later.

A. If Yes: go back to 3 B. Else: add events(s) to queue

Late Reject

Early Reject

Page 40: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Algorithm Outline

!40

1 2

3 4

0

1. Generate a curing event for each infected node + annotate node with its curing time

2. Generate an infection attempt for each infected node

Initialization

Page 41: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Algorithm Outline1. Generate a curing event for each infected

node + annotate node with its curing time2. Generate an infection attempt for each

infected node

!41

Initialization

1. Take first event from queue2. If event is applicable:

1. Change node states acc. to event2. Generate two new events in case of infection

3. Else (Late Rejection):1. Generate new infection attempt

In each step1 2

3 4

0

Page 42: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Algorithm Outline

!42

1. Take first event from queue2. If event is applicable:

1. Change node states acc. to event2. Generate two new events in case of infection

3. Else (Late Rejection):1. Generate new infection attempt

1 2

3 4

0

1. Generate a curing event for each infected node + annotate node with its curing time

2. Generate an infection attempt for each infected node

Initialization

In each step

Page 43: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Early and Late Rejections

Generate infection

event

Event might be

successful

No

(Early Rejection)

Add toqueue

Yes

Page 44: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Early and Late Rejections

Generate infection

event

Event might be

successful

Event is applicable to graph

Applyevent

No

(Early Rejection)

Add toqueue No

(Late Rejection)

Yes Yes

Page 45: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Early and Late Rejections

Generate infection

event

Event might be

successful

Event is applicable to graph

Applyevent

No

(Early Rejection)

Add toqueue No

(Late Rejection)

Yes Yes

!Early Rejections are cheaper!

Page 46: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!46

(Initialization)

Page 47: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!47

(Initialization)

Page 48: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!48

(Initialization)

3 will still be infected

Page 49: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!49

(Initialization)

2nd event

Page 50: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!50

(Initialization)

Apply this event

Page 51: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!51

(Iteration)

Recovery of 4

Page 52: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!52

(Iteration)

Page 53: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!53

(Iteration)4 will already be

recovered already

Page 54: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!54

(Iteration)

Event not applicable (late rejection)

Page 55: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!55

(Iteration)

Generate new infection attempt

Page 56: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Sample Run

!56

(Iteration)

Page 57: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

!57

Rejection Probabilities

Degree: 2Susceptible neighbors: 1

Reject with probability

(high rejection probability when degree differences are large)

(high rejection probability for many infected nodes)

Upper bound

Maximal degree: 3Effective degree: 2

Reject with probability

Page 58: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Rejection ProbabilitiesThe degree differences are large There are many infected nodes

!58

Event queue(Getting the next event is constant

regardless of degree)

Early Rejections(Infections towards infected neighbours

can be discarded early on)

Page 59: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Generalizations

• Possible for most epidemic models (but not for all)

• Easy for weighted networks

• Easy for temporal networks (for external process which alters network)

• Possible for non-Markovian dynamics (depends on formalism)

!59

Page 60: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Results (SIS)

!60

Page 61: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Results (SIR)

!61

Infected nodes become recovered before becoming susceptible again.

Page 62: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Results (SIR)

!62

Page 63: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Results (competing pathogens)

!63

Pathogen I and Pathogen II compete over susceptible nodes.

Page 64: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Results (competing pathogens)

!64

Page 65: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Conclusion• Not Iterating over a node’s neighbourhood

yields huge performance improvements • Event-based simulation reduces rejection

steps significantly • Exploit problem structure for early rejections • Event-based simulation is very flexible and

easy to adopt to different formalisms

Thank you

Rust Code: github.com/gerritgr/Rejection-Based-Epidemic-Simulation

Page 66: Rejection-Based Simulation of Stochastic Spreading ... · [1] Cota & Ferreira: Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous

Correctness (Sketch)• Same as for Optimized Gillespie

• Add shadow rule to system

• Interpret rejections not als rejections but as applications of the shadow rule

• Joint rate attributed to infection and shadow rule is always constant

!66


Recommended