Modeling, analysis, and efficient resource allocation in cyber-physical systems and critical infrastructure networks