Pattern-Based Control for Dynamic Stochastic Multi-Knapsack Problems with Multiple Item Types

Published: 22 April 2026| Version 1 | DOI: 10.17632/wxmx3h95b5.1
Contributors:
Junyi Dong, Zikang Li, Xiangtong Qi, Qian Liu

Description

This repository provides the complete dataset and source code for reproducing all numerical experiments reported in the corresponding manuscript submitted to Computers & Operations Research, in compliance with the journal’s data availability policy. The numerical experiments are conducted to verify the effectiveness, efficiency, and robustness of the proposed optimization method. Tests are performed on standard benchmark instances and randomly generated cases of different scales, aiming to compare the proposed approach with state-of-the-art methods from related literature, analyze parameter sensitivity, and demonstrate computational performance. The dataset includes benchmark test instances widely used in the operations research field and synthetic instances with various problem sizes. All data are preprocessed consistently to ensure fair comparison. Experimental results such as objective values, computational time, and performance indicators are also included for verification. The source code implements the proposed algorithm, benchmark models, parameter settings, and result output modules. It is structured to be executable and reproducible, with fixed random seeds and clear running instructions. Dependencies and environment requirements are briefly documented to help users replicate the results efficiently. All materials are shared for academic research and reproducible verification. Users may access and reuse the data and code with proper citation of the related manuscript and this repository.

Files

Steps to reproduce

This dataset contains experimental results for the dynamic stochastic multi-knapsack problem, paired with simulation code and benchmark instances to support full reproducibility. All data was obtained through computational simulation using custom Python algorithms, with standardized environments and fixed random seeds to eliminate uncontrollable variance. First, we prepared a consistent computing environment: Python 3.8+, with NumPy, Pandas, and Matplotlib as core dependencies. We fixed numpy.random.seed(42) across all scripts to ensure replicable stochastic behavior. Two types of test instances were used: benchmark instances from established literature and synthetic instances generated automatically. Benchmark instances were standardized and saved in CSV format for consistency. Synthetic instances were programmatically created with varying parameters: 2–10 knapsacks, 5–20 item types, Poisson-distributed item arrivals, and uniformly distributed item weights and values. Each configuration includes 30 independent instances to ensure statistical reliability. The core simulation framework is implemented in SimulationSystem.py, which models dynamic item arrival, capacity constraints, and real-time decision-making. We evaluated three policies: our proposed Pattern-Based Control (BPC) Policy in BPCPolicy.py, the optimal policy (OPT) for small-scale validation, and a benchmark pattern-based policy (PB) for comparison. Experiments were executed via main.py, which loads instances, runs simulations with predefined parameters (1000 steps per simulation, 10 repeated runs per instance), and records key metrics including total profit, utilization rate, and computational time. Raw and summarized results were exported to CSV files in the Exp_results folder, including mean values, standard deviations, and runtime performance. To reproduce this research, users can install dependencies, clone the code repository, and run python main.py with default or customized configurations. No manual preprocessing or external tools are required. Minor numerical variations within 3% are acceptable due to floating-point precision; increasing repetition times can further reduce variance. All modules, workflows, and output structures are preserved to ensure transparency and repeatability of the optimization experiments.

Categories

Combinatorial Optimization, Approximation (Algorithm), Dynamic Optimization

Licence