Web Solver
A Web page to solve linear programming problems using the simplex method
How to Use the Solver
This Web page explains how to use WebSolver
in conjunction with instructional materials to solve linear programming
problems. I will not describe the simplex method here. WebSolver
is designed to assist the student enrolled in an upper division or graduate
course to understand the method. This description is not meant to be a
self-contained tutorial on linear programming.
If you don't know what linear programming is, or are not sufficiently
familiar with it, you may not understand all or part of this discussion.
Please see the excellent references located
at the bottom of this page for an introduction to the science of linear
programming, and to learn more about the simplex method for solving
linear programming problems.
The Canonical Problem
The objective in a linear programming (LP) problem is to
maximize |
Z=ctx |
x1,x2,...,xn |
|
subject to |
|
Ax <= b |
x1,x2,...,xn |
>= 0 |
where
x1,x2,...,xn
are the control variables. While any feasible problem may be written
in this form, WebSolver allows the user to minimize, and allows
less than, greater than, and equality constraints. Just remember
that <= is the same as <, and >= is the same as >.
Example 1
You may wish to solve the following LP problem:
Maximize |
x1 |
+ |
2x2 |
+ |
3x3 |
subject to |
3x1 |
+ |
2x2 |
+ |
2x3 |
= |
3 |
|
2x1 |
+ |
3x2 |
+ |
x3 |
<= |
2 |
|
This problem would be input into WebSolver as follows:
max 1 2 3
3 2 2 = 3
2 3 1 < 2
(You may wish to cut this out and paste it into WebSolver
using your operating system's clipboard to see what it does.) Pressing
the Evaluate button produces a sequence of tables (called tableaus in LP-speak),
ending with the following output:
x1 |
x2 |
x3 |
x4 |
C |
1.5 |
1 |
1 |
0 |
1.5 |
= |
0.5 |
2 |
0 |
1 |
0.5 |
< = |
-3.5 |
-1 |
0 |
0 |
-4.5 |
Max |
Final values:
Variable |
Value |
x1 |
0 |
x2 |
0 |
x3 |
1.5 |
Slack |
Value |
Dual |
x4 |
0.5 |
-0 |
Optimum |
Z |
4.5 |
The first table shown above is the final tableau one might obtain when
solving with pencil and paper. WebSolver interprets this tableau
and places this information in the last table. The second table above reports
the final values of the control variables that obtain the largest value
for Z, the objective function. This is followed by the values of the so-called
slack variables. Slack is the distance of the left-hand side of a constraint
from the right-hand side at the optimum. The dual values (or shadow prices)
associated with each of the constraints are reported next to them. Finally,
WebSolver
reports the optimum value of Z. In a maximization problem, this is
the highest attainable value; in minimization, the lowest.
This LP problem might more properly be written as
max 1 2 3
3 2 2 < 3
3 2 2 > 3
2 3 1 < 2
where the equality constraint is now represented by two inequalities.
WebSolver
now produces the following output:
x1 |
x2 |
x3 |
x4 |
x5 |
x6 |
C |
1.5 |
1 |
1 |
0.5 |
0 |
0 |
1.5 |
< = |
0 |
0 |
0 |
-1 |
-1 |
0 |
0 |
> = |
0.5 |
2 |
0 |
-0.5 |
0 |
1 |
0.5 |
< = |
-3.5 |
-1 |
0 |
-1.5 |
0 |
0 |
-4.5 |
Max |
Final values:
Variable |
Value |
x1 |
0 |
x2 |
0 |
x3 |
1.5 |
Slack |
Value |
Dual |
x4 |
0 |
1.5 |
x5 |
0 |
0 |
x6 |
0.5 |
-0 |
Optimum |
Z |
4.5 |
This output more clearly shows that the first constraint is binding
from below and has a shadow price of 1.5.
Example 2
The Diet Problem
In the diet problem a consumer is presented with a collection of foods,
each providing a certain amount of the nutrients necessary for survival.
Ignoring taste considerations, she wishes to minimize cost subject to the
condition that all of her nutritional requirements are satisfied. Suppose
that her decision problem can be represented in the following table:
Protein
Vitamin C
Iron
Cost |
Arugula
0.4
6
0.4
8 |
Bean Sprouts
1.2
10
6
10 |
Cheeze Whiz
0.6
3
0.4
3 |
Dolmas
0.6
1
0.2
20 |
Elderberries
12.2
0
2.6
15 |
Requirements
70
50
12 |
In WebSolver, her problem should be written as follows:
min 8 10 3 20
15
0.4 1.2 0.6 0.6 12.2
> 70
6 10 3
1 0 > 50
0.4 0.6 0.4 0.2
2.6 > 12
As you can see, spacing and alignment of columns is irrelevant, but
notice that 0 must be entered as a placeholder. To see the process of arriving
at the solution of this problem, copy the code, paste into the text field
in WebSolver and press Evaluate. The final output is reproduced
here:
x1 |
x2 |
x3 |
x4 |
x5 |
x6 |
x7 |
x8 |
C |
0.23 |
0.563 |
0 |
0.0186 |
0 |
-0.213 |
-0.0907 |
1 |
7.45 |
> = |
2 |
3.33 |
1 |
0.333 |
0 |
0 |
-0.333 |
0 |
16.7 |
> = |
-0.0656 |
-0.0656 |
0 |
0.0328 |
1 |
-0.082 |
0.0164 |
0 |
4.92 |
> = |
2.98 |
0.984 |
0 |
18.5 |
0 |
1.23 |
0.754 |
0 |
-124 |
Min |
Final values:
Variable |
Value |
x1 |
0 |
x2 |
0 |
x3 |
16.7 |
x4 |
0 |
x5 |
4.92 |
Slack |
Value |
Dual |
x6 |
0 |
1.23 |
x7 |
0 |
0.754 |
x8 |
7.45 |
0 |
Optimum |
Z |
124 |
The table indicates that she should consume 16.7 units of Cheeze Whiz,
and 4.92 units of Elderberries at a cost of 124. She should consume
zero of the other items, since the amount of nutrition per dollar spent
is too high given her preferences. The first two constraints, Protein
and
Vitamin
C are binding, while the Iron constraint is not. The non-zero
dual values on these constraints indicate the value of reducing her requirement
for either nutrient by one unit. For example, she should be willing
to pay 1.23 for a food item that would provide one unit of protein, and
0.754 for one that provides one unit of Vitamin C.
Of course, no consideration of other health issues are present.
If a constraint was introduced to limit her intake of fat, a different
diet might well have been recommended.
That's pretty much all you need to know, assuming you have textbook in
hand. If any of the coefficients are zero, you must enter them as placeholders.
If you submit an unbounded or cycling problem that the program doesn't
recognize, rest assured that the program will stop after 15 iterations.
Also, you might want to avoid submitting very large problems. You are limited
to 30 control and slack variables. This is an ancient NeXT cube,
have a heart!
Run WebSolver
Word has it this program always arrives at the correct solution. If
you think otherwise, or you have trouble with the program please send me
e-mail with a description of what happened. I will fix the problem ASAP.
References
Chvátal, Vasek (1983) Linear Programming, W. H. Freeman
and Company, New York. ISBN 0-7167-1587-2, or 0-7167-1587-8.
Thie, Paul R. (1988) An Introduction to Linear Programming
and Game Theory, John Wiley and Sons, New York. ISBN 0-471-62488-8.
WebSolver version 1.0, by Geoffrey R.
Gerdes. Copyright 1996. This page, copyright 1996,1999. All rights
reserved.
free black adult sites, amateur girlfriend, anal rape, asian bondage, ass licking, asshole stretching, bbw thumbnail, bdsm washington dc, daytona beach airport, beastiality blog, adolescent bikini girls, , tight bitches, hot busty blondes, tiny teen blowjob, bondage wear, growing boobs, boot and nuke, brazil carnival photos erotic, brunettes lesbians, big butt tgp, hidden shower cam, hot cartoon sluts, free naked male celebs, celebreties naked, naked teen cheerleaders, horny chicks, bbw chubby galleries, lesbian closeup, hung monster cocks, blonde coed babes, creampie secretarylesbien, cock eating cum sluts, dad fucking son dad and son incest, dating married women advice, foot long dicks, largest dildo made, dirty little secret all-american rejects, , download adult dvd movies, ebony female, femdom erotica stories, ethnic nude photographs, cum on her face orgy, facial skin care watauga, fantasy fest photos, free fat cocksuckers, lesbian feet, female orgasm clips, pvc fetish, ffm japan, fisting mpegs, flexible spending account guidelines, free hardcore porn clips, finger fuck pussy, largest gang bang, bondage gangbang, free gay porn pics, gothics nude, dads naked, adult groups for pspers, , busty handjob, hardcore disney toons, naked anime, housewives having sex, mom and son sex incest, hot indian women naked, latin women naked, babes sading there legs, ebony lesbian threesome, hot women in lingerie, live cb scanner, sybian machine video, maids in bondage, straight male pornstars, clit water masturbation, mature porn clips, huge milf melons, naked model men, midget girls, milf wife, military classified sex, mom anal, fuck me in the mouth, , nail whitening pencil, naked massage, extremely long nipples, nude hunks, nurse nurse having sex, nylons cum, delete copy office xp, women giving oral sex, girls orgasms, roll down shade outdoors, , sex toy party friends, toddlers bo peep costume, massive pussy penetrations, pokemon hentai porn, pornstar lingerie, sexy pregnant lingerie, public sex video, teen latina pussy, chun li rape, reality sex movies, teen redhead sex, scat playjap, underage schoolgirls, michigan secretary state license, sex talk, my shaved pussy, teenage shemales, bathroom shower stalls, butt silicone injections, skirts for skinny legs, hot wife slut, michelle raven smoking during sex, , hot girls in stockings, teen muscle studs, deep suck, swallow blowjobs, gm's interest rate swaps, tanned nude women, female tattoo pics, young teens in thongs, teens in micro thongs, free deep throat mpeg, tiny eve, titanic tits, toon facials, how to make a sex toy, well hung trannies, trans am bumper brackets, twink tgp, confederate soldier uniform, fergie upskirt, latin vagina, porn video, black voyeur pussy, wives gone wild, xxx pass, young models nude, sonic youth moist vagina, metro toronto zoo map, free adult pictures of ass licking ladies, hot amateur, hot teen anal, asian porn stars having sex, pussy ass lickers, denis leary asshole mp3, gigantic old bbw, bdsm galleries, granbury texas private beach, beastiality- free sample movie trailers, bikini, bisexual cumshots, old bitch, met art blonde 02, ebony blowjobs, bondage toons, cute boobs, hand made cowboy boots, brazil, wet brunettes, lesbian butts, nude cam, sexy cartoon, free nude fake celebs, pictures nude male celebreties, accidental cheerleader nudity, naughty chicks, chubby girl getting fucked, shaved closeup, cock pumping, girl college coeds, creampie ebony, gallery cum cum, dad fuckes my girlfriend, dating direct uk, guys dick, deep dildo, , domination and bondage long island, asian adult dvds, ebony lesbian pussy, erotica feminine beauty, ethnic facials, boca raton face lift, cumshots facials, final fantasy hentai doujinshi, fat gay men, hot teen feet, female catfights apartment wrestling, male underwear fetish, anal ffm, cunt fisting, flexible blowjob, free nude movies, boss fuck secretary, , slut gangbangs, gay twins having sex, gothic nude pics, dad fuck me, hardcore group, hairy pussy sex, mpegs handjob, angelina jolie hardcore, gundam seed hentai, housewives sex gallery, 3d incest art, lesbian indian, gay latin, long teen legs, , busty lingerie, live scanner broadcasting, blood ssure machine, humiliate sissy maid, male cumshots, masturbation party, mature blowjob galleries, large puffy melons, gay asian men, midgets deepthroating, milf 20, nc military gays, mom and son incest, dick in my mouth, free horse fucker movies, toe nail falling off, naked volleyball, nipple cover, christina aguilera nude gallery, small penis nurse stories, nylon lesbian, lesbian office sex free, free oral sex pictures thumbnails, hypnosis orgasm, outdoor orgies, paris hilton sucking, , the peep hole adult movie, penetration masturbation, porn video, big tit pornstar, could i be pregnant, free public sex video galleries, teen cock in pussy, science fiction book title carefully planned rape, adult reality video, underage redheads, sg video scat, hot sexy blonde schoolgirls, arts and craft style, teenage sex, shaved guy, shemale fuck, sterling shower doors, large silicone dildos, skinny teen girl, underage slut galleries, stop smoking zyban, belt spanking, sexy silk stockings, barebacking studs, young girls that suck dick, don't spit swallow cum, honda civic engine swap v-tec, riviera tanned butts, great breast tattoo, , teeny thong, cancer picture symptom throat, teenie tiny titties, huge mature tits, hot toon pussy porn, sex toy home party, tranny lovers, mai tran model mayhem, twink boy, ex police uniforms, oops upskirt, inserting penis into vagina, free lesbian video clips, free voyeur cams. com, hump your wife, free xxx toons, very young teens in bikini's, youth fashion models, zoo sex comics,