[Cbc] Multiplying two binary variables in the objective function

Bjørn Sigurd Johansen (Spider Solutions AS) bjorn.sigurd.johansen at spidersolutions.no
Wed Oct 4 04:25:32 EDT 2017


Dear CBC list / John,





Is it possible to multiply two binary variables in the objective function scaled with the same factor?

E.g.

MINIMIZE Obj:

+12.3 B1 * 12.3 B2

or

+12.3 B1 * + 12.3 B2



If binary variables are set through some sort of branching algorithm, perhaps it is possible?  But if the binary variables are set/estimated through some other mechanism, it might not be possible?



If possible, what is the exact syntax for doing this?



If not possible, I guess the option is to introduce a third binary B3, and set up the following constraints:

B3 <= B1

B3 <= B2

B3 >= B1 + B2 - 1

And then in the objective function use:

+12.3 B3

Correct / best option?





Best regards,

Bjorn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20171004/481e676e/attachment-0001.html>


More information about the Cbc mailing list