-
Notifications
You must be signed in to change notification settings - Fork 274
Description
My optimization problem is the following:
I want to maximize the sum over binary variables. The only constraint I have is the following: I transform the ones in my binary array to corresponding indices, so e.g.
[1 0 0 1 0] -> [0 3]=indices
Then I use these indices to calculate a value of a matrix M[:, indices]. Now this value needs to be under a certain threshold.
I already have a good initial guess. Now if an additional zero gets flipped to a one during the optimization and the value is over the threshold it does not make any sense to further investigate this combination. So the one needs to be flipped back to the zero.
I have seen the custom lazy constraint handler about the traveling salesman problem but I still have troubles understanding the functionalities of the functions createCons, conscheck and consenfolp. I really do not know where to add my custom constraint function I use for calculating my matrix value.