The simplex idea: walk from vertex to vertex, uphill

Beginner Linear programming, StatQuest
Created by Best · 15.07.2026 at 20:54 UTC

The simplex algorithm avoids checking every vertex. Take two mixes with three constraints on flour, sugar, and chocolate, which together give a feasible region with several vertices. The main idea is simple: start at the origin and repeatedly step to a neighboring vertex that raises revenue, stopping as soon as no neighbor does better.

Which neighbor first? A common rule is to head in the direction that earns the most revenue per kilogram. Cookie mix earns $3$ per kg and donut mix earns $2$, so the algorithm moves along the cookie axis first. Each step runs until a resource limit binds.

From each vertex, compare revenue at neighboring vertices along the remaining axes. When every neighbor earns the same or less, the current vertex is optimal. A nice feature: had it started along the donut axis instead, moving uphill would still land on the same optimal mix amounts, as long as each step picks an improving neighbor.

University approvals: 0
Related cards
Builds on More constraints, more dimensions, and the limits of brute force · Linear programming, StatQuest
Next Scaling the idea: the three-mix example · Linear programming, StatQuest
Video Content
Tasks
Question 1

What is the main idea of the simplex algorithm?

Question 2

Why does the algorithm move along the cookie axis first here?

Question 3

Why does the algorithm stop at 10 kg cookie and 10 kg donut (revenue $50$)?

Question 4

Does the starting direction change the final answer?

Card Info
  • Topic: Linear programming, StatQuest
  • Difficulty: Beginner
  • Completed: 0 users
Creator
Best
Best
BestBuddy