Abstract
Packing and vehicle routing problems play an important role in the area of supply chain management. In this paper, we introduce a non-linear knapsack problem that occurs when packing items along a fixed route and taking into account travel time. We investigate constrained and unconstrained versions of the problem and show that both are NP-hard. In order to solve the problems, we provide a pre-processing scheme as well as exact and approximate mixed integer programming (MIP) solutions. Our experimental results show the effectiveness of the MIP solutions and in particular point out that the approximate MIP approach often leads to near optimal results within far less computation time than the exact approach.
Introduction
In the classic knapsack problem, a decision-maker selects items to maximize value without exceeding a weight capacity. However, in real-world logistics, weight does more than just fill a container; it impacts the physical performance of the transport vehicle. This paper explores the "Packing While Traveling" (PWT) problem, a variation inspired by the Traveling Thief Problem (TTP).
In the PWT scenario, a vehicle follows a fixed route through a series of cities. Each city contains items with specific profits and weights. As the vehicle collects items, its total weight increases, which inversely affects its velocity. Because the operation incurs a "rent rate" or time-based cost, every additional kilogram added to the load increases the total travel cost by slowing the vehicle down. The objective is to maximize the final profit—defined as the total value of collected items minus the total travel cost—while adhering to the vehicle's capacity constraints.
Problem Complexity and Pre-processing
The authors demonstrate that the PWT problem is significantly more complex than the standard knapsack problem. Notably, they prove that even the "unconstrained" version—where the vehicle has infinite capacity—is NP-hard. This is shown through a reduction from the classic Subset Sum Problem. Unlike standard knapsack problems where removing capacity constraints makes the problem trivial (one would simply take every item with a positive profit), the PWT problem remains difficult because the weight itself acts as a cost-generating constraint.
To manage this complexity, the researchers developed a pre-processing scheme designed to prune the search space. This logic identifies two types of items:
- Compulsory Items: Items whose profit is so high that they are guaranteed to increase the objective value regardless of the weight penalty.
- Unprofitable Items: Items whose weight penalty (the cost of carrying them to the end of the route) exceeds their potential profit.
By filtering these items before the optimization begins, the number of decision variables is significantly reduced, allowing the solver to focus on the marginal cases.
Mixed Integer Programming Formulations
The core challenge in solving the PWT problem is its non-linear and fractional objective function: travel time is calculated as distance divided by a velocity that changes at every pickup point. The authors propose two primary Mixed Integer Programming (MIP) approaches:
Exact Solution
The authors reformulate the non-linear objective into a linear MIP model. This involves using auxiliary variables and linearization techniques to handle the fractional components of the travel time calculation. While mathematically rigorous, this exact approach is computationally intensive as the number of cities and items grows.
Approximate Solution
To achieve scalability, the authors introduce a piecewise linear approximation of the travel time function ($1/v$). By approximating the curve of the velocity-weight relationship with a series of straight-line segments, they transform the problem into a much faster MIP model. This approach allows the solver to handle massive datasets that would be intractable for the exact model.
Experimental Evaluation
The algorithms were tested using the Traveling Thief Problem (TTP) benchmark set, which utilizes maps from the TSPLIB library. The instances ranged from small-scale maps of 51 cities to massive geographic datasets containing up to 859,000 cities. The tests included various item distributions, such as uncorrelated items and strongly correlated items (where profit is proportional to weight).
Key Results
- Scalability: The exact MIP model performed efficiently for instances up to 100 cities but became impractical for larger scales. In contrast, the approximate model demonstrated remarkable robustness. For the largest instance—pla85900 with 859,000 cities—the approximation found a solution in approximately 5.5 hours.
- Accuracy: Despite being an approximation, the piecewise linear model maintained high precision. In most experimental runs, the approximation ratio ($ ho$) was nearly 1.0, indicating that the solutions were virtually identical to the theoretical optima.
- The Weight-Speed Penalty: The results confirm that the timing of a pickup is critical. Picking up heavy items early in a route is significantly more expensive than picking them up near the destination, a factor the MIP models successfully optimized.
Conclusion
This research provides a scalable framework for solving non-linear knapsack problems where weight influences transportation costs. The piecewise linear approximation proves to be a highly effective "aha moment" for the field, enabling the optimization of logistics routes on a near-global scale with minimal loss in accuracy.
Future work involves expanding this model to the full Traveling Thief Problem, where the route itself is not fixed. This would require integrating Traveling Salesperson Problem (TSP) logic, allowing the vehicle to skip cities or reorder stops to further optimize the balance between item profit and travel time.
Summary updated