1. Packing a Hiking Backpack
Brett Keim
December 8, 2015
Abstract
If you have ever been backpacking or just packing a pack of some sort you know the struggles of
organizing your bag. What if there was some way we could just submit items we are thinking about
packing and have the answer given to us. This was the main motivation behind my hiking backpack
problem. Being an avid outdoor adventurer I am always trying to cut down on wasted space and be as
lightweight as possible. I decided to design and solve a linear programming problem that would tell me
what items are worth packing and where I should pack them. The findings of the research should allow
me to better pack for a hiking trip.
1 Description of Problem
The problem is based off of a typical 3-day backpacking trip where the hiker will have to carry all of the
essential items needed for the trip as if he were going alone on the trip. The problem assumes the hiker
has a 48 liter hiking pack as well as a maximum carry weight of 35 pounds. The backpack also has three
locations on the outside of the pack that allow for more packing. These three locations still count toward the
over weight of the pack, but do not have a volume limit. The hiker can carry items on himself, but carrying
an item on himself does make the items weight feel heavier. The item will carry 1.5x as heavy as if it were
carried in the pack. The volume on the hiker is unlimited, but the hiker cannot carry more than 6 pounds
(carry weight).
1
2. 1.1 Items for Consideration
Item Weight Volume Worth Factor Self Packable Pack Inside Pack Pack Outside Pack
Footprint 0.77 2.88 8 No Yes Lower
Tent 6 16.59 10 No Yes Lower
Sleeping Bag 3.5 12.77 10 No Yes Lower
Water Filter 1.25 3.35 10 No Yes No
Sleeping Mat 1 3.03 9 No Yes Lower
GoPro Accessories 0.75 0.57 7 Yes Yes No
Clothing Lg 8 23.04 6 No Yes No
Clothing Md 6 17.95 6 No Yes No
Clothing Sm 4 14.54 6 No Yes No
Food 5.25 9.23 10 No Yes No
Water 4.4 2 10 Yes Yes Water Slot
Knife 0.92 0 7 Yes No No
Jacket 1 2.71 5 No Yes No
Gloves 0.25 0.08 3 Yes Yes No
Headlamp 0.14 0.03 6 Yes Yes No
Stove 0.5 0.26 9 No Yes No
Cookware 1 2.43 9 No Yes No
GoPro 1 0 9 Yes No No
Sunscreen 0.19 0.31 5 Yes Yes No
Extra Shoes 1.13 3.54 5 No Yes Side
Watch 0.35 0 6 Yes No No
Portable Speaker 1.6 0.9 1 No Yes No
Blanket 0.6 3.14 3 No Yes No
Pillow 0.13 0.39 6 No Yes No
Bug Towelettes 0.13 0.03 8 No Yes No
Hat 0.15 0 6 Yes No No
Rain Gear 0.6 1.97 8 No Yes Side
Treking Poles 1.2 0 6 Yes No No
Binoculars 0.69 0 5 Yes No No
1.2 Specifications
The hiker must have certain items no matter what to insure his survival. The hiker must pack one clothing
item, the sleeping bag, the tent, water filter, food, and water. The outside of the hiker’s pack has three
separate locations: below the pack, the side of the pack, and a water slot. The hiker can only pack one item
in each of the outside locations of the pack. It is important to remember packing an item on the outside of
the pack doesn’t take up any of the pack’s volume, but still does count towards the packs weight.
2
3. 2 Designing Linear Programming Model
2.1 Assigning Variables
The first essential step, as with every linear programming problem, is to assign variables. The following
shows the variables I have made.
Let xiA =
{
1 if item i is stored on the hiker
0 otherwise
Let xiB =
{
1 if item i is stored inside the pack
0 otherwise
Let xiCj =
{
1 if item i is stored outside the pack in location j
0 otherwise
Let fi = worth factor of item i
Let wi = weight of item i in pounds
Let vi = volume of item i in liters
∀i = 1, .....29 and j = lower, water, side
2.2 Objective Function
The objective function for this particular problem is to maximize the total worth factor of the items in the
pack as well as the items stored on the hiker.
Maximize
29∑
i=1
fi ∗ xiA +
29∑
i=1
fi ∗ xiB +
29∑
i=1
fi ∗ xiCj
∀i = 1, .....29 and j = lower, water, side
2.3 Implementation of Constraints
Now that we have our variables and objective function defined we need to implement the data into some
constraints. In the table provided in section 1.1 one can see what items can be packed in what locations. If
an item cannot be packed in a certain location we can exclude it from that specific corresponding constraint
(i.e. the tent cannot be packed on the hiker thus do not include it in the self-weight constraint).
Self-Weight Constraint
1.5 ∗
29∑
i=1
wi ∗ xiA ≤ 6
Pack Weight Constraint
29∑
i=1
wi ∗ xiB + wi ∗ xiCj ≤ 35
3
4. Pack Volume Constraint
29∑
i=1
vi ∗ xiB ≤ 48
Side of Outiside of Pack Constraint
29∑
i=1
xiCside = 1
Clothing Constraint
x7B + x8B + x9B = 1
Must Take Constraints
x2B + x2Clower = 1
x3B + x3Clower = 1
x4B = 1
x11A + x11B + x11Cwater = 1
x10B = 1
Bottom of Outside of Pack Constraint
29∑
i=1
xiClower = 1
Water Slot Outside of Pack Constraint
29∑
i=1
xiCwater = 1
Item Stored in Single Location Constraint
xiA + xiB + xiCj ≤ 1
∀i = 1, ......, 29
∀j = water, side, lower
2.4 Explanation of Constraints
The constraints listed were made with the intentions of being generic for future reproducibility, but some
constraints cannot be written generically. Those constraints are specific to the problem at hand and we must
use the given data in order to produce the correct constraints such as the clothing constraint.
4
5. 3 Solving the Model
In order to solve the model created one can use multiple different types of software depending on program-
ming skill level and access. The model was solved using LINDO (classic) for this research paper. The syntax
for the LINDO entry is as follows:
MAX
8x1B + 8x1CL + 10x2B + 10x2CL + 10x3B + 10x3CL + 10x4B + 9x5B + 9x5CL + 7x6A + 7x6B + 6x7B
+ 6x8B + 6x9B + 10x10B + 10x11A + 10x11B + 10x11CW + 7x12A + 5x13B + 3x14A + 3x14B + 6x15A
+ 6x15B + 9x16B + 9x17B + 9x18A + 5x19A + 5x19B + 5x20B + 5x20CS + 6x21A + 1x22B + 3x23B +
6x24B + 8x25B + 6x26A + 8x27B + 8x27CS + 6x28A + 5x29A
SUBJECT TO
0.75x6A + 4.4x11A + 0.92x12A + 0.25x14A + 0.14x15A + 1x18A + 0.19x19A + 0.35x21A + 0.15x26A +
1.2x28A + 0.69x29A < 4
0.77x1B + 0.77x1CL + 6x2B + 6x2CL + 3.5x3B + 3.5x3CL + 1.25x4B + 1x5B + 1x5CL + 0.75x6B
+ 8x7B + 6x8B + 4x9B + 5.25x10B + 4.4x11B + 4.4x11CW + 1x13B + 0.25x14B + 0.14x15B + 0.5x16B
+ 1x17B + 0.19x19B + 1.13x20B + 1.13x20CS + 1.6x22B + 0.6x23B + 0.13x24B + 0.13x25B + 0.6x27B
+ 0.6x27CS < 35
2.88x1B + 16.59x2B + 12.77x3B + 3.35x4B + 3.03x5B +0.57x6B + 23.04x7B + 17.95x8B + 14.54x9B
+ 9.23x10B + 2x11B + 2.71x13B + 0.08x14B + 0.03x15B + 0.26x16B + 2.43x17B + 0.31x19B + 3.54x20B
+ 0.9x22B + 3.14x23B + 0.39x24B + 0.03x25B + 1.97x27B < 48
x1CL + x2CL + x3CL + x5CL 1
x20CS + x27CS < 1
x1B + x1CL < 1
x2B + x2CL < 1
x3B + x3CL < 1
x5B + x5CL < 1
x6A + x6B < 1
x11A + x11B + x11CW < 1
x14A + x14B < 1
x15A + x15B < 1
x19A + x19B < 1
x20B + x20CS < 1
x27B + x27CS < 1
x7B + x8B + x9B = 1
x2B + x2CL = 1
x3B + x3CL =1
x4B = 1
x11A + x11B + x11CW = 1
x10B = 1
END
INT 41
4 Results
Using LINDO it is easy to quickly get the results, but the problem is not fully solved quite yet, because one
must interpret the results and translate them into useful information about the specific situation. This is
one of the most important processes because here is where the initial questions posed are answered.
5
6. 4.1 LINDO Output
First, one should look at the software of choice (LINDO in this case) output. LINDO’s output is exactly as
follows:
LP OPTIMUM FOUND AT STEP 31
OBJECTIVE VALUE = 166.172226
NEW INTEGER SOLUTION OF 161.000000 AT BRANCH 0 PIVOT 31 RE-INSTALLING BEST SO-
LUTION...
OBJECTIVE FUNCTION VALUE
1) 161.0000
VARIABLE VALUE REDUCED COST
X1B 0.000000 -8.000000
X1CL 0.000000 -8.000000
X2B 0.000000 -10.000000
X2CL 1.000000 -10.000000
X3B 1.000000 -10.000000
X3CL 0.000000 -10.000000
X4B 1.000000 -10.000000
X5B 1.000000 -9.000000
X5CL 0.000000 -9.000000
X6A 0.000000 -7.000000
X6B 1.000000 -7.000000
X7B 0.000000 -6.000000
X8B 0.000000 -6.000000
X9B 1.000000 -6.000000
X10B 1.000000 -10.000000
X11A 0.000000 -10.000000
X11B 0.000000 -10.000000
X11CW 1.000000 -10.000000
X12A 1.000000 -7.000000
X13B 0.000000 -5.000000
X14A 0.000000 -3.000000
X14B 1.000000 -3.000000
X15A 1.000000 -6.000000
X15B 0.000000 -6.000000
X16B 1.000000 -9.000000
X17B 1.000000 -9.000000
X18A 1.000000 -9.000000
X19A 1.000000 -5.000000
X19B 0.000000 -5.000000
X20B 0.000000 -5.000000
X20CS 0.000000 -5.000000
X21A 1.000000 -6.000000
X22B 1.000000 -1.000000
X23B 0.000000 -3.000000
X24B 1.000000 -6.000000
X25B 1.000000 -8.000000
X26A 1.000000 -6.000000
X27B 0.000000 -8.000000
6
7. X27CS 1.000000 -8.000000
X28A 1.000000 -6.000000
X29A 0.000000 -5.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 0.050000 0.000000
3) 4.640000 0.000000
4) 0.420000 0.000000
5) 0.000000 0.000000
6) 0.000000 0.000000
7) 1.000000 0.000000
8) 0.000000 0.000000
9) 0.000000 0.000000
10) 0.000000 0.000000
11) 0.000000 0.000000
12) 0.000000 0.000000
13) 0.000000 0.000000
14) 0.000000 0.000000
15) 0.000000 0.000000
16) 1.000000 0.000000
17) 0.000000 0.000000
18) 0.000000 0.000000
19) 0.000000 0.000000
20) 0.000000 0.000000
21) 0.000000 0.000000
22) 0.000000 0.000000
23) 0.000000 0.000000
NO. ITERATIONS= 31
BRANCHES= 0 DETERM.= 1.000E 0
4.2 Interpretation of LINDO Results
As with all linear programming problems when someone goes to translate their results of the their model
they need to go back to the definition of the variables. Recall that xiA = 1 means that item i is packed on
the hiker and xiB = 0 indicates that item i is not packed inside the pack. These are just two examples to
refresh your memory for specifics on the variables please see Section 2.1 (Assigning Variables). To translate
the LINDO code we look for the variables that have a value of 1 along with their subscripts to identify the
location of the stored item. Identifying such variables and listing their corresponding item along with the
location of the item yields the following:
7
9. 4.3 Listing of Items per Location
Below is a final listing of the items that should be packed along with the location of each item.
Items Inside Pack Items on Hiker Items Outside Pack
Sleeping Bag Knife Tent (Below Pack)
Water Filter Headlamp Water (Water Slot)
Sleeping Mat GoPro Rain Gear (Side Pocket)
GoPro Accessories Sunscreen
Clothing Small Watch
Food Hat
Gloves Treking Poles
Stoves
Cookware
Portable Speaker
Pillow
Bug Towelette
5 Conclusion
The initial question posed was a simple question that every person thinks about in some kind of capacity.
Everyone is always looking for the most efficient way to pack and carry their items, this research sheds some
light on how to solve packing problems. The goal was completed, but this should just be the beginning.
Future works should include more items, as well as more locations in which to put the items. This type of
research could be very effective for military use, such as how a soldier should pack their gear on themselves
as well as in their packs. The concept could be extended to items other than packs as well such as trucks or
airplanes.
6 References
The data gathered for the weight and size of the items listed at the start of the problem was gathered from
Amazon.com. Individual items were searched and data taken from their respective amazon site.
9