Given a set of planets and a set of wormholes, calculate shortest paths between pairs of planets. Basic graph algorithms.