MILP solvers like GLPK require your constraints to be linear. Since the power operator is nonlinear you run into problems.
There is a simple solution for converting
V[i] == 2^x[i]
to a linear expression, when x[i] is a binary variable. When x[i] = 0
, V[i] = 2^0 = 1
. When x[i] = 1, V[i] = 2^1 = 2
. So you can express V[i]
as
V[i] == 1 + x[i]
When x[i] = 0
, 1 + x[i] = 1
. When x[i] = 1
, 1 + x[i] = 2
.