Applied Metaphors: Learning TRIZ, Complexity, Data/Stats/ML using Metaphors
  1. Teaching
  2. Data Analytics for Managers and Creators
  3. Prescriptive Modelling
  4. πŸ’­ The Simplex Method - Intuitively
  • Teaching
    • Data Analytics for Managers and Creators
      • Tools
        • Introduction to R and RStudio
        • Introduction to Radiant
        • Introduction to Orange
      • Descriptive Analytics
        • Data
        • Summaries
        • Counts
        • Quantities
        • Groups
        • Densities
        • Groups and Densities
        • Change
        • Proportions
        • Parts of a Whole
        • Evolution and Flow
        • Ratings and Rankings
        • Surveys
        • Time
        • Space
        • Networks
        • Experiments
        • Miscellaneous Graphing Tools, and References
      • Statistical Inference
        • 🧭 Basics of Statistical Inference
        • 🎲 Samples, Populations, Statistics and Inference
        • Basics of Randomization Tests
        • πŸƒ Inference for a Single Mean
        • πŸƒ Inference for Two Independent Means
        • πŸƒ Inference for Comparing Two Paired Means
        • Comparing Multiple Means with ANOVA
        • Inference for Correlation
        • πŸƒ Testing a Single Proportion
        • πŸƒ Inference Test for Two Proportions
      • Inferential Modelling
        • Modelling with Linear Regression
        • Modelling with Logistic Regression
        • πŸ•” Modelling and Predicting Time Series
      • Predictive Modelling
        • πŸ‰ Intro to Orange
        • ML - Regression
        • ML - Classification
        • ML - Clustering
      • Prescriptive Modelling
        • πŸ“ Intro to Linear Programming
        • πŸ’­ The Simplex Method - Intuitively
        • πŸ“… The Simplex Method - In Excel
      • Workflow
        • Facing the Abyss
        • I Publish, therefore I Am
      • Case Studies
        • Demo:Product Packaging and Elderly People
        • Ikea Furniture
        • Movie Profits
        • Gender at the Work Place
        • Heptathlon
        • School Scores
        • Children's Games
        • Valentine’s Day Spending
        • Women Live Longer?
        • Hearing Loss in Children
        • California Transit Payments
        • Seaweed Nutrients
        • Coffee Flavours
        • Legionnaire’s Disease in the USA
        • Antarctic Sea ice
        • William Farr's Observations on Cholera in London
    • R for Artists and Managers
      • πŸ•Ά Lab-1: Science, Human Experience, Experiments, and Data
      • Lab-2: Down the R-abbit Hole…
      • Lab-3: Drink Me!
      • Lab-4: I say what I mean and I mean what I say
      • Lab-5: Twas brillig, and the slithy toves…
      • Lab-6: These Roses have been Painted !!
      • Lab-7: The Lobster Quadrille
      • Lab-8: Did you ever see such a thing as a drawing of a muchness?
      • Lab-9: If you please sir…which way to the Secret Garden?
      • Lab-10: An Invitation from the Queen…to play Croquet
      • Lab-11: The Queen of Hearts, She Made some Tarts
      • Lab-12: Time is a Him!!
      • Iteration: Learning to purrr
      • Lab-13: Old Tortoise Taught Us
      • Lab-14: You’re are Nothing but a Pack of Cards!!
    • ML for Artists and Managers
      • πŸ‰ Intro to Orange
      • ML - Regression
      • ML - Classification
      • ML - Clustering
      • πŸ•” Modelling Time Series
    • TRIZ for Problem Solvers
      • I am Water
      • I am What I yam
      • Birds of Different Feathers
      • I Connect therefore I am
      • I Think, Therefore I am
      • The Art of Parallel Thinking
      • A Year of Metaphoric Thinking
      • TRIZ - Problems and Contradictions
      • TRIZ - The Unreasonable Effectiveness of Available Resources
      • TRIZ - The Ideal Final Result
      • TRIZ - A Contradictory Language
      • TRIZ - The Contradiction Matrix Workflow
      • TRIZ - The Laws of Evolution
      • TRIZ - Substance Field Analysis, and ARIZ
    • Math Models for Creative Coders
      • Maths Basics
        • Vectors
        • Matrix Algebra Whirlwind Tour
        • content/courses/MathModelsDesign/Modules/05-Maths/70-MultiDimensionGeometry/index.qmd
      • Tech
        • Tools and Installation
        • Adding Libraries to p5.js
        • Using Constructor Objects in p5.js
      • Geometry
        • Circles
        • Complex Numbers
        • Fractals
        • Affine Transformation Fractals
        • L-Systems
        • Kolams and Lusona
      • Media
        • Fourier Series
        • Additive Sound Synthesis
        • Making Noise Predictably
        • The Karplus-Strong Guitar Algorithm
      • AI
        • Working with Neural Nets
        • The Perceptron
        • The Multilayer Perceptron
        • MLPs and Backpropagation
        • Gradient Descent
      • Projects
        • Projects
    • Data Science with No Code
      • Data
      • Orange
      • Summaries
      • Counts
      • Quantity
      • πŸ•Ά Happy Data are all Alike
      • Groups
      • Change
      • Rhythm
      • Proportions
      • Flow
      • Structure
      • Ranking
      • Space
      • Time
      • Networks
      • Surveys
      • Experiments
    • Tech for Creative Education
      • 🧭 Using Idyll
      • 🧭 Using Apparatus
      • 🧭 Using g9.js
    • Literary Jukebox: In Short, the World
      • Italy - Dino Buzzati
      • France - Guy de Maupassant
      • Japan - Hisaye Yamamoto
      • Peru - Ventura Garcia Calderon
      • Russia - Maxim Gorky
      • Egypt - Alifa Rifaat
      • Brazil - Clarice Lispector
      • England - V S Pritchett
      • Russia - Ivan Bunin
      • Czechia - Milan Kundera
      • Sweden - Lars Gustaffsson
      • Canada - John Cheever
      • Ireland - William Trevor
      • USA - Raymond Carver
      • Italy - Primo Levi
      • India - Ruth Prawer Jhabvala
      • USA - Carson McCullers
      • Zimbabwe - Petina Gappah
      • India - Bharati Mukherjee
      • USA - Lucia Berlin
      • USA - Grace Paley
      • England - Angela Carter
      • USA - Kurt Vonnegut
      • Spain-Merce Rodoreda
      • Israel - Ruth Calderon
      • Israel - Etgar Keret
  • Posts
  • Blogs and Talks

On this page

  • What is the Simplex Method?
  • A Random Walk with the Simplex Method
  • Procedure
  • Summary
  1. Teaching
  2. Data Analytics for Managers and Creators
  3. Prescriptive Modelling
  4. πŸ’­ The Simplex Method - Intuitively

πŸ’­ The Simplex Method - Intuitively

Published

November 14, 2022

Modified

May 21, 2024

Abstract
We will look at developing an intuitive understanding of the Simplex Method for Linear Programming.
knitr::opts_chunk$set(
  echo = FALSE,
  collapse = TRUE,
  #cache = TRUE, autodep = TRUE, 
  comment = "#",
  fig.show = "asis", 
  warning=FALSE, message=FALSE, fig.align = "center",
  scipen = 1, digits = 2)

library(tidyverse)
library(plotly)
library(gMOIP)

What is the Simplex Method?

To be written up.

A Random Walk with the Simplex Method

Let us try to form a geometric intuition for the Simplex method.

We will define an LP problem, and geometrically traverse the steps the Simplex method might take to solve for the optimum solution.

Let us define a problem:

Maximise 7.75x1+10x2 Subject to{C1:βˆ’3x1+2x2<=3C2:2x1+4x2<=27C3:9x1+10x2<=90x1,x2>=0

The Objective function is: 7.75x1+10x2

The Constraints are defined by the three inequalities C1::C3. In order to plot these, we convert the inequalities to equalities and plot these as lines. Each line splits the x1:x2 plane into two half-planes. The inequality part is then taken into account by choosing the appropriate half-plane created by the equation. The intersection of all the half-planes defined by the constraints is the Feasibility Region.

The Feasibility region for this LP problem is plotted below:

The corner points of the Feasibility Region are:

ABCDEFGHIJ0123456789
name
<chr>
x1
<dbl>
x2
<dbl>
A0.0000.0000
B10.0000.0000
C5.6253.9375
D2.6255.4375
E0.0001.5000
5 rows

Recall that:

  • The optimum in an LP problem is found on the boundary, at one of the vertices
  • At each of these vertices one or more constraints (C1::Cn) is tight, i.e. there is no slack.

Procedure

  1. We start with an arbitrary point on the edge of the Feasibility Region. A=(0,0) is a common choice. At this point, since all variables are 0, the objective function is also 0.

  2. We (arbitrarily) decide to move along the boundary of the Feasibility Region, to another FSP. We arbitrarily chose the x1 axis, and set/keep x2=0. We now wish to find out the x1 coordinate of the next FSP point. This would be at the intersection of the x1 axis and one of the Constraint lines.
    All the three Constraint Lines would possibly intersect the x1 axis. We need to choose that intercept point that has the smallest, non-negative x1 intercept value. (Why?)
    So, which Constraint Line intersects the x1 axis at the smallest value? Is it point B, or point F?
    To find out, we substitute x2=0 in each of the Constraint equations, and solve for the x1:
    {C1:βˆ’3x1+2Γ—0=3 =>x1=βˆ’1C2:2x1+4Γ—0=27 =>x1=13.5 Point FC3:9x1+10Γ—0=90 =>x1=10 Point B
    Negative values for any variable are not permitted. So the smallest value of intercept is x1=10 for Constraint C3. We therefore move to point B(10,0). At this point the objective function has improved to:

Objective=7.75Γ—10+10Γ—0=77.5 at Point B

  1. We now start from Point B, and move to the next nearest point. In identical fashion to Step2, we β€œimagine” that we move along a new axis defined by:
    Intercept=Point B(10,0) Equation=Constraint C3:9x1+10x2=90 We express x1 in terms of x2 with C3: C^3:x1=90βˆ’10x29 As in Step 2, we substitute this equation C^3 into the other two constraints, C1 and C2: {C1:βˆ’3Γ—90βˆ’10x29+2x2=3 =>x2=6.18 Point KC2:2Γ—90βˆ’10x29+4x2=27=>x2=3.93 Point C As before we choose the smaller of the two intercepts, so x2=3.93. Calculating for x1, we get point C(5.63,3.93). At this point the objective function has improved to:

7.75Γ—5.63+10Γ—3.93=82.9 at Point C

  1. We now proceed along the constraint line C2 towards the next point. In identical fashion to Step 2 and 3, we β€œimagine” that we move along a new axis defined by: Intercept=Point C(5.63,3.93) Equation=Constraint C2:2x1+4x2=27 Again, We express x1 in terms of x2 with C2 this time: C^2:x1=27βˆ’4x22 As in Step 2 and, we substitute this equation C^2 into the other constraint, the only remaining C1: C1:βˆ’3Γ—27βˆ’4x22+2x2=3 =>x2=5.44 Point D Calculating for x1, we get point C(2.63,5.44). At this point the objective function has improved decreased to: 7.75Γ—2.63+10Γ—5.44=74.8 at Point D Since this value for the Objective function is smaller than that at the previous point, our search terminates and we decide that Point C(5.63,3.93) is the optimal point.
    So the final result is: x1(max)=5.63 x2(max)=3.93 Maximum Objective Function Value=82.9 The final result is plotted below:

Summary

The essence of this β€œintuitive method” can be captured as follows:

  1. Start from a known simple point on the edge of Feasibility Region, e.g. (0,0), since the two coordinate axes frequently form two edges to the Feasibility Region.
  2. Move along one of the axis to find a first adjacent edge point. This adjacent point corresponds to the β€œtightening” of one or other of the Constraint equations(i.e. slack = 0 for that Constraint)
  3. Calculate the Objective function at that point.
  4. Use this new point as the next starting point and move along the Constraint line from the previous step.
  5. Repeat step 2 and 3, calculating the Objective function each time.
  6. Keep the solution point where the objective function hits a maximum, i.e. when moving to the next point reduces the value of the Objective function.

Back to top
πŸ“ Intro to Linear Programming
πŸ“… The Simplex Method - In Excel

License: CC BY-SA 2.0

Website made with ❀️ and Quarto, by Arvind V.

Hosted by Netlify .