Bio-inspired strategy for control of viral spreading in networks