igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] How to avoid indexing issues with "which" fuction


From: Tamas Nepusz
Subject: Re: [igraph] How to avoid indexing issues with "which" fuction
Date: Mon, 5 Jun 2017 22:01:23 +0200

How can I solve this problem with the algorithm, do you have any idea or advice?
Try printing the key variables of your algorithm once for every iteration of your main loop to check where it is not doing what it should do. This is a pretty standard debugging technique; I guess I would do the same if I had time to track this down on behalf of you ;)

By the way, using unique() on the set of adjacent vertices in your code might be conceptually wrong. By doing so, basically you are saying that it does not matter how many neighbors of a particular node are spreaders, a node will still have only one "chance" to become a spreader if it was immune before. In an extreme case, suppose that there are only two immune nodes in your network. One has ten thousand spreader neighbors, and the other one has only one. Which one is more likely to become a spreader in the next iteration?

T.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]