Question: Optimization Constraint -1 or 1

 

The usual optimization constraint in Maple looks like: con := [ w[1] <= 1,  w[2] <= 1,  w[1] >= -1,  w[2] >= -1, w[1] + w[2] = 1 ]

 I was wondering if it is possible to have a constraint where the

different weights w[1] , w[2]  can only take the values   -1 , 0 , 1   

Please Wait...