minor polish of examples

This commit is contained in:
Laurent Perron
2019-05-28 15:28:01 +02:00
parent c65d042e74
commit fe22bf057a
9 changed files with 168 additions and 7 deletions

View File

@@ -18,7 +18,7 @@
// generalized: we have N cards, each with K different symbols, and
// there are N different symbols overall.
//
// This is a feasability problem. We transform that into an
// This is a feasibility problem. We transform that into an
// optimization problem where we penalize cards whose intersection is
// of cardinality different from 1. A feasible solution of the
// original problem is a solution with a zero cost.

View File

@@ -83,7 +83,8 @@ int64 Travel(const Coordinates* const coords,
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));
return static_cast<int64>(kScalingFactor *
std::sqrt(1.0L * xd * xd + yd * yd));
}
// Returns the scaled service time at a given node, service_times holding the