Skip to content

Remove recoveries from fast_SIR heap to speed method #101

@joelmiller

Description

@joelmiller

When an individual becomes infected, we do not need to store the recovery event in the queue. We can simply create a separate collection of recovery times (and nodes). Then at the end we parse the cumulative infection info and the recovery info and create the I and R lists.

Perhaps at the end we might have the numerical value of the total number of recoveries and a heap (in reverse time order of recovery events). We process this in reverse. while also going through the cumulative I list in reverse. This will give use the values of I[t] and R[t] (and S[t]) at the times of all infection and recovery events.

Might be worth checking with Petter Holme about this (see his note at the top of his blog post on fastest SIR in the East) https://petterhol.me/2018/02/07/fastest-network-sir-code-in-the-east/. He suggests this is a significant speedup (factor of 2), but I should explore how he has implemented it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions