A Network Approach To Quantify The Resilience Of Complex Systems