Post Reply 
Simplex method in prime how to use the constrains maximise s.t. constraints.
11-02-2023, 09:20 PM (This post was last modified: 11-02-2023 11:08 PM by Albert Chan.)
Post: #9
RE: Simplex method in prime how to use the constrains maximise s.t. constraints.
(11-01-2023 07:32 PM)HPCarnace Wrote:  ... as dg1969 suggests it is better with "AND" (the feasible region is shown more clearly)

Still, with overlapping regions, it is very hard to spot the solution.
Even *after* we have the solution, confirming with plots may be tough.
This is especially true if slopes are close, which made polygon look like circle.

It may be better to plot something else ...

C = 6x + 5y --> y = (C-6x)/5
Elminate y from constraints, and solve for C

L1: 2x + 4y ≥ 22      → C ≥ 3.5x + 27.5
L2: 3x + 2y ≥ 20      → C ≥ -1.5x + 50
L3: 4x + 5y ≥ 40      → C ≥ 2x + 40

For vertices, inequality changed to equal sign. With x≥0, we have:
L1: C ≥ 27.5
L2: C ≤ 50
L3: C ≥ 40               → 40 ≤ C ≤ 50

If we plot below (V1,V2,V3), min(C) is the "lowest" intersection.
If a ball fall from the sky, min(C) is where it landed.

gnuplot> V1(x) = 3.5*x + 27.5
gnuplot> V2(x) = -1.5*x + 50
gnuplot> V3(x) = 2*x + 40
gnuplot> set terminal dumb
gnuplot> plot [0:5] [40:50] V1(x), V2(x), V3(x)

Code:
  50 ###-----------+-------------+-------------+-------------+------------$$
     +  #####      +             +             +             +V1(x) ****** +
     |       #####                                            V2(x)$###### |
     |            #####                                       V3(x) $$$$$$ |
  48 ++                #####                               $$$$           ++
     |                      #####                      $$$$                |
     |                           #####              $$$                    |
     |                                #####    $$$$$                       |
  46 ++                                   ######                          ++
     |                                  $$$$   #####                       |
     |                               $$$$           #####                 **
  44 ++                          $$$$                    #####         ***++
     |                       $$$$$                            #####  ***   |
     |                    $$$                                      ***##   |
     |                $$$$                                       ***   #####
  42 ++           $$$$                                         **         ++
     |         $$$$                                          **            |
     |     $$$$                                            **              |
     + $$$$        +             +             +         **  +             +
  40 $$------------+-------------+-------------+-------**----+------------++
     0             1             2             3             4             5

Even with crude ASCII plot, we get min(C) ≈ 46, from V2, V3 intersection.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Simplex method in prime how to use the constrains maximise s.t. constraints. - Albert Chan - 11-02-2023 09:20 PM



User(s) browsing this thread: 5 Guest(s)