[Cbc] binary variables

acw at ascent.com acw at ascent.com
Tue Sep 4 11:45:02 EDT 2012


After you call solver.loadProblem, you can declare a particular variable 
to be integer with solver.setInteger(columnIndex).  If there's a special 
way to declare binary variables, I don't know it, but if you give the 
variable a lower bound of 0 and an upper bound of 1, that should do it.



From:
Christos <chtsolak at gmail.com>
To:
"cbc at list.coin-or.org" <cbc at list.coin-or.org>
Date:
09/01/2012 07:20 AM
Subject:
Re: [Cbc] binary variables



On 30/8/2012 23:11, Christos wrote:
Hi, 
i created a model and i want to expand it. 
I want to add variables-columns which are binary(0-1). 
How can i state it to Cbc in order not to be perceived as continuous 
variables? 

Thank you. 
I found in the CBC user's guide, in the "Pseudo Cost Branching" Chapter 
the sentence:

"If the user declares variables as integer but does no more, then CBC will 
treat them as simple integer variables."

How can i declare a variable to be integer(binary 0-1)?

I use the OsiClpSolverInterface and pass the model to the solver with the 
method:

loadProblem(numcols, numrows, start, index, value, collb, colub, obj, 
rowlb, rowub)

Thank you_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/cbc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20120904/a8f755a9/attachment.html>


More information about the Cbc mailing list