Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
393 views

BAFPRES - Fundamentals of Prescriptive Analytics - Integer and Binary Programming

The document discusses integer programming and binary integer programming. It provides examples of using integer programming to maximize profits or revenue by determining optimal allocation of resources among decision variables given constraints. Binary integer programming examples involve determining which projects to select out of available options to maximize net return, where decision variables are binary (0 or 1). The document provides formulations and solutions to sample problems.

Uploaded by

Rolanne Genove
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
393 views

BAFPRES - Fundamentals of Prescriptive Analytics - Integer and Binary Programming

The document discusses integer programming and binary integer programming. It provides examples of using integer programming to maximize profits or revenue by determining optimal allocation of resources among decision variables given constraints. Binary integer programming examples involve determining which projects to select out of available options to maximize net return, where decision variables are binary (0 or 1). The document provides formulations and solutions to sample problems.

Uploaded by

Rolanne Genove
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Fundamentals of

Prescriptive
Analytics
Integer Programming (IP) and
Binary Programming

Charles A. Merioles
CIO, Duty Free Philippines
Fundamentals of Prescriptive Analytics
Course Code : BAFPRES
Course Title : Fundamentals of Prescriptive Analytics
Course Credit : 3 units
Pre-requisite : BAFDESC (Fundamentals of Descriptive Analytics)
Pre-requisite to : BAINTER (Analytics Internship)
Type of Course : Specialization Track
Class Mantra

“I am somebody when I walk into this class,


I am a better somebody when I walk out.
I am smart and strong,
I deserve the education that I get here,
I have things to do, people to impress and
places to go!”
Integer Programming
Integer programming is the same as Linear
programming except that the decision variables
are all integers.
Other Prevalent Forms

• Mixed Integer Programming (MIP)


-some vars are linear, others, integer

• Binary Integer Programming


-all of the variables are either 0 or 1
Decision Variables
The decision variables refer to the economic or
physical quantities, which are competing with
one another for sharing the given limited
resources (must be all integers).
Objective Function
The objective function of a
linear programming problem
is a linear function of the
decision variable expressing the
objective of the decision maker.

For example, maximization of profit or contribution,


minimization of cost/time.
All Integer Constraints
The constraints indicate limitations
on the resources, which are to be allocated
among various decision variables.
These resources may be production capacity, manpower,
time, space or machinery.
These must be capable of being expressed as linear
equation (i.e. =) on inequalities (i.e. > or<; type) in terms
of decision variables.
Steps In the Formulation of IP Problem
Step 1: Identify the Decision Variables of interest to the decision
maker and express them as x1, x2, x3 or x, y, z.

Step 2: Ascertain the Objective of the decision maker whether he


wants to minimize or to maximize.

Step 3: Ascertain the cost (in case of minimization problem)


or the profit (in case of maximization problem) per unit
of each of the decision variables.

Step 4: Ascertain the constraints representing


the maximum availability or minimum
commitment
Now, Let’s Practice
Example #1
A farmer has 12 hectares to plant. He needs to decide how many
hectares of corn he needs to plant and how many of peanuts. He can
make P40K per hectare profit for corn and P30K per hectare for
peanuts. However, the corn takes 2 hours of labor per hectare to
harvest and the peanuts takes only take 1 hour per hectare. He only
has 312 hours of labor he can invest and somebody just placed an
order for 3 hectares worth of corn.

To maximize his profit, how many hectares of each should he plant?


Solution #1
A farmer has 12 hectares to plant. He needs to decide how many hectares of corn he needs to plant and how many of peanuts. He can make
P40K per hectare profit for corn and P30K per hectare for peanuts. However, the corn takes 2 hours of labor per hectare to harvest and the
peanuts takes only take 1 hour per hectare. He only has 312 hours of labor he can invest and somebody just placed an order for 3 hectares
worth of corn.

To maximize his profit, how many hectares of each should he plant?

Let x = number of hectares of corn to plant


y = number of hectares of peanuts to plant
functional objective: maximize Profit P, where P = 40,000x + 30,000y
constraints:
x >= 0;
y >= 0; x = 12, y = 0, and P = 480,000
x + y <= 12
2x + y <= 312;
x >= 3
Exercise #2
The Manila Times produces newspapers and magazines. Long-term
projections indicate an expected demand of at least
100,000 newspapers and 80,000 magazines each day. Because of
limitations on current production capacity, no more
than 200,000 newspapers and 170,000 magazines can be made daily.
To satisfy a shipping contract, a total of at least 200,000 newspapers
and magazines must be shipped each day.

If each newspaper sold results in a PHP2 loss, but each magazine


produces a PHP5 profit, how many of each type should be made daily
to maximize net profits?
Solution #2
The Manila Times produces newspapers and magazines. Long-term projections indicate an expected demand
of at least 100,000 newspapers and 80,000 magazines each day. Because of limitations on current production
capacity, no more than 200,000 newspapers and 170,000 magazines can be made daily. To satisfy a shipping
contract, a total of at least 200,000 newspapers and magazines must be shipped each day.

If each newspaper sold results in a PHP2 loss, but each magazine produces a PHP5 profit, how many of each
type should be made daily to maximize net profits?

Let x = # of newspapers, y = # of mags


Maximize P = -2x +5y P = 650,000
Subject to: 100,000 <= x <= 200,000 x = 100,000
80,000 <= y <= 170,000 y = 170,000
x + y >= 200,000
Exercise #3
At a PETRON refinery, the refining process requires the production of at
least two liters of gasoline for each liter of diesel. To meet the
anticipated demands of Holy week season, at least three million liters
of diesel a day will need to be produced. The demand for gasoline, on
the other hand, is not more than 6.4 million liters a day.

If gasoline is selling for P42/liter and diesel sells for P30/liter, how much
of each should be produced in order to maximize revenue?
Solution #3
At a PETRON refinery, the refining process requires the production of at least two liters of gasoline for each liter
of diesel. To meet the anticipated demands of Holy week season, at least three million liters of diesel a day will
need to be produced. The demand for gasoline, on the other hand, is not more than 6.4 million liters a day.

If gasoline is selling for P42/liter and diesel sells for P30/liter, how much of each should be produced in order to
maximize revenue?

Let x = # of liters gasoline


y = # of liters diesel
R = P 364,800,000
Maximize Revenue = 42x + 30y
Subject to: x >= 2y
x = 6,400,000 liters
y >= 3,000,000 y = 3,200,000 liters
x <= 6,400,000
Exercise #4
You need to buy some filing cabinets at Wilcon. You know that local brands
costs PHP500 per unit, requires six square feet of floor space, and holds eight
cubic feet of files. Imported brands costs PHP1,000 per unit, requires eight
square feet of floor space, and holds twelve cubic feet of files. You have been
given PHP7,000.00 for this purchase, though you don't have to spend that
much.

The office has room for no more than 72 square feet of cabinets.

How many of which brand should you buy, in order to maximize storage
volume?
Solution #4
You need to buy some filing cabinets at Wilcon. You know that local brands costs PHP500 per unit, requires six square feet of
floor space, and holds eight cubic feet of files. Imported brands costs PHP1,000 per unit, requires eight square feet of floor
space, and holds twelve cubic feet of files. You have been given PHP7,000.00 for this purchase, though you don't have to
spend that much.
The office has room for no more than 72 square feet of cabinets.
How many of which brand should you buy, in order to maximize storage volume?

Let x = # of local brand cabinets,


y = # of imported brand cabinets
Maximize Volume = 8x + 12y Volume = 100
Cost: 500x + 1000y <= 7,000 x=8
Space: 6x +8y <= 72 y=3
Binary Integer Programming (BIP)
In binary problems, each of the variable can only take on the value
of 01 and 1. This may represent the selection or rejection of an
option, the turning on and off of switches, a yes or no answer, or
many other situations.

It uses a specialized branch and bound algorithm for solving BIPs,


known as Balas Additive Algorithm
BIP Example #5
You have 4 projects
to consider, whether to
select or not:
x1= 1 if project x1 is selected, otherwise, it’s 0
x2= 1 if project x2 is selected, otherwise, it’s 0
x3= 1 if project x3 is selected, otherwise, it’s 0
x4= 1 if project x4 is selected, otherwise, it’s 0
or

xi= 1 if project xi is selected, otherwise, it’s 0


where i = 1,2,3 or 4
BIP #5
The projects have a lifespan of 3
months and corresponding costs, as follow:
Project 1 2 3 4 Funds
January 58 44 26 23 120
February 25 29 13 17 80
March 43 25 23 29 95
Net Return 217 125 88 109
The objective is to maximize return
BIP Solution #5
The projects have a lifespan of 3
months and corresponding costs, as follow:
Project 1 2 3 4 Funds
January 58 44 26 23 120
February 25 29 13 17 80
March 43 25 23 29 95
Net Return 217 125 88 109
The objective is to maximize return, which is:

217x1 + 125x2 + 88x3 + 109x4


The constraints are: 58x1 + 44x2 + 26x3 + 23x4 ≤ 120 for January
where xi = 0 | 1 25x1 + 29x2 + 13x3 + 17x4 ≤ 80 for February
43x1 + 25x2 + 23x3 + 29x4 ≤ 95 for March
BIP Solution #5 – Brute Force
BRUTE FORCE SOLUTION - BINARY INTEGER PROGRAMMING
Project 1 Project 2 Project 3 Project 4 Maximized Constraint 1 Constraint 2 Constraint 3
≤120 ≤80 ≤95
0 0 0 0 0 0 0 0
0 0 0 1 109 23 17 29
0 0 1 0 88 26 13 23
0 0 1 1 197 49 30 52
0 1 0 0 125 44 29 25
0 1 0 1 234 67 46 54
0 1 1 0 213 70 42 48
0 1 1 1 322 93 59 77
1 0 0 0 217 58 25 43
1 0 0 1 326 81 42 72
1 0 1 0 305 84 38 66
1 0 1 1 414 107 55 95
1 1 0 0 342 102 54 68
1 1 0 1 451 125 71 97
1 1 1 0 430 128 67 91
1 1 1 1 539 151 84 120
BIP Solution #5
The projects have a lifespan of 3
months and corresponding costs, as follow:
Project 1 2 3 4 Funds
January 58 44 26 23 120
February 25 29 13 17 80
March 43 25 23 29 95
Net Return 217 125 88 109
The objective is to maximize return, which is:
217x1 + 125x2 + 88x3 + 109x4
The constraints are: 58x1 + 44x2 + 26x3 + 23x4 ≤ 120 for January
where xi = 0 | 1 25x1 + 29x2 + 13x3 + 17x4 ≤ 80 for February
43x1 + 25x2 + 23x3 + 29x4 ≤ 95 for March

Solving using BF Excel: x1=1, x2=0, x3=1, x4=1, Optimal Net Return = 414
BIP #6
The projects have a lifespan of 3
months and corresponding costs, as follow:
Project 1 2 3 4 Funds
January 23 7 9 30 55
February 12 3 5 60 70
March 13 8 9 45 65
Net Return 48 18 23 135
Maximize return
Q&A

CHARLES ALMONTE MERIOLES


Professional Faculty
charles.merioles@benilde.edu.ph
charles@merioles.com
+63 (921) 370-4994
@cmerioles

You might also like