[Cbc] Cbc Digest, Vol 119, Issue 4

Jeff Willert willert.jeff at gmail.com
Mon Jul 10 13:42:38 EDT 2017


I like the solution as outlined in Message 4 with the ability to
"hot-start" from the saved solution.  Can anyone provide insight into how
to do this?  I'm not very familiar with the CBC event handler.

Regards,
Jeff

On Mon, Jul 10, 2017 at 12:00 PM, <cbc-request at coin-or.org> wrote:

> Send Cbc mailing list submissions to
>         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=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=
> kvyJSGNdxzP9OQ2TjtL2zwOXXrdaKqW5EZX4vCuLr5w&e=
> or, via email, send a message with subject or body 'help' to
>         cbc-request at list.coin-or.org
>
> You can reach the person managing the list at
>         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. Intermediate Results (Jeff Willert)
>    2. Re: Intermediate Results (Christopher Gross)
>    3. Re: Intermediate Results (Tobias Stengel)
>    4. Re: Intermediate Results (acw at ascent.com)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 10 Jul 2017 09:49:54 -0400
> From: Jeff Willert <willert.jeff at gmail.com>
> To: cbc at list.coin-or.org
> Subject: [Cbc] Intermediate Results
> Message-ID:
>         <CAGCnxHmwSpzSyodE40FdsJBc808GMdzBQRApsAOL-Kd8NGGF8A at mail.
> gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I have recently started using CBC both standalone and through the PuLP
> interface.  Some of my problems become rather large and take a significant
> amount of time to run.  Unfortunately, I've been having issues with
> computer reliability (power outages and such) and if the optimization
> hasn't completed, I lose all of the progress which has been made.
>
> Does CBC currently have the ability to write (to a file) the current best
> solution at some interval, either in time or based on an iteration count?
> I've been looking at the source code but I am only a moderate C programmer
> and haven't been able to find an easy way to do this.  I'm happy to make
> changes to the code myself on my local copy if someone could point me to
> the correct location.  Even an approximate solution is better than losing
> all progress.
>
> Regards,
> Jeff
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__list.coin-2Dor.org_pipermail_cbc_attachments_
> 20170710_cc9cd2bd_attachment-2D0001.html&d=DwICAg&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=7ZOg_
> 8fX3AxzT1Yo1Nqz5eNL7TGEjq05Dw8Gzeid7bY&e= >
>
> ------------------------------
>
> Message: 2
> Date: Mon, 10 Jul 2017 16:50:08 +0200
> From: Christopher Gross <christopher.gross at unikat.uni-augsburg.de>
> To: cbc at list.coin-or.org
> Subject: Re: [Cbc] Intermediate Results
> Message-ID:
>         <ae648c7b-bdfd-1eac-a871-e8fd1e857655 at unikat.uni-augsburg.de>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi Jeff,
>
> being only an average C programmer myself and having looked at CBC code
> before, I would assume that storing and loading intermediate solution
> data will be quite a feat. Unfortunately, I can't give you any advice on
> that.
>
> However, I would suggest a different solution that works not only for
> CBC: Have you ever thought about getting an uninterrupted power supply
> (UPS)? Consumer units are available for less than 100USD and will last
> about 5-20 minutes, depending on the size of the device and your power
> consumption. If your power outages aren't longer than that, this should
> be sufficient to continue running your computations.
>
> If your power outages are longer than that, you could also consider
> running CBC in a virtual machine. Those can be paused and resumed at a
> later point in time. When the power goes out, your UPS will signal your
> guest system which will pause the virtual machine and shut down the
> system. You can then power it back up when the power is back on and
> resume the virtual machine, continuing your calculations.
>
> Hope that helps.
>
> Best regards,
>
> Christopher
>
> On 2017-07-10 15:49, Jeff Willert wrote:
> > I have recently started using CBC both standalone and through the PuLP
> > interface.  Some of my problems become rather large and take a
> > significant amount of time to run.  Unfortunately, I've been having
> > issues with computer reliability (power outages and such) and if the
> > optimization hasn't completed, I lose all of the progress which has been
> > made.
> >
> > Does CBC currently have the ability to write (to a file) the current
> > best solution at some interval, either in time or based on an iteration
> > count?  I've been looking at the source code but I am only a moderate C
> > programmer and haven't been able to find an easy way to do this.  I'm
> > happy to make changes to the code myself on my local copy if someone
> > could point me to the correct location.  Even an approximate solution is
> > better than losing all progress.
> >
> > Regards,
> > Jeff
> >
> >
> > _______________________________________________
> > Cbc mailing list
> > 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=gEVaymfbiUvp55D10lWK6mFSIIFoSW
> nM41MvN3xiko6wjVENkHAS1IDcdpwngCCy&m=vU7ldw2G_FnOiwF6LzEqInJmI-
> c3LU0ZdJbjz2dLUtA&s=9h8XAYvraSGlKjFkU5k6pDTjF0_lUajzEXZKpbmXndw&e=
> >
>
> --
> Christopher Gross, M.Sc.
>
> Lehrstuhl f?r Health Care Operations/Health Information Management
>
> Universit?res Zentrum f?r Gesundheitswissenschaften am Klinikum Augsburg
> (UNIKA-T), Neus?sser Stra?e 47, 86156 Augsburg;
>
> Wirtschaftswissenschaftliche Fakult?t, Universit?t Augsburg,
> Universit?tsstra?e 16, 86159 Augsburg
>
>
> Tel.: +49 821 598-6452
>
> E-Mail:  christopher.gross at unikat.uni-augsburg.de
> Web:  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.
> unika-2Dt.de_&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=
> YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-
> MJBes5sHDL4o1el_Yj5FeWUEM&s=LzRV5Fms_Su_hBwOQsovkYbg9GEd_k_ypCxDR1bLuRc&e=
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 10 Jul 2017 15:21:02 +0000
> From: Tobias Stengel <Tobias.Stengel at locom.de>
> To: "cbc at list.coin-or.org" <cbc at list.coin-or.org>
> Subject: Re: [Cbc] Intermediate Results
> Message-ID:
>         <EDC45EE5442B124EBB022ECACBBA5911EC8567 at VM-Exchange2010.
> intranet.lan>
> Content-Type: text/plain; charset="utf-8"
>
> It is not that difficult (assuming you are using something like
> Cbc/samples/driver4.cpp, remove the "static int callBack(CbcModel * model,
> int whereFrom)" function):
>
>  - Create your on subclass of  CbcEventHandler if you don't have one [1].
> Override event(CbcEvent). In driver4.cpp there is "MyEventHandler3" which
> queries each new solution as soon as one is found.
>
> - a feasible solution can be loaded like this:
> CbcModel* model = ...
> std::vector<std::pair<std::string, double> > sol; auto solver =
> model->solver();
> double* initialSolution = ...
> for (int i = 0; i < number_of_columns; ++i) {
>         const auto val = initialSolution[i];
>         sol.emplace_back(solver->getColName(i), val); }
>
> model->setMIPStart(sol);
>
> Note that setting the MIPStart does not prevent CBC from visiting (at
> least some) of the nodes it visited in the previous run.
> So fixing the power supply will be better.
>
> Tobias
>
> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__www.
> coin-2Dor.org_Doxygen_Cbc_classCbcEventHandler.html&d=DwICAg&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=w_
> KkCbR9OCwKwPB6XrdD-o9OgjO4jEPgqzBFKNf9zR4&e=
> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__www.
> coin-2Dor.org_Doxygen_Cbc_classCbcModel.html-
> 23a3a1e768202835e9ee3c6d415e992e543&d=DwICAg&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=
> wQQeIVrQTsleknGBeKMuVCSUcf4eUrIuE3MJUq2qOw0&e=
>
>
>
> -----Urspr?ngliche Nachricht-----
> Von: Cbc [mailto:cbc-bounces at coin-or.org] Im Auftrag von Christopher Gross
> Gesendet: Montag, 10. Juli 2017 16:50
> An: cbc at list.coin-or.org
> Betreff: Re: [Cbc] Intermediate Results
>
> Hi Jeff,
>
> being only an average C programmer myself and having looked at CBC code
> before, I would assume that storing and loading intermediate solution data
> will be quite a feat. Unfortunately, I can't give you any advice on that.
>
> However, I would suggest a different solution that works not only for
> CBC: Have you ever thought about getting an uninterrupted power supply
> (UPS)? Consumer units are available for less than 100USD and will last
> about 5-20 minutes, depending on the size of the device and your power
> consumption. If your power outages aren't longer than that, this should be
> sufficient to continue running your computations.
>
> If your power outages are longer than that, you could also consider
> running CBC in a virtual machine. Those can be paused and resumed at a
> later point in time. When the power goes out, your UPS will signal your
> guest system which will pause the virtual machine and shut down the system.
> You can then power it back up when the power is back on and resume the
> virtual machine, continuing your calculations.
>
> Hope that helps.
>
> Best regards,
>
> Christopher
>
> On 2017-07-10 15:49, Jeff Willert wrote:
> > I have recently started using CBC both standalone and through the PuLP
> > interface.  Some of my problems become rather large and take a
> > significant amount of time to run.  Unfortunately, I've been having
> > issues with computer reliability (power outages and such) and if the
> > optimization hasn't completed, I lose all of the progress which has
> > been made.
> >
> > Does CBC currently have the ability to write (to a file) the current
> > best solution at some interval, either in time or based on an
> > iteration count?  I've been looking at the source code but I am only a
> > moderate C programmer and haven't been able to find an easy way to do
> > this.  I'm happy to make changes to the code myself on my local copy
> > if someone could point me to the correct location.  Even an
> > approximate solution is better than losing all progress.
> >
> > Regards,
> > Jeff
> >
> >
> > _______________________________________________
> > Cbc mailing list
> > Cbc at list.coin-or.org
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.or
> > g_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWP
> > A_2Wlc4&r=gEVaymfbiUvp55D10lWK6mFSIIFoSWnM41MvN3xiko6wjVENkHAS1IDcdpwn
> > gCCy&m=vU7ldw2G_FnOiwF6LzEqInJmI-c3LU0ZdJbjz2dLUtA&s=9h8XAYvraSGlKjFkU
> > 5k6pDTjF0_lUajzEXZKpbmXndw&e=
> >
>
> --
> Christopher Gross, M.Sc.
>
> Lehrstuhl f?r Health Care Operations/Health Information Management
>
> Universit?res Zentrum f?r Gesundheitswissenschaften am Klinikum Augsburg
> (UNIKA-T), Neus?sser Stra?e 47, 86156 Augsburg;
>
> Wirtschaftswissenschaftliche Fakult?t, Universit?t Augsburg,
> Universit?tsstra?e 16, 86159 Augsburg
>
>
> Tel.: +49 821 598-6452
>
> E-Mail:  christopher.gross at unikat.uni-augsburg.de
> Web:  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.
> unika-2Dt.de_&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx
> WPA_2Wlc4&r=zU1-bo4qay1GSxqnW8lKSuGZO4rtR2XKpD4FKabSFw8&m=2opujEm6AKOMaW_
> 68TgwVQUe5l_PIR6UYRQCEHFVUqY&s=JEpeyKDI4-QhbOIXGrFjyvO0_
> roHye4MTgYVvYEeVm0&e=
> _______________________________________________
> Cbc mailing list
> 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=zU1-
> bo4qay1GSxqnW8lKSuGZO4rtR2XKpD4FKabSFw8&m=2opujEm6AKOMaW_
> 68TgwVQUe5l_PIR6UYRQCEHFVUqY&s=86AV8-RKq-46OnS-
> iTFOyMjBx5dqf-4aj64i2ruqKHY&e=
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 10 Jul 2017 11:22:48 -0400
> From: acw at ascent.com
> To: Christopher Gross <christopher.gross at unikat.uni-augsburg.de>
> Cc: Cbc <cbc-bounces at coin-or.org>, cbc at list.coin-or.org
> Subject: Re: [Cbc] Intermediate Results
> Message-ID:
>         <OF346FE62A.2CFF6087-ON85258159.005419FB-85258159.
> 00547C5D at ascent.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Jeff, the CBC event handler absolutely has a callback that it calls
> whenever it finds a new best-so-far solution. You can fill in that
> callback to write out an MPS file, and then when you restart, you can read
> the saved solution and "hot-start" from it, or (almost as good) add a
> constraint that insists that the objective be at least as good as the one
> that was found earlier.
>
>
>
> From:
> Christopher Gross <christopher.gross at unikat.uni-augsburg.de>
> To:
> cbc at list.coin-or.org
> Date:
> 07/10/2017 10:52 AM
> Subject:
> Re: [Cbc] Intermediate Results
>
>
>
> Hi Jeff,
>
> being only an average C programmer myself and having looked at CBC code
> before, I would assume that storing and loading intermediate solution
> data will be quite a feat. Unfortunately, I can't give you any advice on
> that.
>
> However, I would suggest a different solution that works not only for
> CBC: Have you ever thought about getting an uninterrupted power supply
> (UPS)? Consumer units are available for less than 100USD and will last
> about 5-20 minutes, depending on the size of the device and your power
> consumption. If your power outages aren't longer than that, this should
> be sufficient to continue running your computations.
>
> If your power outages are longer than that, you could also consider
> running CBC in a virtual machine. Those can be paused and resumed at a
> later point in time. When the power goes out, your UPS will signal your
> guest system which will pause the virtual machine and shut down the
> system. You can then power it back up when the power is back on and
> resume the virtual machine, continuing your calculations.
>
> Hope that helps.
>
> Best regards,
>
> Christopher
>
> On 2017-07-10 15:49, Jeff Willert wrote:
> > I have recently started using CBC both standalone and through the PuLP
> > interface.  Some of my problems become rather large and take a
> > significant amount of time to run.  Unfortunately, I've been having
> > issues with computer reliability (power outages and such) and if the
> > optimization hasn't completed, I lose all of the progress which has been
>
> > made.
> >
> > Does CBC currently have the ability to write (to a file) the current
> > best solution at some interval, either in time or based on an iteration
> > count?  I've been looking at the source code but I am only a moderate C
> > programmer and haven't been able to find an easy way to do this.  I'm
> > happy to make changes to the code myself on my local copy if someone
> > could point me to the correct location.  Even an approximate solution is
>
> > better than losing all progress.
> >
> > Regards,
> > Jeff
> >
> >
> > _______________________________________________
> > Cbc mailing list
> > 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=gEVaymfbiUvp55D10lWK6mFSIIFoSW
> nM41MvN3xiko6wjVENkHAS1IDcdpwngCCy&m=vU7ldw2G_FnOiwF6LzEqInJmI-
> c3LU0ZdJbjz2dLUtA&s=9h8XAYvraSGlKjFkU5k6pDTjF0_lUajzEXZKpbmXndw&e=
>
> >
>
> --
> Christopher Gross, M.Sc.
>
> Lehrstuhl f?r Health Care Operations/Health Information Management
>
> Universit?res Zentrum f?r Gesundheitswissenschaften am Klinikum Augsburg
> (UNIKA-T), Neus?sser Stra?e 47, 86156 Augsburg;
>
> Wirtschaftswissenschaftliche Fakult?t, Universit?t Augsburg,
> Universit?tsstra?e 16, 86159 Augsburg
>
>
> Tel.: +49 821 598-6452
>
> E-Mail:  christopher.gross at unikat.uni-augsburg.de
> Web:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.
> unika-2Dt.de_&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=
> UGItoAdbN76DIO86bdusOQ&m=h2okBq7QuhYOBOu_SO6GMhp38YAi-_8am9cv4MIxkdI&s=
> bgspdUjsrozmDWtHwUipNFw1dn1yofHex5GvrQU3tLE&e=
>
> _______________________________________________
> Cbc mailing list
> 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=UGItoAdbN76DIO86bdusOQ&m=
> h2okBq7QuhYOBOu_SO6GMhp38YAi-_8am9cv4MIxkdI&s=ty2FrXQdupLpHRwSISjxh_
> Bl47e8rhai98aeLk8NPoY&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_
> 20170710_587f7c2c_attachment-2D0001.html&d=DwICAg&c=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=
> mqks9Ji98tY7-ArIvtd2Tm52PFtWgVSsb3usx4bkPzE&e= >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Cbc mailing list
> 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=YUeQqYslcDlgyHs6ZNNI0gXeJaAfI_
> 2SOzf_unxwWOU&m=33A66K40oFtlLoKFA-MJBes5sHDL4o1el_Yj5FeWUEM&s=
> kvyJSGNdxzP9OQ2TjtL2zwOXXrdaKqW5EZX4vCuLr5w&e=
>
>
> ------------------------------
>
> End of Cbc Digest, Vol 119, Issue 4
> ***********************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20170710/103a3a18/attachment-0001.html>


More information about the Cbc mailing list