Production planning
Problem statement
This classical problem (Eiselt and Sandblom, p. 20) seeks to determine which products should be manufactured (and in what quantities) given that:
-
Each product must go through all the machines.
-
Every machine takes a different amount of time to process every product (
processing_times.csv
). -
Machines have a maximum lifetime before needing maintenance (
machines_availability.csv
). -
Each product yields a different amount of profit (
products_profit.csv
).
Model
import pandas as pd
import pyoframe as pf
processing_times = pd.read_csv("processing_times.csv")
machines_availability = pd.read_csv("machines_availability.csv")
products_profit = pd.read_csv("products_profit.csv")
m = pf.Model()
m.Production = pf.Variable(products_profit["products"], lb=0)
machine_usage = m.Production * processing_times
m.machine_capacity = machine_usage.sum_by("machines") <= machines_availability
m.maximize = (products_profit * m.Production).sum()
m.optimize()
Comments