Quadratic Knapsack Challenge Update
Introduction
Welcome to our newest proposal - an update to the Quadratic Knapsack Challenge (QKC). This update, proposed by a dedicated member of our community, aims to align the challenge with established academic benchmarks and ensure that innovators have access to both realistic test instances and a stronger baseline solver. After reviewing and comparing this contribution against established academic literature, we are confident in the improvements this update would bring. However, before we move forward with this update, we would greatly appreciate your input.
We invite you to examine the following proposed changes and share your thoughts. Collaboration from the community is crucial for ensuring that the challenge remains relevant, fair, and scientifically robust.
Motivation for Updates
We aim to ensure that our challenges remain aligned with established academic benchmarks. By doing so, we strengthen the scientific and technological relevance of the innovations incentivised by TIG. In the context of the Knapsack challenge, the efficient generation of instances that closely mirror real-world problem structures is crucial for encouraging practical, high-value contributions.
In line with our goal, the proposed changes aim to align QKC instance generation with classical literature while improving the baseline solver to set a higher standard for innovation. By doing so, the challenge can continue to inspire innovative solutions that are both conceptually rigorous and useful in real-world contexts.
Overview of Key Changes
Improved Instance Generation
Alignment with Academic Benchmarks
The most classical instance generation procedure, adopted by many authors [1] [2] [3] [4] [5] [6], originates from Gallo et al. [7]. Key steps include:
- Linear and quadratic profits, p_i and p_{ij} (= p_{ji}), are nonzero with a density d. When nonzero, they are drawn uniformly at random from the interval [1, 100], and are set to zero otherwise.
- Four density values are commonly considered in the literature: d = 0.25, 0.50, 0.75, 1.00. In this update, density is fixed at d = 0.25 as lower-density instances have been noted to be more challenging and have become an area of interest in some recent academic studies [5:1], [8].
- Item weights w_i are drawn uniformly from the interval [1, 50].
- Capacity C is chosen randomly from the interval [50,\sum_{i=1}^n w_i]. In this update, capacity is unchanged as C \;=\; \frac{1}{2}\sum_{i=1}^n w_i.
Comparison of Old vs New Generation
- Value Ranges: Previously, linear coefficients were in [1, 50] and quadratic coefficients in [-50, 50]. Now, [1, 100] is used for both linear and quadratic coefficients. This modification adheres to the standard benchmarks proposed by Gallo et al.[7:1] and widely adopted in subsequent literature.
- Controlled Sparsity (Density): This update employs a density parameter of 25%. Each linear or quadratic coefficient has a 25% probability of being nonzero. This sparse structure, in contrast to the previous fully dense matrices, more accurately models realistic scenarios where only a subset of interactions are significant.
- **Weights:**Item weights remain uniformly drawn from [1, 50].
- Capacity: The knapsack capacity remains fixed at
C \;=\; \frac{1}{2}\sum_{i=1}^n w_i.
Future Considerations
Schauer[4:1] criticised the use of randomly generated instances, such as those based on Gallo et. al.[7:2], commonly employed for computational experiments on algorithms for the QKP. He demonstrated that these instances often allow basic greedy-like algorithms to produce solutions whose value asymptotically approaches the optimum as the instance size grows indefinitely. In his work, Schauer introduced an additional class of instances, known as hidden-clique instances, which are significantly harder to solve. Should dominance of greedy-like algorithms be observed in TIG, we may propose a future update, adopting a similar methodology to increase instance complexity.
Enhanced Baseline Algorithm
The baseline solution now consists of two stages:
- Greedy Selection: Items are sorted by the ratio of total value (sum of its linear and interaction terms) to weight, and selected until the capacity is reached.
- Local Search with Tabu List: A short-term tabu search mechanism (with a memory size of 3 iterations) is employed to iteratively improve the initial solution.
- Precomputing Interaction Values: For each item, the sum of its interactions with already selected items is precomputed - marginal contributions are quickly evaluated.
- Tabu Swaps: Items are swapped if value improves, with swaps temporarily restricted to avoid reversals.
- Early Termination: If a potential new item’s contribution is below the smallest contribution among the currently selected items, the swap step is skipped - skips unpromising moves for faster convergence.
This two-stage method enhances the baseline solution’s quality relative to the older, single-stage greedy approach.
Performance Analysis
Runtime Efficiency
The new method demonstrates slightly slower performance compared to the pure greedy algorithm but remains efficient. For example, requiring approximately 20 seconds to generate 1,000 instances with 2000 items.
Solution Quality Improvement
The new method achieves improvements in solution quality compared to the previous baseline approach. The formula for average baseline improvement is similar to the better_than_baseline computation and is defined as:
The updated method consistently outperforms the previous baseline across varying instance sizes.
Code
Below is the link to the proposed Rust implementation showcasing the revised instance generation and updated two-stage baseline solver. As this update is backward compatible, existing algorithms will still run if it is implemented, albeit with potentially poorer performance.
We encourage you to scrutinise this code and post any feedback in this thread.
Huge thanks to the community member who brought us this update! We look forward to your feedback and hope to finalise this community-driven improvement to push next round. Thank you for your continued support and engagement!
Pisinger, David. “The quadratic knapsack problem—a survey.” Discrete Applied Mathematics, vol. 155, no. 5, 2007, pp. 623–648. ↩︎
Fomeni, Franklin Djeumou, Kaparis, Konstantinos, and Letchford, Adam N. “A cut-and-branch algorithm for the quadratic knapsack problem.” Discrete Optimization, vol. 44, p. 100579, 2022. ↩︎
Fennich, ME, Coelho, LC, and Fomeni, F. Djeumou. “Tight upper and lower bounds for the quadratic knapsack problem through binary decision diagram.” Les Cahiers du GERAD ISSN, vol. 711, pp. 2440, 2024. ↩︎
Schauer, Joachim. “Asymptotic behavior of the quadratic knapsack problem.” European Journal of Operational Research, vol. 255, no. 2, 2016, pp. 357–363. doi: 10.1016/j.ejor.2016.06.013. ↩︎ ↩︎
Hochbaum, D.S., Baumann, P., Goldschmidt, O., and Zhang, Y. “A fast and effective breakpoints heuristic algorithm for the quadratic Knapsack problem.” European Journal of Operational Research, 2024. doi: [10.1016/j.ejor.2024.12.019] ↩︎ ↩︎
Galli, Laura, Martello, Silvano, and Toth, Paolo. “The quadratic knapsack problem.” European Journal of Operational Research, 2024. doi: 10.1016/j.ejor.2024.12.032. ↩︎
Gallo, Giorgio, et al. “Quadratic Knapsack Problems.” Combinatorial Optimization, Springer, 1980. ↩︎ ↩︎ ↩︎
Pisinger, W. David, Rasmussen, Anders Bo, and Sandvik, Rune. “Solution of large quadratic knapsack problems through aggressive reduction.” INFORMS Journal on Computing, vol. 19, no. 2, 2007, pp. 280–290. ↩︎