Question: Optimization - evaluate constraints after values are assigned to the decision variables

Hi,

I am trying to solve the following optimization problem:

max ∑ij cijxij

st.: xij ≤ indic(∑uvxuv>0), u≠i, v>j, for all i & j,

      xij=0..1, for all i & j, where "indic()" is the indicator function.

My problem lies in evaluation of the inequality constraint. It gives back an error about the non-numeric type of the expression.

I read that Maple first evaluates the function and then it computes the values. So  I tried fixing it by adding "if not type(given_sum, numeric) then return 'indic'(args)..." which gives me "Error, could not store indic in a floating-point rtable".  If I leave out the quotes, it throws the "too many levels of recursion"  error.

Another solution I thought of was to return a numeric value, either 0 or 1. But then all my decision variables are either 0 or 1, which means that Maple doesn't try to optimize nor re-evaluate the constraints for new values of the decision variables, just leaves the initial values that satify the constraints.

Does anybody have any idea how I could solve this issue? Many thanks in advance.

Melania

 

Please Wait...