Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The variables in the MILP are not symbolic variables, i.e., not from the Symbolic Ring. The vector() command is failing in that step.

type(x)
<type 'sage.numerical.linear_functions.LinearFunction'>

You can rewrite your constraints like this

p.add_constraint(sum(_a*_x for _a,_x in zip(a1, [x,y])) + r*a1.norm(2) <= b1)