  In this paper, we study a model of network adaptation mechanism to control
spreading processes over switching contact networks, called adaptive
susceptible-infected-susceptible model. The edges in the network model are
randomly removed or added depending on the risk of spread through them. By
analyzing the joint evolution of the spreading dynamics "in the network" and
the structural dynamics "of the network", we derive conditions on the
adaptation law to control the dynamics of the spread in the resulting switching
network. In contrast with the results in the literature, we allow the initial
topology of the network to be an arbitrary graph. Furthermore, assuming there
is a cost associated to switching edges in the network, we propose an
optimization framework to find the cost-optimal network adaptation law, i.e.,
the cost-optimal edge switching probabilities. Under certain conditions on the
switching costs, we show that the optimal adaptation law can be found using
convex optimization. We illustrate our results with numerical simulations.
