// RetrievePath to retrieve the shortest path and it's weight from s to v
RetrievePath to retrieve the shortest path and it's weight from s to v
// RetrievePath to retrieve the shortest path and it ' s weight from s to v
func (sp ShortestPaths) RetrievePath(v graph.NodeID) (graph.Path, weightedgraph.Weight) {
	path := graph.Path{}
	weight := sp.nodesMap[v].d
	if weight == infinitelyWeight { 
		return path, weight
	}
	path = append(path, v)
	for v != sp.s {
		path = append(path, sp.nodesMap[v].parent)
		v = sp.nodesMap[v].parent
	}
	for i, j := 0, len(path)-1; i < j; i, j = i+1, j-1 {
		path[i], path[j] = path[j], path[i]
	}
	return path, weight
}
func ( sp ShortestPaths ) RetrievePath ( v graph . NodeID ) ( graph . Path , weightedgraph . Weight ) { path := graph . Path { } weight := sp . nodesMap [ v ] . d if weight == infinitelyWeight { return path , weight } path = append ( path , v ) for v != sp . s { path = append ( path , sp . nodesMap [ v ] . parent ) v = sp . nodesMap [ v ] . parent } for i , j := 0 , len ( path ) - 1 ; i < j ; i , j = i + 1 , j - 1 { path [ i ] , path [ j ] = path [ j ] , path [ i ] } return path , weight }
RetrievePath to retrieve the shortest path and it's weight from s to v
RetrievePath to retrieve the shortest path and it ' s weight from s to v
// no valid path