// relax return the new weight if updated
relax return the new weight if updated
// relax return the new weight if updated
func (sp *ShortestPaths) relax(u, v graph.NodeID, w weightedgraph.Weight) weightedgraph.Weight {
	if sp.nodesMap[v].d > sp.nodesMap[u].d+w { 
		sp.nodesMap[v].d = sp.nodesMap[u].d + w
		sp.nodesMap[v].parent = u
		return sp.nodesMap[v].d
	}
	return 0
}
func ( sp * ShortestPaths ) relax ( u , v graph . NodeID , w weightedgraph . Weight ) weightedgraph . Weight { if sp . nodesMap [ v ] . d > sp . nodesMap [ u ] . d + w { sp . nodesMap [ v ] . d = sp . nodesMap [ u ] . d + w sp . nodesMap [ v ] . parent = u return sp . nodesMap [ v ] . d } return 0 }
relax return the new weight if updated
relax return the new weight if updated
// can handle infinitelyWeight since we set it's too max