Instance-Dependent Computational Complexity in NP-Complete Problems: An Empirical Study of Subset Sum and Knapsack
Authors/Creators
Description
Abstract We investigate instance-dependent computational complexity in NP-complete problems through an empirical evaluation of Subset Sum and Knapsack problems. Through controlled experiments with baseline exhaustive search and heuristic pruning, we demonstrate that computational cost is strongly influenced by input structure rather than problem size alone. Our results show that pruning-based methods reduce search space by up to two orders of magnitude.
Introduction NP-complete problems are characterized by exponential worst-case complexity, yet practical performance often deviates from these bounds due to instance-specific structure. In this work, we empirically investigate how input structure influences computational cost.
Methodology We implemented a recursive depth-first search for Subset Sum and Knapsack problems. Experiments were conducted on 2,400 randomly generated instances with varying density parameters. We measured execution time (ms), number of explored nodes, and pruning efficiency.
Results
-
Baseline exhaustive search exhibits exponential growth (220−221 nodes).
-
Pruning-based optimization achieves a speedup of up to 100x compared to baseline.
-
Consistent runtime variability across identical density regimes confirms that instance structure plays a critical role in practical algorithm performance.
Conclusion We provide empirical evidence that instance structure has a dominant effect on the computational complexity of NP-complete problems. This work motivates further study into instance-aware complexity theory.
Data Availability The experimental dataset, source code (engine.cpp), and visualization tools (plotter.py) are provided in the associated Archive 2.zip.
Files
Archive 2.zip
Files
(530.5 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:e8d0a8dbf852967de76eead115d5b493
|
408.7 kB | Preview Download |
|
md5:b9125886d800928d028dc8b8b3d8f098
|
121.8 kB | Preview Download |
Additional details
Dates
- Created
-
2026-04-22
Software
- Repository URL
- https://github.com/c2oh2/Subset-Sum-Complexity-Research
- Programming language
- C++ , Python