Santa's Optimization Challenge for this Christmas
Alireza Soroudi, PhD
Lead Data Scientist @ bluecrux || SMIEEE || Optimization expert in Supply chain management|| Healthcare management || Lab Digitalization || Power and Energy systems || Developer || Author / Speaker || (views are mine)
We are approaching Christmas and Santa is getting ready to make the kids happy (as well as the math geeks busy).
He/She has bought 300 gifts with different values for this purpose.The value of each gift is known to Sant as displayed in following figure (the bigger the more valuable).
Santa is trying to maximise the number of happy kids by delivering these gifts. Santa will do this distribution so the value of gift that every kid receives is more than a min threshold. As a matter of fact, Santa had spent all the money in his/her pocket for purchasing the gifts so he/she does not have any money to pay for a commercial solver/tool. Santa decided to use an open source (and free) optimisation tool called #Pyomo to do this task. Here is the problem formulation:
Xi,j indicates if gift i goes to the kid j
Yj indicates if kid j receives any gift
The Pyomo code is here as well:
Once the Mixed Integer Linear Model is solved, the solution indicates which gift belongs to which kid as shown in this Figure.
领英推荐
After checking the solution, Santa realised that the number of gifts that some kids receive are more than the capacity of his/her bag. Santa decided to limit the number of items per kid (let's say 10) by adding an extra constrain as follows:
The problem is resolved and the solution is as follows:
Let's hope all the kids are happy all around the world, not only during the Christmas period but also all the times.
Subscribe and Follow #pyomo4all for the upcoming posts. #Share it with your network as a Christmas gift.
#optimization #supplychain #orms #innovation #futurism #inspiration
Junior Researcher | Data Analyst
2 年Dear Dr.Soroudi , How could you be this much great ? your articles are so informative and well recuperated.
R&D Engineer presso ENI Plenitude S.p.A (ENI group) | Operational Reseach | Graph Theory | ML | SSE | Telecommunications
2 年could we add constraints regarding gifts delivery to migrant kids who live in the woods at the borders of ours santa-claussed societies before they'll die by cold?
Data Scientist | Senior ML Engineer - Tech Lead at Electricity Maps
2 年I love this post!!! Thanks for posting it!! Happy Christmas :)
MSc in Civil and Environmental Engineering | Interested in: #Water resources #Hydrology #Wastewater treatment (for irrigation)
2 年Pymoo or Pyomo? Is there any difference in between? If so, would you please illustrate this for us, Mr. Professor?