Optimization problems in retail

Anton Denisov, Mikhail Budylin31 Aug 2022

Problem

Retail teams face optimization tasks all the time: setting prices, split a marketing budget across channels, plan the shelf assortment, distribute a procurement budget, schedule deliveries. Business requirements often turn these into multi-objective or optimal-control problems, and solutions found by optimization methods support the decision.

For pricing, the target is total revenue, profit must not fall below a given level, and every price must stay in an allowed range.

Example from the article: a model task on generated food-retail data (real data is under NDA). Five of the generated SKUs have prices from 60.99 to 202.99, elasticities from -1.36 to -2.22 and allowed price indices of roughly 0.79 to 1.29.

Solution in brief

Write the task as maxf(x) subject to constraints, and name its class (LP, MILP, NLP, MINLP). Pricing with exponential demand is an NLP. The article codes it twice behind one base class, in SciPy (COBYLA) and in Pyomo (ipopt), then compares run time as the number of products grows.

Questions this case answers
  • How to formulate a constrained decision over many items (maximize one total, keep another total above a floor, keep each variable inside bounds) as a nonlinear optimization problem
  • How to choose an open-source optimization solver whose run time stays acceptable as the number of decision variables grows
  • How to turn a retail pricing task into a constrained optimization problem with a revenue objective and a profit floor
  • How to recognize which retail decisions (pricing, marketing budget, assortment, procurement, delivery) are optimization problems

Tools and methods

  • Pyomo — algebraic modeling layer; calls an external solver (ipopt here).
  • SciPy — minimize with NonlinearConstraint and LinearConstraint, method COBYLA.
  • Price optimization — maximize revenue with a profit floor and price bounds.
  • Docker — the repo's Dockerfile sets up a container for reproducing the results, since solvers are installed separately from Python.
Continue reading — it's free

Google or a one-time email code. No password.