Sanity checking the solution

Supply Chain Analytics in Python

Aaren Stubberfield

Supply Chain Analytics Mgr.

solution strategy flow chart

Supply Chain Analytics in Python

Check the model status

  • Infeasible: There are no feasible solutions.
    • Review the constraints
  • Unbounded: The object function is not bounded, maximizing or minimizing the objective will tend towards infinity.
    • Review the objective function
  • Undefined: The optimal solution may exist but may not have been found.
    • Maybe the best available solution
    • Review how you are modeling the problem
Supply Chain Analytics in Python

Check if results are within expectations

Are the decision variables and value of objective within expected range?

  • Based on knowledge / understanding of problem
  • If "Yes", then you have a valid solution
  • If "No", then review:
    • Python code
    • Data
    • Write the LP File
Supply Chain Analytics in Python

Write LP

writeLP(filename)
  • filename = The name of the file to be created

Shows:

  • Name of problem
  • Objective function and if minimizing or maximizing
  • Constraints, including constraints on Decision Variables called Bounds
  • Decision variables
Supply Chain Analytics in Python

Code example

\* Aggregate Production Planning *\
Minimize
OBJ: 20 prod_('A',_0) + 17 prod_('A',_1) 
    + 18 prod_('A',_2) + 15 prod_('B',_0) 
    + 16 prod_('B',_1) + 15 prod_('B',_2)
Subject To
_C1: prod_('A',_0) >= 0
_C2: prod_('A',_1) >= 0
_C3: prod_('A',_2) >= 0
_C4: prod_('B',_0) >= 8
_C5: prod_('B',_1) >= 7
_C6: prod_('B',_2) >= 6
Bounds
0 <= prod_('A',_0)
0 <= prod_('A',_1)
0 <= prod_('A',_2)
0 <= prod_('B',_0)
0 <= prod_('B',_1)
0 <= prod_('B',_2)
Generals
prod_('A',_0)
prod_('A',_1)
prod_('A',_2)
prod_('B',_0)
prod_('B',_1)
prod_('B',_2)
Supply Chain Analytics in Python

Summary

Strategy for Sanity Checking

  • Check the model status
  • Check decision variables and objective inside expected range
  • Use writeLP() if needed
Supply Chain Analytics in Python

Practice time!

Supply Chain Analytics in Python

Preparing Video For Download...