Packing For Euro Trip
Packing For Euro Trip
Trip
1
Table of Contents
Packing for Euro Trip ....................................................................................................... 3
Introduction ................................................................................................................. 3
Linear Programing ........................................................................................................................... 3
Integer Programing........................................................................................................................... 5
2
Packing for Euro Trip
Introduction
Linear Programing
Linear Programming (LP) is one of the main branches of Operations Research. In this
category are considered all those optimization models where its component functions, or in
other words, objective function and constraints are linear functions of decision variables.
Due to their simplicity, linear programming models are often used to address a variety of
real issues in industrial applications, economics, military strategy, engineering and social
sciences, which has led companies and organizations to have important benefits and savings
associated with its use.
Objective Function
Essentially linear programming consists in optimizing (minimize or maximize) an objective
function, which is a linear function of several variables:
f (x, y) = ax + by
Restrictions
The objective function is subject to a number of restrictions expressed by linear inequalities:
a1x + b1y ≤ c1
a2x + b2y ≤ c2
... ... ...
anx + bny ≤ cn
3
Feasible Solution
The set of intersections of all half-planes formed by the restrictions, determine an enclosure,
bounded or not, that is called validity region or area of feasible solutions.
Optimal Solution
The set of vertices of the enclosure is called set of basic feasible solutions and the vertex
where the optimal solution is presented is called maximum solution (or minimum regarding
the case).
4
Value of LP
The value taken by the objective function at the vertex of the optimal solution is called the
value of the linear program.
Integer Programing
In some cases it is required that the optimal solution is composed of integer values for some
or all of the variables. The solution to this problem is obtained by analyzing the possible
alternatives for integer values of those variables in the environment around the solution
obtained considering the real variables. So it is necessary to use some algorithm to find the
exact solution. The most famous is the method of “Branch and Bound”. The Branch and
Bound method starts from the addition of new restrictions for each decision variable
(bound) that when evaluated independently (branching) leads the optimal integer.
The Problem
Description
Marcelo is a Mexican student currently studying in Prague He is planning a low budget 3-
week trip around Europe with his friends. Due to the expensive cost of carrying heavy
luggage on the airplanes, Marcelo plans on only taking one luggage. The luggage is 55 cm X
45 cm X 20 cm (49,500 cm3) and should not weigh more than 15 kg. He is planning on
packing: jeans, t-shirts, underwear, socks, shoes, PJs, and a travel kit (shampoo, toothbrush,
toothpaste, etc.). He already knows how many items of each he has to take at least, and he
5
also assigned a maximum quantity for each type of item that he would like to take on his
trip. Furthermore, Marcelo has designated a value for each type of item in order to prioritize
what to pack during the decision-making. This value was assigned to each item depending
on how important it was for Marcelo to have more of those if there is extra space in the
luggage (taking into account the minimum and maximum quantities of all items). So
basically Marcelo wants to MAXIMIZE the “value” of the items in his luggage.
Summary of Data
Item Variable Value Weight Volume Restriction Restriction
(X) (pts) (kg) (cm3) Min Max
Jeans 1 10 0.7 3150 ≥1 ≤3
T-shirts 2 8 0.25 864 ≥7 ≤10
Underwear 3 6 0.15 760 ≥7 ≤10
Socks 4 5 0.13 320 ≥7 ≤10
Shoes 5 10 1.23 6000 ≥1 ≤3
PJs 6 3 0.59 2860 ≥1 ≤2
Travel kit* N/A N/A 1.36 3456 =1 =1
*Since we only want one travel kit, then it is considered as a constant and not as a variable.
Maximum weight = 15 kg
Weight of luggage (empty) = 3.1 kg
Weight of travel kit = 1.36 kg
Available free weight = 10.54 kg
If Marcelo decides to pack only the minimum amount of each item then he will obtain the
following results:
Z = 156 pts
Total weight of items = 6.23 kg
6
Total volume of items= 25,618 cm3
Remaining free weight in luggage = 4.31 kg
Remaining free volume in the luggage = 20,426 cm3
But he wants to make the most out of the space and weight remaining in the luggage, and
that is where the task begins.
Objective Function
MAX= 10* X1 + 8*X2 + 6*X3 + 5*X4 + 10*X5 + 3*X6
Constraints
0.7* X1 + 0.25* X2 + 0.15* X3 + 0.13* X4 + 1.23* X5 + 0.59* X6 ≤ 10.54
3150* X1 + 864* X2 + 760* X3 + 320* X4 + 6000* X5 + 2860* X6 ≤ 46,044
X1 ≥ 1
X1 ≤ 3
X2 ≥ 7
X2 ≤ 10
X3 ≥ 7
X3 ≤ 10
X4 ≥ 7
X4 ≤ 10
X5 ≥ 1
X5 ≤ 3
X6 ≥ 1
X6 ≤ 2
X1,2,3,4,5,6 = Integer
7
can solve these tasks in seconds instead of solving them manually, which could hours to
solve.
Solving this problem by Linear Programming will give us an optimal solution; however,
since it’s not possible to take 1.3 jeans or 3.7 t-shirts, it is necessary to solve this problem by
Integer Programming. In order to solve this problem manually, one option would be to
solve the Primal Task using Simplex, and after arriving to an optimal solution, use Branch
and Bound Method to arrive to a feasible solution that contains only integer numbers.
Nonetheless, this course is about optimizing and helping make better decisions. So another
way to solve this problem (better and optimal), to solve this problem is using computer
software that will follow the same procedure, solving it much faster. For this problem we
decided to use LINGO. “LINGO is a comprehensive tool designed to make building and
solving Linear, Nonlinear (convex & nonconvex/Global), Quadratic, Quadratically
Constrained, Second Order Cone, Stochastic, and Integer optimization models faster, easier
and more efficient” (LINDO, 2015).
Lingo has a special language that allows the User to define which variables he wants as
integers; “@GIN(name_of_variable)”.
8
Image 1.2 Results in Lingo
In the lower part of the image we can see all the variables and their corresponding values.
As we can see, all variables have assigned integer values. These values represent the answer
to our task. Each integer number symbolizes the quantity of each item that Marcelo should
pack in the luggage for his trip around Europe.
9
Total weight of items = 10.45 kg
Total volume of items= 43,750 cm3
Z (value) = 243 pts
*This is the optimum solution for this task, but in real life, you would usually leave a 5%-10%
volume margin for flexibility due to non-ideal packing items*
To verify that the result meets the restrictions, we simply add the volumes and weights of
everything and compare them to their restrictions.
Volume
Luggage Volume (empty) = 49,500 cm3
-Volume of travel kit = 3,456 cm3
-Total volume of items= 43,750 cm3
=Remaining volume in luggage = 2,294 cm3
Weight
Maximum allowed weight = 15 kg
-Weight of luggage (empty) = 3.1 kg
-Weight of travel kit = 1.36 kg
-Total weight of items = 10.45 kg
=Remaining weight in luggage = 0.09 kg
Conclusion
As we can see, the value of the luggage has increased significantly from 156 pts (with the
number of items needed at least) to 243 pts (optimizing the free space and weight available).
It is also important to notice how the restrictions of weight and volume are met, since the
weight of the luggage is less than 15 kg, and the volume of items inside the luggage is less
than 49,500 cm3.
10
objective function, a linear function of several variables subject to a number of constraints
expressed by linear inequalities. And even though it is possible to solve tasks like these
much faster using software, it is necessary to learn and understand these methods so that we
have an idea of what the software is doing to achieve those results.
11
Bibliography
Berkeley, EDU. (n.d.). Linear Programing and Reductions. Computer Science Division
Berkeley. Retrieved from:
http://www.cs.berkeley.edu/~vazirani/algorithms/chap7.pdf
12