Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Boolean variables in Cplex.

1 view
Skip to first unread message

arush

unread,
Aug 6, 2008, 1:01:08 AM8/6/08
to
Hello ,
I have a array of variables Z[10] for example and i want them to be 0
or 1.( boolean) , I have declared it as follows :
IloNumVarArray Z(env,M,0,1,ILOINT);

However when i use env.out() to see what are the values of Z .... one
or two or them read 1.11022e -016 .... which is zero but why is is
getting that number instead of just plain 0 . I have also tried
IloNumVarArray Z(env,M,0,1,ILOBOOL); but surprisingly it does the
same.

Any suggestions.
Arush.

Paul Rubin

unread,
Aug 6, 2008, 8:30:05 AM8/6/08
to

It's just rounding error. All variables are double precision during the
computations, and a little decimal dust creeps in sometimes.

/Paul

Optimize_guru

unread,
Aug 6, 2008, 10:49:01 AM8/6/08
to
Arush,
It is possible to change values of some default tolerances from their
original ones of 1e-4 and 1e-6 to 0.
Look at the EPINT parameter for the integer tolerance (default is
1e-5) and try to set it to 0. However,
if your problem is large or highly degenerate, it may trigger the
numeric instability effect and cause infeasibility.
Presolve has its own integer tolerance (I think 1e-8 or 1e-12) that
can't be changed. Practically every matrix of
a LP/MIP problem has a non-full rank, which means that it's degenerate
to a certain degree, but that shouldn't stop
you from trying if you really want to see integers.

Ray Vickson

unread,
Aug 7, 2008, 4:12:38 PM8/7/08
to

Presumably, some of the variables are /exactly/ 0 (or 1) because they
have been declared so by branches like "x = 0" or "x = 1" in the B&B
search tree. Others may be zero in the LP relaxation, but come out as
small positive numbers because of roundoff errors. I have seen other
software that can even give small negative numbers, at least in the
older versions of a few years ago.

R.G. Vickson

0 new messages