PathCost moves from being a pair to a struct.