This paper provides a compact mathematical formulation for shared protection in communication networks with bandwidth guaranteed tunnels. The formulation is characterized by taking the most general definition of the Shared Risk Group (SRG) with the complete routing information in the single failure scenario, which can facilitate solving the Shared Path Protection Problem on various network topologies and various graph models of networks. The general SRGs are essential for survivable routing in multi-layer grooming networks as well as in multi-domain networks. With the formulation, a general approach and a unified expression for solving the dynamic survivable routing problem can be developed. A case study is given at the end to verify the proposed formulation on a well studied special case, namely protecting against a single node or a single link failure.