Resilient data gathering and communication algorithms for emergency scenarios