Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove recoveries from fast_SIR heap to speed method #101

Open
joelmiller opened this issue Nov 19, 2024 · 0 comments
Open

Remove recoveries from fast_SIR heap to speed method #101

joelmiller opened this issue Nov 19, 2024 · 0 comments

Comments

@joelmiller
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant