examples/cpp/pdptw.cc
int64 Travel(const Coordinates* const coords, RoutingModel::NodeIndex from,
             RoutingModel::NodeIndex to) {
  DCHECK(coords != nullptr);
  const int xd = coords->at(from.value()).first - coords->at(to.value()).first;
  const int yd =
      coords->at(from.value()).second - coords->at(to.value()).second;
  return static_cast<int64>(kScalingFactor * sqrt(1.0L * xd * xd + yd * yd));
}
// Returns the scaled Euclidean distance between two nodes, coords holding the
// coordinates of the nodes.
Returns the scaled Euclidean distance between two nodes, coords holding the
coordinates of the nodes.
Returns the scaled Euclidean distance between two nodes coords holding the coordinates of the nodes .
int64 Travel(const Coordinates* const coords, RoutingModel::NodeIndex from,
             RoutingModel::NodeIndex to) {
  DCHECK(coords != nullptr);
  const int xd = coords->at(from.value()).first - coords->at(to.value()).first;
  const int yd =
      coords->at(from.value()).second - coords->at(to.value()).second;
  return static_cast<int64>(kScalingFactor * sqrt(1.0L * xd * xd + yd * yd));
}
int64 Travel ( const Coordinates * const coords , RoutingModel :: NodeIndex from , RoutingModel :: NodeIndex to ) { DCHECK ( coords != nullptr ) ; const int xd = coords -> at ( from . value ( ) ) . first - coords -> at ( to . value ( ) ) . first ; const int yd = coords -> at ( from . value ( ) ) . second - coords -> at ( to . value ( ) ) . second ; return static_cast < int64 > ( kScalingFactor * sqrt ( 1.0L * xd * xd + yd * yd ) ) ; }
Returns the scaled Euclidean distance between two nodes, coords holding the
coordinates of the nodes.
Returns the scaled Euclidean distance between two nodes coords holding the coordinates of the nodes .