Send Close Add comments: (status displays here)
Got it!  This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
LPSolves solution
by RS  admin@robinsnyder.com : 1024 x 640


1. LPSolves solution
The following is a textual specification of the linear programming problem that was just solved using the graphical method.
// File: cbars-01.rlp // Title: Chocolate bar problem // Author: Robin Snyder // Created: 1997/11/22 08:03 // Updated: 1997/11/22 08:03 title "Chocolate bars" author "Robin Snyder" source "Robin Snyder" linear program var x1 "Galaxy bars (lots)" x2 "Continental bars (lots)" max 2 x1 + 3 x2 "profit ($)" st 3 x1 + 1 x2 <= 18 "milk (tons)" 1 x1 + 2 x2 <= 12 "cocoa (tons)" 3 x1 + 3 x2 <= 21 "sugar (tons)" end

After being run, the output is as follows.
LPSolves (v0.1, 08-13-97) Copyright (c) 1996 by Robin Snyder File: F:\RLP\cbars-01.rlp Time: 1997/11/22 at 09:37 Title: "Chocolate bars" Author: "Robin Snyder" Source: "Robin Snyder" Variables: 1. x1 "Galaxy bars (lots)" 2. x2 "Continental bars (lots)" Problem: Maximize 2 x1 + 3 x2 "profit ($)" Such that 3 x1 + x2 <= 18 "milk (tons)" x1 + 2 x2 <= 12 "cocoa (tons)" 3 x1 + 3 x2 <= 21 "sugar (tons)" End Phase 1: A basic feasible solution has been found. Phase 2: R E S U L T S : (* = basis variable) ------------- Objective coefficient ranges: (solution unchanged) Coefficient Lower Current Upper of variable limit value limit ----------- ----- ------- ----- *x1 1.5 2 3 Galaxy bars (lots) *x2 2 3 4 Continental bars (lots) Solution (variable) results: Reduced Variable Value cost -------- ----- ------- *x1 2 0 Galaxy bars (lots) *x2 5 0 Continental bars (lots) Shadow Variable Value price ---------- ----- ------ *$3 7 0 Slack (milk (tons)) $4 0 -1 Slack (cocoa (tons)) $5 0 -0.333 Slack (sugar (tons)) Right hand side ranges: (solution unchanged) Right side Lower Current Upper constraint limit value limit ----------- ----- ------ ----- *1. 11 18 none milk (tons) 2. 8.5 12 14 cocoa (tons) 3. 18 21 25.2 sugar (tons) Objective (overall) result: Objective Value --------- ----- z 19 profit ($)

Note that the optimum value of the objective function is the same as determined by the graphical method.

2. Sensitivity analysis
A sensitivity analysis attempts to determine what effect a change in the parameters of the problem (the input) will have on the solution (the output) without solving the problem (e.g., running the corresponding program) again. Since the analysis is done after a solution to a given problem is determined, sensitivity analysis is often called post-optimality analysis.

Some relevant questions involving LP sensitivity analysis are the following. Some relevant cost and price concepts are the following.

3. Case problem: linear programming
Consider the following problem. The entire problem hinges on a proper identification and definition of the variables involved. The following is an LP formulation of this problem.
// File: exam.rlp // Title: Exam problem // Author: Robin Snyder // Created: 1997/11/22 09:39 // Updated: 1997/11/22 09:39 title "Exam time allocation problem" author "Robin Snyder" source "Robin Snyder" linear program var x1 "fraction of 9 questions answered" x2 "fraction of other question answered" max 180 x1 + 20 x2 "total score" st 90 x1 + 60 x2 <= 100 "overall time constraint" x1 <= 1 "constraint of 9 questions" x2 <= 1 "constraint of other question" end

A solution to this problem is as follows.
LPSolves (v0.1, 08-13-97) Copyright (c) 1996 by Robin Snyder File: F:\RLP1\exam.rlp Time: 1997/11/22 at 09:39 Title: "Exam time allocation problem" Author: "Robin Snyder" Source: "Robin Snyder" Variables: 1. x1 "fraction of 9 questions answered" 2. x2 "fraction of other question answered" Problem: Maximize 180 x1 + 20 x2 "total score" Such that 90 x1 + 60 x2 <= 100 "overall time constraint" x1 <= 1 "constraint of 9 questions" x2 <= 1 "constraint of other question" End Phase 1: A basic feasible solution has been found. Phase 2: R E S U L T S : (* = basis variable) ------------- Objective coefficient ranges: (solution unchanged) Coefficient Lower Current Upper of variable limit value limit ----------- ----- ------- ----- *x1 30 180 none fraction of 9 questions answered *x2 0 20 120 fraction of other question answered Solution (variable) results: Reduced Variable Value cost -------- ----- ------- *x1 1 0 fraction of 9 questions answered *x2 0.167 0 fraction of other question answered Shadow Variable Value price ---------- ----- ------ $3 0 -0.333 Slack (overall time constraint) $4 0 -150 Slack (constraint of 9 questions) *$5 0.833 0 Slack (constraint of other question) Right hand side ranges: (solution unchanged) Right side Lower Current Upper constraint limit value limit ----------- ----- ------ ----- 1. 90 100 150 overall time constraint 2. 0.444 1 1.111 constraint of 9 questions *3. 0.167 1 none constraint of other question Objective (overall) result: Objective Value --------- ----- z 183.333 total score

The 2-phase method is used. Phase 1 attempts to minimize a modified objective function (z) to get a starting feasible solution (z = 0 when minimized). Phase 2 uses the original objective function. At each step during these phases, a variable will enter the basis and another variable will leave the basis, such that the objective function is improved. Notice the change to the z value in each step of each phase.

The sensitivity analysis for the right hand side indicates that the solution would not change until one (and only one) of the following were done. The sensitivity analysis for the coefficients indicates that the solution would not change until (pick one of these): The solution for x1 is 1.00, indicating that 100.0% of the time should be spent on the easy questions. The solution for x2 is 0.167, indicating that 16.7%, or the remainder, of the time should be spent on the hard problem.

The maximum score for this problem, as stated, is 183 points (rounded).

4. Short answer questions
1. What is sensitivity analysis and why is it important?

2. What is another name for sensitivity analysis?

3. What happens when a coefficient ci of the objective function z = c1 x1 + c2 x2 + ..., is changed? Be specific.

4. What happens when a right side coefficient bi of a constraint ai,1 x1 + ai,2 x2 + ... <= bi is changed? Be specific.

by RS  admin@robinsnyder.com : 1024 x 640