You are on page 1of 9

Class 8_09.

24_Tuesday

Transportation Problems (network problems): ​multiple entities that connect with each other transferring things
from one to another.
- how to transfer in the best effective way? -​ > ​MINIMIZE​ the shipping costs while keeping the arrival
needs and operating in shipping location capacity.

XYZ Sawmill Company

NETWORK DIAGRAM:​ ​summarize relevant information for the linear problem.

1. Origin Nodes: ​logging sites (from)


2. Destination Nodes: ​mills (to)
3. Arcs: ​possible routes from origins to destination
4. Supply: ​amount AVAIABLE for the ORIGIN.
5. Demand: ​amount REQUIRED at the DESTINATION.
6. Truckload: ​cost of moving ONE unit along each rote.
What I want? ​MINIMIZE the TOTAL cost of hauling logs each day WHILE meeting each mill’s demand and not
exceeding truckloads/day available for each log site.

Building the problem before going to solver:

What I control to achieve my goal? ​Number of truckload/day are delivered between each site and each mill ​ ​ one
variable for each arc (possible routes)

What is my total cost? ​Number of truckloads delivered in each route*cost per truckload in each route

1) Objective function: MINIMIZE (​ check: daonde saiu esse X11??X21???)


32X11 + 40X21 + 120X31 + 60X12 + 68X22 + 104X32 + 200X13 + 80X23 + 60X33 = Z

2) Constraints: amount shipped must be equal Mill’s demand and amount shipped from each log site can’t
exceed site’s capacity.

3.1. Demand shipped to Mill A ​ ​ X11 + X21 + X31 = 30


3.2. Demand shipped to Mill B ​ ​ X12 + X22 + X32 = 35
3.3. Demand shipped to Mill C ​ ​ X13 + X23 + X33 = 30
3.4. Truckload from Site 1 within capacity ​ ​ X11 + X12 + X13 =< 20
3.5. Truckload from Site 2 within capacity ​ ​ X21 + X22 + X23 =< 30
3.6. Truckload from Site 3 within capacity ​ ​ X31 + X32 + X33 =< 45
3.7. nonnegative numbers ​ ​ X11, X12, X13, X21, X22, X23, X31, X32, X33 > 0

3) Variations in this type of problems?

1) One of the Arcs (routes) has limited capacity or is temporarily unavailable ​ ​ create and add special
constraints to fulfill this condition.
2) Not enough supply (capacity) in the origin to supply total demand for all destinations ​ ​ switch signs
for demand “=<” and for supply “=”.
▪ The model will accept to appoint less supply than the full demand for ship to one or all
destinations
▪ Force the shipment of all supply available at the origin nodes ​ ​ solution will supply as
much as possible
▪ At least one destination will receive less than required demand. ​WHICH ONE?​ ​Model
define it according to shipping cost (remember objective is minimize cost) ​– unless other
changes are made and then it calculates in other way.
Revenue Management Problem (optimization modeling): ​how to get the MAXIMUM revenue com firm’s current
assets.
- How can firm get maximum revenue from EVERY G&S available?​ - model attempt to find the MAXIMUM
revue a firm can get by selling service from fixed assets

Leisure Airlines
Infos:
2 aircraft – 132 seats/each
One star in Pittsburgh, one in Newark ​ ​ BOTH to Charllote (morning)
Charllote ​ ​ Orlando OR Myrtle Beach each (afternoon)
Orlando or Myrtle beach ​ ​ home base.

Selling & Price options: 16 types of ticket in 2 categories – differ according its and from-to

Q CLASS (discount)
Y CLASS (full fare): change flight any time without extra costs.

How to MAXIMIZE these two flights? = how many tickets to sell of each?

FORMULATION on SOLVER

1. Decision Variables:

PCQ: # of tickets TO OFFER PT-CH (q class)


PMO: # of tickets TO OFFER PT-MB (q class)…until COY

2. Objective Function:​ $/ticket*# of tickets I will offer in each leg

MAX Z (right-hand side): ​178PCQ + 268PMQ + 228POQ + 380PCY + 456PMY + 560POY


+ 199NCQ + 249NMQ + 349NOQ + 385NCY + 444NMY + 580NOY + 179CMQ + 380CMY + 224COQ
+ 582COY

3. Constraints: ​# of seats in each aircraft (132), demand for each flight and nonnegativity

3.1 Pittsburg to Charllote


PCQ + PCY + PMQ + PMY + POQ + POY =< 132
3.2 Newark to Charllote
NCQ + NCY + NMQ + NMY + NOQ + NOY =< 132
3.3 Charlotte to Myrtle Beach
PMQ + PMY + NMQ + NMY + CMQ + CMY =< 132
3.3 Charlotte to Orlando
POQ + POY + NOQ + NOY + COQ + COY =< 132

3.4 Demand restrictions – I won’t sell more than my demand if I want to MAXIMIZE (lose money)
PCQ ≤ 33 NCY ≤ 15
PMQ ≤ 44 NMY ≤ 7
POQ ≤ 45 NOY ≤ 9
PCY ≤ 16 CMQ ≤ 64
PMY ≤ 6 CMY ≤ 8
POY ≤ 11 COQ ≤ 46
NCQ ≤ 26 COY ≤ 10
NMQ ≤ 56
NOQ ≤ 39
3.5 Nonnegativity
PCQ + PMQ + POQ + PCY + PMY + POY + NCQ + NMQ + NOQ + NCUY + NMY + NOY +
CMQ + CMY + COQ + COY >= 0
INTEGER PROGRAMMING:​ ​LP model are assumed to use ordinary continuous variable, which mean a number
that can be fractionated (ex: half gallon, ¾ water and etc) BUT for some problem you have to use the INTEGER.
- First and easy recommendation is to round the number BUT this might dangerous affect your results…
Why? If the number is small, rounding can dangerous affect the results
- It allows to try feasible combinations (ex: 2 products in 2 lines or 3 products in 2 lines)
- Three different types of integer programs:
1. All Integer Linear Program (AILP): ​decision variables are restricted to have ​ONLY​ integers
2. Binary Integer Linear Program: ​decision variables ​restricted​ to be ​= 0​ or ​= 1
3. Mixed-integer Linear Program (MILP): ​decision variables included ​continuous AND
integers

AILP example: Building Stores (by adding +1 constraint)

Infos:
11 new stores in one of 3 types ​
Convenience Store: cost $4.125B + 30 employees
Standard Store: cost $8.5B + 15 employees
Expanded Services Store: cost $12.375B + 45 employees
Sources available: $ 82.5B + 300 employees
Avg. Revenue/yr: CS (1.2M); SS (2M); ESS (2.6M)

How many of each store type should they build to MAXIMIZE the net revenue?
FORMULATION on SOLVER:

Decision Variables:
X1 = # of CS to build
X2 = # of SS to build
X3 = # of ESS to build

Objective function:
MAXIMIZE Z = 1.2X1 + 2X2 + 2.6X3

Constraints:​ total # of stores to be build (11); sources (82.5M + 300e); nonnegativity ​AND integer
X1 + X2 + X3 =< 11
4.125X1 + 8.5X2 + 12.375X3 =< 82.5
30X1 + 15X2 + 45X3 =< 300
X1, X2, X3 >= 0
X1, X2, X3 INTEGERS
How to restrict to integers numbers? ​Add an additional constraint to ​decision variables​ for the ​left-hand side.

to reverse the restriction, go to options ​ ​ uncheck the box

SENSITIVITY REPORT? NO!!! Why?


- Generally useful leading to misleading (illusive)
- Make change in the model and RERUN
- Regular Linear Program vs Interger:​ ​sensitivity report assumes continuous objective functions​ and
constraints ​BUT​ in integer program a ​SMALL change​ in right-hand side ​may not change​ any significant
value in ​the objective function (shifting the line) ​to create a new solution point (if change are enough to
shift, then the objective function change s to a new value). – ​ALSO APPLY TO CHANGES IN COEFFC.
Ex sensitivity: Suppose shadow price = 5, so if the right-hand side of the constraint goes up by one, then the objective
function increase by 5. If increase by 1.5, objective function increase by 7.5 (5*1.5)
- What if shadow price = 0 and then infinity? Technically it could happen but doesn’t make sense once we
won’t get value information such as when the change happened and how big it’s. ​(check_understand – what
if I change a huge number? Need to rerun? How does the objective function will follow the change?)

Mixed Integer Linear Programming Problem:

X Company – ​want to decide mix products to produce next week in order to MAXIMIZE the profit
Infos:
7 diff. types of products with diff. profit/unit and man/hour (production time)

720 workers for next week


Product 7 ​ ​ + $2000 (left-side hand)_​not variable according to # of production
Product 3 ​ ​ adjustments will take 45 worker hours (left-side hand)
Product 4 ​ ​ adjustments will take 35 worker hours (left-side hand)

FORMULATION on SOLVER

1. Decision Variables: i​ t MUST be considered not only the # of units of each product should be produced but
also the changes that producing 3,4 or seven will bring. – (product = i for 1-7)
Xi: # of units to be produced of i products
Yi = 1: # of units to be produced of I product ​(I = 3,4 and 7)

2. Objective Function:​ it’s the profit/unit of each product*# of units produced ​(FOR PRODUCT 7, IT MUST
BE CONSIDERED + $2K)
MAX Z (right-hand side): ​10X1 + 22X2 +35X3 + 19X4 + 55X5 + 10X6 + ​(115X7 – 2000Y7)

3. Constraints: #​ production time/unit per product, total workers hours available (+add worker hours for
products 3 and 4 ), ​rules for product 3,4,7 ​and nonnegativity
Products 3,4 and 7: ​“force” Y3, Y4 and Y7 = 1, so if they are produced, solver will consider its
restrictions and production indicator goes up (or if the company do not pay for these products,
they won’t be produced ​(check_why force = 1? Because the +hours or +$ won’t change if I
produce 1 or 2…3?? Check this step)
3.1 1.0X1 + 2.0X2 + 3.7X3 + 2.4X4 + 4.5X5 + 0.7X6 + 9.5X7 + 45Y3 + 35Y4 =< 720
3.2 Limit binary variables (3,4 and 7)
3.2.1 if Y3 = 1 then X3 =< 195Y3 (720/3.7)
3.2.2 if Y4 = 1 then X4 =< 300Y4 (720/2.4)
3.2.3 if Y7 = 1 then Y7 =< 76Y7 (720/9.5) – ​(why minimum if the binary if not about increasing
hours but money? I have no restriction for money​)
Coeff. of binary variable is on the right-hand side so they do not artificially constraint
quantities of production ​(what do you mean by artificially constrain?).​
How does this binary constraints work? ​If unit 3,4,7 is produced then resulting constraints of binary
forces y = 1, so it will make the necessarily adjustments considering the coeff. that limits maximum #
of produced units (195y3, 300y4 and 76y7).
3.3 Xi >= 0
3.4 Yi = binary

NON-LINEAR PROGRAMMING

At least one formula is non-linear, it can be objective function, one or two constraints, or both
- What’s is a non-linear formula?​ It’s the real world -> Price do no rise in straight line as sales grow; cost
can fall or rise as efficiency shift or price fall as supply increases
- Why we assume linearity so?​ ​Because numbers appear to be close, it’s hard to solve non-linear problem,
lots of computer capacity and might not result in the best solution.
- Why should we use non-l​ inear ish? Sometines, linear solution can show up extremely incorrect solution ​
use non-linear when they are MUCH MORE accurate
- Why is HARD and challenging?​ It’s hard to deliver the objective function and the constraints BUT once is
done, you can even calculate by hand.

Non-Linear example:

Infos: Butter Buy

Sell 1000 tv/week at $450/each


‘-$10 = +100 tvs
‘+$10 = -100 tvs
Butter-buy warehouse capacity: maximum 4000/week

What price will MAXIMIZE total revenue? ​– ​it depends of price AND # of units sold ​(knowing # of units sold we
can determine the properly price)

Decision Variable:
X = # of tvs sold in a week

Objective Function: ​to determine this you must “know” the price, remember it’s now $1000 and decrease by $10
also decrease sales by 100.​ ​(check_why no considering increase by 10? Shouldn’t I test both?

Price:
450 – (0.1*(x-1000)) = 450 – 0.1X + 100 = -0.1X + 550
MAX Z (revenue):​ X*(-0.1X^2 + 550X) = -0,1X^2 + 550X

Constraints:
X =< 4000
X >= 0
Solution:

1. Simple objective function graph​: ​peak between 2400-3200

2. By hand: set objective function = 0 (derivative calculation)

Once you have the “key number” which is number of units sold, you can calculate total revenue for this # and also
the price point applying the formulas we found before:

MAX revenue: -0,1X^2 + 550X = -0.1*(2750^2) + 550*(2750) = $ 756.250


PRICE: -0.1X + 550 = -0.1*(2750) + 550 = $ 275/unit

To be considered for constraints: ​in some case you CAN’T visualize the graph of the objection function (in this
case, it’s clear where the peak is), so you might not be able to find the range (in this case 2400-3200) that the
solution lays in. The solution can be at one of the end points (0; 4000). ​What should we do? (​ check_understand
better)
Evaluate whether the first derivative = 0 within the range (minimum and maximum) as well as the end
points. ​How do I do that?​ ​ ​ test objective function with end points (we don’t need to do that in this because
we CAN SEE that the correct solution within the range.
let’s try to exercise: as we KNEW neither of end points yields the maximum revenue as 2750/ut sold does
BUT in some cases the correction solution is AT THE END POINTS.
2​
Z(0) = -0.1(0)​ + 550(0) = 0
2​
Z(4000) = -0.1(4000)​ + 550(4000) = -160,000 = 220,000 = 60,000
the solution is not 2750 because NLP uses approximation calculation and not exact calculation, so unrounded
number is normal.

SENSITIVITY REPORT:

Lagrange Multiplier: ​similar to shadow price in LP


- one unit increase in units sold will lead to a lagrange multiplier*1 increase in revenue (this case 1*0 = $0)
- one unit decrease in units sold leads to a lagrange multiplier*-11 decrease in revenue (this case -1*0 = $0)
- It’s an APPROXIMATION that tends to become MORE inaccurate as the change in the decision variables
increases ​ ​ ​it works well for one-unit change, not large changes - USE ONLY TO ESTIMATE – not
calculate – the change in the objective function by changing a right-hand side constraint. ​(check_is it diff.
from shadow price? SP is an exact value?).

You might also like