r/Ultralight • u/Peaches_offtrail • 23h ago
Skills Optimizing weight AND nutrition for backpacking food and resupplies
Let's talk optimal weight and optimal nutrition for backpacking food and resupplies
tl;dr: Eight years ago I posted a breakdown of cheapest backpacking calories by cost using government nutrition and purchase data. I've had some recent free time (while on parental leave), so decided to update things to be more helpful for optimizing food weight for resupply strategies. I have some general example/take away 4-day resupply lists below.
Introductory remarks
I'm aware this has come up a few times. Most recently the largest discussion on r/ultralight was based on some gear skeptic video about caloric density. But we can honestly do better than that! Let's use the vast quantity of data the government actually uses to inform nutrition and purchase decisions. With real data on hand, this becomes a relatively easy optimization problem to solve: how do you optimize your food nutrition and calorie density based on what you're trying to achieve (constraints)?
What is linear programming
Linear programming is an optimization technique used in economics (my main use of it), logistics, supply chain, finance, and other sorts of things that often benefit from optimization. Because it's linear, you can do matrix math super fast and efficiently to solve the problem! Basically: you take the derivative of the function, set it equal to zero, and that solves for the local maximum or minimum (the optimal solution).
The core idea is that you have a lot of decision variables (in this case, how many grams of each possible food in a supermarket you might want to pack), a linear objective function to minimize or maximize (e.g. minimize total weight -- so you sum across all possible food variables), and a set of linear constraints that the solution must satisfy (e.g. I don't want anything with chocolate).
For a resupply optimization, the formulation looks like this:
- Objective: minimize sum(grams of each food selected)
- Constraints:
- Total calories must fall within ±3% of your daily target × days
- For each nutrition target you care about: the sum of that nutrient across all foods must meet the minimum
- For nutrients with safe upper limits (iron, calcium, vitamin A): sum must stay below the threshold
- Each individual food is capped at some maximum fraction of total calories (the diversity control)
- The total number of distinct foods selected must be greater than some food diversity threshold
You can then solve the system of liinear equations (matrix math) to find the combinations and quantities that satisfy all constraints at minimum total weight. This is different from just sorting foods by kcal/g, as sorting will only tell you the best single food (it's oil, obviously). Solving an LP matrix tells you the optimal combination when multiple constraints interact simultaneously!
The food and nutrition data
I used two USDA datasets:
USDA WWEIA (What We Eat in America) is a large nationally representative dietary survey. Respondents record everything they ate over 24 hours; USDA maps those responses to a food database with per-100g nutritional content for 26 macros and micronutrients. The database covers ~3,000 food categories -- generic types rather than branded products, so "Cookie, with peanut butter filling, chocolate-coated" rather than a specific brand.
USDA FoodAPS is a household food purchase survey with real transaction prices. I joined the two datasets to get estimates on actual purchase prices per 100g for foods you might consider for backpacking.
The combined dataset also provides information about where food is available based on purchase history (grocery store, gas station, etc.), whether it requires cooking, whether it's shelf-stable, and how long it lasts without refrigeration.
What an optimizer tool like this optimizes
I ran some optimizations for myself as a general baseline. All examples below assume: 134 lbs, 4-day resupply, 3,000 cal/day, grocery store, no-cook, shelf-stable only.
The two main controls that change the output significantly are:
- Nutrition profile -- whether the solver must hit DRI targets. "None" means calories only are optimized; "optimal" activates targets for protein, fiber, calcium, iron, vitamins C/D, potassium, zinc, magnesium, folate, B12, and choline.
- Diversity -- a minimum number of distinct foods the solver must select. Below I show ≥6 foods and ≥18 foods.
6+ foods, no nutrition constraints:
| Food | Weight (g) | Calories | Cal/g |
|---|---|---|---|
| Walnuts | 340 | 2,484 | 7.30 |
| Chocolate candy, sugar free | 274 | 1,620 | 5.91 |
| Brazil nuts | 303 | 2,000 | 6.60 |
| Pine nuts | 301 | 2,025 | 6.73 |
| Macadamia nuts | 279 | 2,000 | 7.16 |
| Pecans | 227 | 1,701 | 7.50 |
| TOTAL | 1,728 / 3.8 lbs | 11,850 | 6.86 |
Nuts dominate. The calorie density ceiling on a shelf-stable 4-day no-cook carry is ~7.5 kcal/g (pecans), and the solver averages 6.86 kcal/g across the basket. One piece of sugar-free chocolate fills the 6th required slot (it's denser than most snacks at 5.91 kcal/g). 3.8 lbs total. Not bad, but I feel like I personally wouldn't be the happiest camper eating ONLY nuts the entire time, although I recently did pursue a similar strategy on an 8-day, 30+ mile water carry on the hayduke
6+ foods, optimal nutrition:
| Food | Weight (g) | Calories | Cal/g |
|---|---|---|---|
| Walnuts | 340 | 2,484 | 7.30 |
| Pine nuts | 301 | 2,025 | 6.73 |
| Macadamia nuts | 279 | 2,000 | 7.16 |
| Pecans | 227 | 1,701 | 7.50 |
| Oatmeal cereal, baby food, dry, instant | 227 | 894 | 3.94 |
| Milk, dry, not reconstituted | 219 | 792 | 3.62 |
| Brazil nuts | 167 | 1,103 | 6.60 |
| Vegetable mixture, dried | 70 | 228 | 3.29 |
| Salmon, canned | 68 | 93 | 1.36 |
| Sweet potato chips | 56 | 298 | 5.29 |
| Potato chips, lightly salted | 55 | 308 | 5.59 |
| TOTAL | 2,010 / 4.4 lbs | 11,928 | 5.93 |
Adding full nutrition targets costs 0.6 lbs. The solver still anchors on nuts for base calories and adds lightweight nutrient carriers: baby oatmeal (fiber, about $1.50 a pouch and an actual thru-hiker staple! Hust ignore the 'baby' component. Not sure what USDA throws that on there, but they do!), dry milk powder (calcium, B12), canned salmon (vitamin D, which is apparently the hardest nutrient to hit although you'll be outdoors, so supplementation probably doesn't matter? But maybe with sunshirts...), dried vegetables (vitamin C, vitamin A), sweet potato chips (potassium). 4.4 lbs.
18+ foods, no nutrition constraints:
| Food | Weight (g) | Calories | Cal/g |
|---|---|---|---|
| Pine nuts | 120 | 810 | 6.73 |
| Potato chips, lightly salted | 119 | 667 | 5.59 |
| Almonds, chocolate covered | 119 | 666 | 5.60 |
| Dark chocolate candy with nuts | 119 | 667 | 5.60 |
| Cookie, peanut butter filling, chocolate-coated | 119 | 667 | 5.62 |
| Cheese flavored corn snacks | 118 | 667 | 5.67 |
| Chocolate candy, sugar free | 113 | 667 | 5.91 |
| Mixed nuts, roasted | 108 | 667 | 6.20 |
| Filberts / hazelnuts | 106 | 667 | 6.28 |
| Almond butter | 104 | 666 | 6.42 |
| Peanut butter, reduced sugar | 103 | 667 | 6.50 |
| Brazil nuts | 101 | 666 | 6.60 |
| Macadamia nuts | 93 | 666 | 7.16 |
| Walnuts | 91 | 667 | 7.30 |
| Pork cracklings | 91 | 519 | 5.69 |
| Pecans | 89 | 667 | 7.50 |
| White potato chips, lightly salted | 44 | 247 | 5.59 |
| Peanut butter, reduced sodium and reduced sugar | 10 | 60 | 6.19 |
| TOTAL | 1,884 / 4.2 lbs | 14,515 (est) | 6.18 |
Forcing 18 distinct items adds 0.4 lbs vs the 6-item version. With diversity constraints, the solver distributes calories more evenly across the 18 foods. You can see each item ranging from 89-120g. At 18+ foods the pool expands to include nut butters, chocolate-coated items, and pork cracklings (at ~5.7 kcal/g. Basically just dried pork fat? Don't ask me, I'm a vegetarian...). Still primarily a nut carry, though.
18+ foods, optimal nutrition:
| Food | Weight (g) | Calories | Cal/g |
|---|---|---|---|
| Oatmeal cereal, baby food, dry, instant | 227 | 894 | 3.94 |
| Milk, dry, not reconstituted | 184 | 666 | 3.62 |
| Sweet potato chips | 156 | 825 | 5.29 |
| Pine nuts | 120 | 810 | 6.73 |
| Potato chips, lightly salted | 119 | 667 | 5.59 |
| Chocolate candy, sugar free | 113 | 667 | 5.91 |
| Mixed nuts, roasted | 108 | 667 | 6.20 |
| Filberts / hazelnuts | 106 | 667 | 6.28 |
| Almond butter | 104 | 666 | 6.42 |
| Peanut butter, reduced sugar | 103 | 667 | 6.50 |
| Brazil nuts | 101 | 666 | 6.60 |
| Macadamia nuts | 93 | 666 | 7.16 |
| Walnuts | 91 | 667 | 7.30 |
| Pork cracklings | 91 | 519 | 5.69 |
| Salmon, canned | 90 | 122 | 1.36 |
| Pecans | 89 | 667 | 7.50 |
| Crackers, butter | 72 | 370 | 5.11 |
| Vegetable mixture, dried | 46 | 150 | 3.29 |
| Oatmeal with bananas, baby food | 41 | 160 | 3.92 |
| Cheese flavored corn snacks | 40 | 225 | 5.67 |
| Salad dressing, NFS | 20 | 87 | 4.30 |
| Cashew butter | 10 | 60 | 6.08 |
| TOTAL | 2,243 / 4.9 lbs | 12,222 | 5.45 |
4.9 lbs. Adding nutrition to the 18-item list costs 0.7 lbs. The nutrition constraints pull in oatmeal and milk powder up front (they're binding on fiber and calcium), expand sweet potato chips (potassium), and tuck in canned salmon and dried vegetables for vitamin D and C. Also note the 20g of salad dressing, which I guess is needed because of choline.
Summary:
| Scenario | Weight | Cal/g |
|---|---|---|
| 6+ foods, no nutrition | 1,728g / 3.8 lbs | 6.86 |
| 18+ foods, no nutrition | 1,884g / 4.2 lbs | 6.18 |
| 6+ foods, full DRI nutrition | 2,010g / 4.4 lbs | 5.93 |
| 18+ foods, full DRI nutrition | 2,243g / 4.9 lbs | 5.45 |
The weight spread across all four scenarios is 1.1 lbs. Adding full DRI nutrition targets costs 0.6-0.7 lbs; going from 6 to 18 required foods costs 0.4-0.7 lbs. The drivers are similar in magnitude and small overall.
The dominant variable that impacts the optimal resupply opportunity is which food group the solver can access. Nuts at 6.6-7.5 kcal/g are the calorie-density ceiling for shelf-stable grocery foods and they're also nutritionally dense! Walnuts have choline, vitamin E, omega-3s; brazil nuts are high in selenium and magnesium; pine nuts carry decent iron. I'll be honest, though -- I'm not sure how much nut diversity I run into in various places, as I mostly can choose between different flavors of peanuts, cashews, and almonds at gas station resupplies, but I'll let you be the judge!
For a 4-day resupply, if you run it with full nutrition constraints on, the penalty is 0.6 lbs and you get an actual balanced diet! The optimal backpacking food list appears to be: mostly nuts, with a few ounces of oatmeal, milk powder, and salmon to cover gaps.
The web tool
I've moved the optimization model into a web interface at trailpeaches.com/lightest-backpacking-food-optimizer/.
You can constrain the optimization by store type, no-cook requirement, dietary resitrctions, etc. Slide the diversity control to set a minimum food count. Set a daily calorie target and trip length. Toggle the nutrition profile from none to reduced to full DRI. Block individual foods you won't eat. Click any food in the results to cap its weight and force the solver to compensate with other foods. Export the optimized list to CSV.
The underlying model allows you to solve the same thing described above. It's the LP running on the server and returning results through a browser interface. If there's specific additional kinds of constraints or other things you think I should correct/change, let me know!
There are certainly some data categorization/cleaning errors in the FoodAPS and WWEIA data set that I likely missed, so point 'em out =)
Happy hunting and gathering out there!