Swarm heuristic to find shortest path on a graph