blog icon indicating copy to clipboard operation
blog copied to clipboard

Introduction to Linear Programming in Python | Maxime Labonne

Open utterances-bot opened this issue 3 years ago • 5 comments

Introduction to Linear Programming in Python | Maxime Labonne

A guide to mathematical optimization with Google OR-Tools

https://mlabonne.github.io/blog/linearoptimization/

utterances-bot avatar May 12 '22 23:05 utterances-bot

This is very useful, thanks! Out of interest why did it take my program 184037.00 milliseconds to solve? Is your pc really more than 2,000 times faster? I was entering the code in IDLE.

edit: the answer comes ~instantaneously but IDLE says it's taking a number of seconds.

DeanStra avatar May 12 '22 23:05 DeanStra

Useful blog on explain OR tools with interested war game. It is ready user friendly and OR tools and support multi model.

================= Solution ================= Solved in 1.00 milliseconds in 2 iterations

Optimal power = 1800.0 💪power Army:

  • 🗡️Swordsmen = 6.0000000000000036
  • 🏹Bowmen = 0.0

Wang-Yong2018 avatar May 13 '22 03:05 Wang-Yong2018

Thanks for your feedback!

@DeanStra This is strange, is it value returned by solver.wall_time() or another measure provided by IDLE?

mlabonne avatar May 13 '22 10:05 mlabonne

Hi Maxime I'm new to python and don't really understand your question. FWIW I ran the code in Jupyter Notebooks and am getting times of 1-3 milliseconds. Will provide more details upon request.

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, May 13, 2022 at 11:05 AM Maxime Labonne @.***> wrote:

Thanks for your feedback!

@DeanStra https://github.com/DeanStra This is strange, is it value returned by solver.wall_time() or another measure provided by IDLE?

— Reply to this email directly, view it on GitHub https://github.com/mlabonne/blog/issues/5#issuecomment-1125875356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZEUNIUH4EO5ICJV73GGXP3VJYSN3ANCNFSM5VZYBBFQ . You are receiving this because you were mentioned.Message ID: @.***>

DeanStra avatar May 13 '22 10:05 DeanStra

@DeanStra No problem, I just wanted to check where this "184037.00 milliseconds" value comes from. It's probably nothing important, I'm glad if it works better for you with Jupyter Notebook.

mlabonne avatar May 14 '22 10:05 mlabonne