| 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)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.