Boost logo

Boost Users :

Subject: Re: [Boost-users] Integer vs. Double values for link weights in Graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-07-19 19:52:36

On Tue, 19 Jul 2011, Jens Buysse wrote:

> Dear all,
> I'm new to the BOOST library (and actually also to c++).
> I have the following problem: I want to use the dijkstra algorithm for
> computing shortest paths in a network. For this I calculate weights, which in
> my case take the form of double < 1. But it seems internally boost converts
> to an integer. Is there a way to use double without miltilplying it with e.g.
> 100 to get Integers?

The code uses whichever data type your graph and property maps use to
store the edge lengths. Does your distance map have a value type of
double? That is what is used to determine the type used internally for
lengths and distances.

-- Jeremiah Willcock

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at