All Products
Search
Document Center

Optimization Solver:Cases: Linear Programming (LP)

Last Updated:Apr 01, 2026

Explore six hands-on cases that show how to model real-world problems as linear programs (LP) and solve them with Optimization Solver. Each case includes Python source code hosted in MindOpt Studio — open any case directly in the online Notebook to run and modify it.

The cases progress from introductory concepts to applied machine learning. If you are new to LP, start with Case 1 before moving to the domain-specific cases.

LP cases overview

CaseBusiness problemWhat you learnDifficulty
1. Concept of LPUnderstand where LP applies in everyday decisionsCore LP concepts and their role in Operations ResearchIntroductory
2. Nutrition allocationDesign a daily diet that meets nutrition requirements at minimum costModel dietary constraints with LP; 12 code examples in C, C++, or PythonBeginner
3. Production schedulingSchedule workpieces across machines to finish as early as possibleFlow shop scheduling with LP; minimize makespanBeginner
4. Ad traffic distributionMaximize total video views while hitting per-video view targetsLP-based traffic allocation for ads, notifications, and promotionsIntermediate
5. Robust linear regressionBuild a prediction model that is resilient to outliersFormulate linear regression as an LP optimization problemIntermediate
6. SVM multi-classificationClassify inputs into multiple categories using support vector machines (SVMs)LP formulation of SVMs with L1 regularizationAdvanced

1. Concept of LP

LP is the most widely used technique in Operations Research. This introductory case explains the core concepts and the types of problems that LP can solve.

Prerequisites: No prior LP knowledge required. Basic familiarity with Python is helpful.

Try in Notebook>>

2. Nutrition allocation: lower costs and rich nutrition

Feeding a household or institution on a budget requires balancing dozens of nutritional constraints at once — exactly the kind of problem LP handles well. This case builds a daily diet planning model that meets specified nutrition requirements at the lowest possible cost. Twelve code examples are included, covering C, C++, or Python.

Prerequisites: Basic Python programming. No prior LP knowledge required.

Try in Notebook>>

3. Production scheduling: minimize makespan in a flow shop

In a flow shop, every workpiece passes through the same sequence of machines. The challenge is to find the order of workpieces that finishes all jobs as early as possible. This case models the classic flow shop scheduling problem as an LP and uses Optimization Solver to minimize the makespan.

Prerequisites: Basic Python programming. Familiarity with LP fundamentals (Case 1 recommended).

Try in Notebook>>

4. Ad traffic distribution: balanced exposure and traffic conversion

Online video platforms need each piece of content — ads, notifications, and promotions — to reach the expected number of views, while also maximizing total views across all content. This case formulates that trade-off as an LP and solves it with Optimization Solver.

Prerequisites: Basic Python programming. Familiarity with LP fundamentals (Case 1 recommended).

Try in Notebook>>

5. Robust linear regression

This case recasts linear regression as an LP, estimating the relationship between an independent variable vector x and a scalar output y using the linear function y = ⟨a, x⟩ + b. The LP formulation estimates the values of a and b.

Prerequisites: Python programming. Basic knowledge of linear regression concepts.

Try in Notebook>>

6. SVM multi-classification with L1 regularization

Classification maps an input vector x to a categorical label y — for example, identifying whether an image contains an animal or a plant. This case formulates multi-class classification using SVMs with an L1 regularization term as an LP, then solves it with Optimization Solver.

Prerequisites: Python programming. Familiarity with LP and basic machine learning concepts.

Try in Notebook>>