  Studies on the propagation of malware in mobile networks have revealed that
the spread of malware can be highly inhomogeneous. Platform diversity, contact
list utilization by the malware, clustering in the network structure, etc. can
also lead to differing spreading rates. In this paper, a general formal
framework is proposed for leveraging such heterogeneity to derive optimal
patching policies that attain the minimum aggregate cost due to the spread of
malware and the surcharge of patching. Using Pontryagin's Maximum Principle for
a stratified epidemic model, it is analytically proven that in the mean-field
deterministic regime, optimal patch disseminations are simple single-threshold
policies. Through numerical simulations, the behavior of optimal patching
policies is investigated in sample topologies and their advantages are
demonstrated.
