Here is a problem from math folklore. Minimize $$\sum_{j=1}^{j=n} x_j$$ under the constraints $$x_1+x_2\ge 1,\, x_2+x_3\ge 2,\dots,x_n+x_1 \ge n .$$ The Mathematica codes
Minimize[{Sum[x[j], {j, 1, n}],Table[x[j] + x[j + 1] >= j, {j, 1, n - 1}], x[n] + x[1] >= n},Table[x[j], {j, 1, n}]]
and
Minimize[{Sum[x[j],{j, 1, n}], Table[x[j] + x[j + 1] >= j, {j, 1, n - 1}], x[n] + x[1] >= n,Table[x[j] >= 0, {j, 1, n}]}, Table[x[j], {j, 1, n}]]
crack it for values of $n$ of order several hundreds, e.g. for $n=1234$ both codes produce the value $381306$ for the objective function, but slowly.
In fact, this is a linear programming problem. Is it possible to solve it for $n=2019$ in Mathematica (maybe, calling external sources)?
LinearProgramming
? $\endgroup${x[1] -> 505, x[2] -> -504, x[3] -> 506, x[4] -> -503,...,x[2019] -> 1514}
in more than hour. $\endgroup$LinearProgramming
, I meet the problem with creating the matrix. $\endgroup${1020099, {x[1] -> 1009, x[2] -> 0, x[3] -> 2, x[4] -> 1, ..., x[2019] -> 1010}}
in 4350.85 sec $\endgroup$