New version of the Dijkstar taking into account the node values