Code Monkey home page Code Monkey logo

4-levels-of-linear-programming's Introduction

4-levels-of-linear-programming

Introduction

You have been contacted by the FSharp Corporation, a thriving business that ships FSharp all over countries of the European Union.

Each country needs a steady monthly supply of FSharp. A smaller country like Austria needs to receive 10 units of F# each month, whereas a larger country like Germany needs 57 units of F# each month.

The FSharp Corporation operates 5 factories, spread out in the European Union. Each factory can produce a limited quantity of F# units every month, and is assigned a list of countries it can ship to.

However, due to an increase in F# demand, Management has noticed that there were issues with producing and shipping units where they are needed. Your task is to analyze the setup, and optimize it!

  • data.csv file
  • data.fsx file

Level 1: Feasibility

We have 5 factories.
Each factory has

  • a capacity (150 units), and
  • a list of countries it can ship to.

The total demand across countries is 563 units, we can produce 5 * 150 units.
Can we actually meet the demand?

Level 2: Linear Programming / Allocation

We start from the same setup as Level 1, but we want to figure out what is the most profitable way we can ship units with our current factories.

Changes from Level 1:

  • Every factory now has a Location, the country where it is located.
  • When we ship and sell a unit from a factory to a destination country, we receive $1.0, but we incur costs based on the shipping distance.

As a result, the solver should try to favor shipping from closer factories, because its objective is to maximize profit.

Level 3: Mixed Integer Linear Programming

We start from a setup similar to Level 2, but we want to change our factories to become more profitable. We allow two changes:

  • we can now ship from any factory to any country,
  • we can change the size of each factory. We assign 0 to 10 machines to each factory, with each machine costing 10 but bringing a capacity of 50 units.

Level 4: Mixed Integer Linear Programming / Traveling Salesman

This problem is mostly independent from Level 1 to 3.

We take on the classic Traveling Salesman Problem, and try to find the shortest route that visits all our cities, once, and returns to the origin.

References

Google OR Tools:
https://developers.google.com/optimization

FLIPS:
https://flipslibrary.com

Formulating Integer Linear Programs: A Rogues’ Gallery
https://faculty.nps.edu/dell/docs/Formulettes060425.pdf

https://cs.stackexchange.com/questions/12102/express-boolean-logic-operations-in-zero-one-integer-linear-programming-ilp

https://math.stackexchange.com/questions/2500415/how-to-write-if-else-statement-in-linear-programming

4-levels-of-linear-programming's People

Contributors

mathias-brandewinder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.