WattsCascade(infectedSeed:Iterable[String], threshold: T = Threshold.UNIFORM_RANDOM, seed:Long = -1, maxGenerations: Int = 100)
run the Watts Cascade dynamic on the network
This algorithm, presented by Duncan Watts in 2002, presents a method for the spread of “infectious ideas.” In the model, people are represented as nodes and relationships are edges. Each node is given a random or deterministic threshold that states it will accept an idea if the fraction its in-neighbours accepting the idea has exceeded the threshold.
In the first step the state of all nodes are set. This includes whether they are initially infected and their threshold.
Each non-infected vertex checks whether the number of infected messages it has received outweighs its threshold, if so then it sets its state to be infected and then announces this to all of its out-neighbours.
The list of node names that begin infection.
threshold: Double | Threshold.UNIFORM_RANDOM | Threshold.RANDOM_SAME_VAL = Threshold.UNIFORM_RANDOM
fraction of infected neighbours necessary to trigger change of state. Set to
UNIFORM_RANDOMto choose thresholds independently at random for each vertex and
RANDOM_SAME_VALto choose a single random threshold to apply to all vertices..
Value used for the random selection, can be set to ensure same result is returned per run. If not specified, it will generate a random seed.
maxGenerations: Int = 100
Maximum number of spreading generations, where seeds are at generation 0.
Number of infected neighbours
infection threshold for vertex
true if vertex is infected, else false