Swapping a Failing Edge of a Shortest Paths Tree by Minimizing the Average Stretch Factor