Google Groups Home
Help | Sign in
Boolean variables in Cplex.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
arush  
View profile
 More options Aug 6, 1:01 am
Newsgroups: sci.op-research
From: arush <arushgad...@gmail.com>
Date: Tue, 5 Aug 2008 22:01:08 -0700 (PDT)
Local: Wed, Aug 6 2008 1:01 am
Subject: Boolean variables in Cplex.
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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile
 More options Aug 6, 8:30 am
Newsgroups: sci.op-research
From: Paul Rubin <ru...@msu.edu>
Date: Wed, 06 Aug 2008 08:30:05 -0400
Local: Wed, Aug 6 2008 8:30 am
Subject: Re: Boolean variables in Cplex.

arush wrote:
> 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.

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

/Paul


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Optimize_guru  
View profile
 More options Aug 6, 10:49 am
Newsgroups: sci.op-research
From: Optimize_guru <ysmirn...@gmail.com>
Date: Wed, 6 Aug 2008 07:49:01 -0700 (PDT)
Local: Wed, Aug 6 2008 10:49 am
Subject: Re: Boolean variables in Cplex.
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.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Vickson  
View profile
 More options Aug 7, 4:12 pm
Newsgroups: sci.op-research
From: Ray Vickson <RGVick...@shaw.ca>
Date: Thu, 7 Aug 2008 13:12:38 -0700 (PDT)
Local: Thurs, Aug 7 2008 4:12 pm
Subject: Re: Boolean variables in Cplex.
On Aug 5, 10:01 pm, arush <arushgad...@gmail.com> wrote:

> 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.

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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google