Algorithms For Self-Healing Networks