[Cbc] Cbc Digest, Vol 122, Issue 7

Bjørn Sigurd Johansen (Spider Solutions AS) bjorn.sigurd.johansen at spidersolutions.no
Thu Oct 5 01:06:37 EDT 2017


Such as / which do you recommend ?

Will they provide better solutions through “intelligent” mapping to CBC, or “only” a simpler interface?


  *   Bjorn

From: Cbc [mailto:cbc-bounces at coin-or.org] On Behalf Of Gleb Belov
Sent: torsdag 5. oktober 2017 03:13
To: cbc at coin-or.org
Subject: Re: [Cbc] Cbc Digest, Vol 122, Issue 7

Hi Bjorn,

you can use high-level modeling languages which interface CBC and take care of non-linearities and global constraints.

Gleb

On 4 October 2017 at 20:57, <cbc-request at coin-or.org<mailto:cbc-request at coin-or.org>> wrote:
Send Cbc mailing list submissions to
        cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>

To subscribe or unsubscribe via the World Wide Web, visit
        https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=9nqWEkDUvEKmyVubWMJftRwLb3f8Uot_Z69jNiToikY&e=
or, via email, send a message with subject or body 'help' to
        cbc-request at list.coin-or.org<mailto:cbc-request at list.coin-or.org>

You can reach the person managing the list at
        cbc-owner at list.coin-or.org<mailto:cbc-owner at list.coin-or.org>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cbc digest..."


Today's Topics:

   1. Re: Multiplying two binary variables in the objective
      function (John Forrest)
   2. Re: Multiplying two binary variables in the objective
      function (John Forrest)
   3. Re: Increase number of digits in solution file
      (nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>)


----------------------------------------------------------------------

Message: 1
Date: Wed, 4 Oct 2017 09:57:57 +0100
From: John Forrest <john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>>
To: cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
Subject: Re: [Cbc] Multiplying two binary variables in the objective
        function
Message-ID: <97638c11-e95d-8cbc-9754-c13e559f35b7 at fastercoin.com<mailto:97638c11-e95d-8cbc-9754-c13e559f35b7 at fastercoin.com>>
Content-Type: text/plain; charset=utf-8; format=flowed

Bjorn,

Probably simplest/best to make into Special Ordered Set of type 1 with 4
variables

B1_0_B2_0, B1_1_B2_0, B1_0_B2_1, B1_1_B2_1

with objective values 0.0, 12.3, 12.3, 151.29

and constraint
B1_0_B2_0+B1_1_B2_0+B1_0_B2_1+B1_1_B2_1 == 1.0
(you could leave out B1_0_B2_0 and make <=, but probably better
branching with ==)

and corresponding changes to coefficients in constraints.

That way you add 2 variables and 1 row which is probably better than
adding 1 variable and 3 rows - and will be better for branching.

Depending on what you are trying to model, you could give weights to
give better branching decisions.

John Forrest
On 02/10/17 07:10, Bj?rn Sigurd Johansen (Spider Solutions AS) wrote:
> Dear CBC list,
>
> 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
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=hM8BKlgl1z5yzxrZnxtYfw_AEAZDyQOjfvWFs39qJLk&s=DDn3zh-jLSVoNRCQal3m7LVGxVLHAnUxaImDCAH-088&e=
>
>



------------------------------

Message: 2
Date: Wed, 4 Oct 2017 10:01:37 +0100
From: John Forrest <john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>>
To: cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
Subject: Re: [Cbc] Multiplying two binary variables in the objective
        function
Message-ID: <086502f6-03b7-ad48-9753-a23ef7381638 at fastercoin.com<mailto:086502f6-03b7-ad48-9753-a23ef7381638 at fastercoin.com>>
Content-Type: text/plain; charset=utf-8; format=flowed

Whoops - ignore this post - I was not thinking.

However this will make sense if it is more complicated.

Special Ordered Sets are very powerful.

John Forrest

On 04/10/17 09:57, John Forrest wrote:
> Bjorn,
>
> Probably simplest/best to make into Special Ordered Set of type 1 with
> 4 variables
>
> B1_0_B2_0, B1_1_B2_0, B1_0_B2_1, B1_1_B2_1
>
> with objective values 0.0, 12.3, 12.3, 151.29
>
> and constraint
> B1_0_B2_0+B1_1_B2_0+B1_0_B2_1+B1_1_B2_1 == 1.0
> (you could leave out B1_0_B2_0 and make <=, but probably better
> branching with ==)
>
> and corresponding changes to coefficients in constraints.
>
> That way you add 2 variables and 1 row which is probably better than
> adding 1 variable and 3 rows - and will be better for branching.
>
> Depending on what you are trying to model, you could give weights to
> give better branching decisions.
>
> John Forrest
> On 02/10/17 07:10, Bj?rn Sigurd Johansen (Spider Solutions AS) wrote:
>> Dear CBC list,
>>
>> 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
>>
>> _______________________________________________
>> Cbc mailing list
>> Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=hM8BKlgl1z5yzxrZnxtYfw_AEAZDyQOjfvWFs39qJLk&s=DDn3zh-jLSVoNRCQal3m7LVGxVLHAnUxaImDCAH-088&e=
>>
>>
>>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=ru7IvQS__wCzcWuZWyT4Z2N1gBq46p_PvS1qpe7c7kE&s=gid7kHY0HNYvNE3hIAYt-AEm7zAZJgX7A1W17kdk7mQ&e=
>
>



------------------------------

Message: 3
Date: Wed, 4 Oct 2017 09:57:27 +0000
From: <nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>>
To: <john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>>
Cc: cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
Subject: Re: [Cbc] Increase number of digits in solution file
Message-ID:
        <85c590bb9b9c4372896d567f4856b4d3 at DP07CEXC16.MELINDA.LOCAL<mailto:85c590bb9b9c4372896d567f4856b4d3 at DP07CEXC16.MELINDA.LOCAL>>
Content-Type: text/plain; charset="utf-8"

Thank you very much.
It works perfectly !

Nicolas

De : John Forrest [mailto:john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>]
Envoy? : mercredi 4 octobre 2017 10:19
? : Derhy Nicolas (ENGIE SA) <nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>>
Cc : cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
Objet : Re: [Cbc] Increase number of digits in solution file

Nicolas,

Give up and do it the incorrect way.  Don't try and define CLP_OUTPUT_FORMAT.

Go to line 58 (about) in CbcSolver.cpp and change the line

#define CLP_OUTPUT_FORMAT %15.8g

to whatever you want.

John Forrest

On 03/10/17 14:01, nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com><mailto:nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>> wrote:
Hi,

I followed your advice and I tried to add  #define CLP_OUTPUT_FORMAT  "%20.12g" in Clp/src/config_default.h but it has no effect.
Then I tried to change compile parameters but did not know exactly what to do : I modified preprocessor definitions by adding CLP_OUTPUT_FORMAT=%20.12g; but no effect.
I tried with quote (CLP_OUTPUT_FORMAT=?%20.12g?;), I tried on different vs projects (cbc, libCbc and libClp) but it was unsuccessful?
When I watch the resulting command line, it seems that percent symbol is not well recognized because I obtain : /D "CLP_OUTPUT_FORMAT=\" .12g\""

If anyone can give me more details, it would be great !

Nicolas

De : Fausto Richetti Blanco [mailto:fausto.blanco at gmail.com<mailto:fausto.blanco at gmail.com>]
Envoy? : jeudi 21 septembre 2017 18:59
? : John Forrest <john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>><mailto:john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>>
Cc : Derhy Nicolas (ENGIE SA) <nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>><mailto:nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>>; cbc <cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>><mailto:cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>>
Objet : Re: [Cbc] Increase number of digits in solution file

I think you can add -DCLP_OUTPUT_FORMAT ="%20.12g" to the compiler parameters in the project settings of visual studio

On Thu, Sep 21, 2017 at 1:05 PM, John Forrest <john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com><mailto:john.forrest at fastercoin.com<mailto:john.forrest at fastercoin.com>>> wrote:
Nicolas,

I only use Linux, so maybe someone else can help.

I think that for Visual Studio you have to modify Clp/src/config_default.h by hand.  If so then I would try adding  #define CLP_OUTPUT_FORMAT ="%20.12g".  I am not sure if you need the "".  I hope someone will correct me if I am wrong.

John Forrest
On 21/09/17 14:24, nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com><mailto:nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>> wrote:
Hi John,

Can you explain me how to do this ?
I have downloaded source code and I compiled it successfully (using Visual Studio 2010).
I found some CXXDEFS in the configure file but I do not know what to modify.

Nicolas

De : Cbc [mailto:cbc-bounces at coin-or.org<mailto:cbc-bounces at coin-or.org>] De la part de John Forrest
Envoy? : mardi 19 septembre 2017 18:57
? : cbc at list.coin-or.org<mailto:cbc at list.coin-or.org><mailto:cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>>
Objet : Re: [Cbc] Increase number of digits in solution file

Nicolas,

When you configure cbc add to CXXDEFS

-DCLP_OUTPUT_FORMAT ="%20.12g"

or whatever you want.

John Forrest

On 19/09/17 16:02, nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com><mailto:nicolas.derhy at engie.com<mailto:nicolas.derhy at engie.com>> wrote:
Hi everybody,

I often use cbc exe. It works very well and each time I use it, I add to the command line ?-solution mySolution.txt? in order to recuperate the optimal solution.
My problem is that the values stored in the solution file lacked sometimes of precision when I need a lot of digits.
For example, I recently obtained 1.5596969e+008 whereas I was hoping for  155969687.

I tried several options like ?output but I did not find any option that will fit my expectations.
Is there a way to increase the number of digits in solution file ?

Nicolas

ENGIE Mail Disclaimer: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=liN9jZfZlOwfImRf8ZsFiTBHTDBdqe08kQEpmHtfV3Q&e= <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwQFAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=anc8oE2IRL39guSdrbI6atT3s0V2ObFOaTDgJHLf9-c&s=mjNThllnDqmDRcNqpqksHEfbKv9yhq5d4f8mdpJscRs&e=>




_______________________________________________

Cbc mailing list

Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org><mailto:Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>>

https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=anc8oE2IRL39guSdrbI6atT3s0V2ObFOaTDgJHLf9-c&s=WQyrZaz7e_48jLExsKGJZLzrV8DuJrdS4pbnzRZCLhM&e=



ENGIE Mail Disclaimer: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=liN9jZfZlOwfImRf8ZsFiTBHTDBdqe08kQEpmHtfV3Q&e= <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwMD-g&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=QLQl3jHZx6hPNKTb0I9pud73uBDZjSYyVOorevkAFrU&m=twctdVqG8x_S3LcNeNMh_E3U3_cH9YdWaXeaESUBOE0&s=IEjdcmffNopDjU_gWPBZ0fyonrmKskqA_k2C5Fqd_AA&e=>



_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org><mailto:Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>>
https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=QLQl3jHZx6hPNKTb0I9pud73uBDZjSYyVOorevkAFrU&m=twctdVqG8x_S3LcNeNMh_E3U3_cH9YdWaXeaESUBOE0&s=tX_0lqmYf6lgmM238Sh7IWf8BgFrOAG2c7GepHYA_tU&e=


ENGIE Mail Disclaimer: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=liN9jZfZlOwfImRf8ZsFiTBHTDBdqe08kQEpmHtfV3Q&e=


ENGIE Mail Disclaimer: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.engie.com_disclaimer_&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=liN9jZfZlOwfImRf8ZsFiTBHTDBdqe08kQEpmHtfV3Q&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=http-3A__list.coin-2Dor.org_pipermail_cbc_attachments_20171004_53e3d706_attachment.html&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=ARujEMp4z7mle6eIaX_V80Oj8siGv3MRo17r_M3-ybA&e= >

------------------------------

Subject: Digest Footer

_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>
https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=mzJGkRorCZhAPHf4MlJyeoRAi8yNupLG9ozyA0Rd30E&m=_AD7u3OUeb40-EliVN64p_sXwLKeFKvM8nWTNNCZmps&s=9nqWEkDUvEKmyVubWMJftRwLb3f8Uot_Z69jNiToikY&e=


------------------------------

End of Cbc Digest, Vol 122, Issue 7
***********************************



--
Dr Gleb Belov       Monash University      +61 3 9903 1622
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20171005/6b28fab1/attachment-0001.html>


More information about the Cbc mailing list