Topic
  • 2 replies
  • Latest Post - ‏2012-12-22T11:26:43Z by SystemAdmin
SystemAdmin
SystemAdmin
554 Posts

Pinned topic Solution not satisfying constraints and wrong objective value

‏2012-12-18T18:08:24Z |
Hello,
I have made a model in Optimization Studio 12.2 in order to solve it with the CP optimizer.
However the solution found does not satisfy one constraint and shows wrong objective value.
Specifically my model is something like this:
code
//some code
dvar boolean xu in Usersc in Cellsr in rbRange;
dvar boolean yc in Cellsk in plRange;
//some code
dexpr float Tu in Users = ..................
dexpr float OF = sum(u in Users) T[u];

maximize OF;

subject to {

forall(u in Users) {
T[u] >= u.demand; //demand is also float

forall(c in Cells, r in rbRange)
sum(u in Users) xu,c,r <= 1;

forall(c in Cells)
sum(k in plRange) yc,k == 1;

forall(c in Cells : c.type == 0)
yc,0 == 1;
}

//some code
[/code]
I have made also a post-processing script in order to print the OF value. However the printed OF value is different than the shown objective (i.e. the cp.getObjValue()).
In addition, I print the T[u] for each user, and for many of them the constraint T[u] >= u.demand is not satisfied.
Can anyone help please ?
Updated on 2012-12-22T11:26:43Z at 2012-12-22T11:26:43Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    554 Posts

    Re: Solution not satisfying constraints and wrong objective value

    ‏2012-12-19T09:03:38Z  
    Hello,
    This is surprising indeed. Maybe you should try to use a more recent version of CPLEX Optimization Studio (last version is 12.5). I know there has been some fixes/improvements around expressions A[x] where A is a floating point array.
    Alternatively, if you can send us a complete model that shows the problem we could have a look.
    Regards
  • SystemAdmin
    SystemAdmin
    554 Posts

    Re: Solution not satisfying constraints and wrong objective value

    ‏2012-12-22T11:26:43Z  
    Hello,
    This is surprising indeed. Maybe you should try to use a more recent version of CPLEX Optimization Studio (last version is 12.5). I know there has been some fixes/improvements around expressions A[x] where A is a floating point array.
    Alternatively, if you can send us a complete model that shows the problem we could have a look.
    Regards
    Hello,
    thank you for your answer. You were right. With version 12.5 my model runs without problems.