Converted DistanceGraph to use an actual object for return values