Description of the multimodal heatbath algorithm function.
heatbath_multimodal(net, mod_matrix, spins, alpha, temp, max_sweeps)
acceptance value of the algorithm for the given temperature
a hms_network
object
mod_matrix
spins
a double parameter balancing the use of the guidance matrix in modularity calculation
a double parameter found using the find_start_temp() function
an integer parameter of the maximum number of sweeps allowed at each temperature
This is one of the two workhorse functions for the algorithm. The heatbath algorithm selects a network node at random, calculates the multimodal modularity for the current configuration, and then switches its community assignment to each possible community. If the modularity of this iterated configuration is less than the current configuration, the new configuration is accepted and the algorithm moves on to the next randomly chosen node. If this is not the case, the node is moved to the new community assignment with some probability, which is a function of the current modularity value, the iterated value, and the system's temperature. Once the algorithm finishes with the randomly chosen node, this counts as a sweep. A new sweep occurs, with the same steps taken as above, until the sweep number maxes out (usually set to 50 to balance computation time with robustness).