Searching for a black hole in arbitrary networks: optimal mobile agents protocols