# Why are optimization variables exceeding their allowed regions?

In the optimization of a function, shown below, why are the variables xi, yi not adhering to their specified allowed regions {variable, 0, 5}?

{sol, pts} = Reap[
NMaximize[fitness[x2, y2, x3, y3, x4, y4],
{{x2, 0, 5}, {y2, 0, 5}, {x3, 0, 5}, {y3, 0, 5}, {x4, 0, 5}, {y4, 0, 5}}, Integers,
Method -> {"SimulatedAnnealing","SearchPoints" -> 20,
"PerturbationScale" -> 1, "RandomSeed" -> 1},
EvaluationMonitor :> Sow[{{x2, y2}, {x3, y3}, {x4, y4}}]]] //AbsoluteTiming

{0.56064, {{-2., {x2 -> -6, y2 -> -4, x3 -> -17, y3 -> 7, x4 -> 8, y4 -> 6}},
{{{{0, 2}, {0, 2}, {1, 3}}, {{2, 2}, {1, 4}, {4,
3}}, {{1, 0}, {2, 5}, {3, 5}}, {{1, 1}, {4, 2}, {4, 4}}, {{4,
2}, {2, 1}, {4, 4}}, {{5, 5}, {4, 3}, {1, 2}}, {{2, 3}, {2,
4}, {0, 1}}, {{4, 4}, {0, 4}, {1, 4}}, {{2, 2}, {5, 3}, {4,
0}}, {{2, 2}, {4, 5}, {1, 0}}, OutputSizeLimitSkeleton[
2001], {{4, 11}, {-1, 3}, {12, 4}}, {{4, 11}, {-1, 3}, {12,
4}}, {{4, 11}, {-1, 3}, {12, 4}}, {{4, 11}, {-1, 3}, {12,
4}}, {{3, 11}, {-1, 3}, {12, 4}}, {{4, 11}, {0, 3}, {12,
4}}, {{4, 11}, {-1, 3}, {12, 4}}, {{3, 11}, {-1, 3}, {12,
4}}, {{3, 11}, {-1, 3}, {12, 4}}}}}}

• I don't see anything in the documentation that says that using the syntax {x2, 0, 5} constrains x2 to be between 0 and 5. The supported syntax is NMaximize[{f, constraints}, {x2, ..}] – Carl Woll May 22 '19 at 18:00
• What @CarlWoll says. {x2, 0, 5}` just means that the starting values of x2 should be between 0 and 5, but there's no attempt to constrain the function to that interval. – Brett Champion May 22 '19 at 18:51