Efficient Mechanisms for Exploration of Dangerous Graphs and for Inter-agent Communication