Efficient Network Exploration and Fire Detection using Mobile Agents in a Wireless Sensor Network