[graph-tool] Problems using the dijktstra search
Tiago de Paula Peixoto
tiago at skewed.de
Mon Jul 16 14:09:54 CEST 2012
On 07/16/2012 12:39 PM, Nasgar wrote:
> Thanks a lot!
> I can get the correct distances normal nodes but I'm getting distances for not reachable nodes. These distances are high compared with the others distances (cost 140 against a mean cost of 5) but nothing that can be programmatic filtered (like a constant inf value or negative value). If I put infinity=-1 all distances changes to -1 (also the reachable nodes). If is use a big infinity like 100000, the unreachable nodes get this distance.
> Is this the expected result of the function?
Yes, vertices which are unreached have a distance of "infinity". If this
is not given by the user, it is computed to be max(weight) * (N + 1),
since it is larger than any possible distance. If the user wants to
filter out these vertices, this value can be used, or the user himself
can specify the infinity value. If the user specifies the value, it
needs to be large enough, otherwise there will be problems, as you
noticed when setting it to -1.
Tiago de Paula Peixoto <tiago at skewed.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 554 bytes
Desc: OpenPGP digital signature
More information about the graph-tool