Stability behavior of the equilibrium states in networks with Josephson junctions and application to the many-contact SQUID