Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stochastic Knapsack Problem (SKP) – Code-to-Paper Reproducibility Guide

This repository contains Java and Python code to reproduce the computational elements described in the work:

R. Rossi, S. Prestwich, and S. A. Tarim, "Mixed-Integer Linear Programming Approximations for the Stochastic Knapsack," Computers & Operations Research, Elsevier, vol. 194, 107571, 2026.

What's Implemented

Static

Dynamic

Instances

Prerequisites

  • Java (JDK 11+), Maven, and Python 3.10+
  • IBM ILOG CPLEX Optimization Studio (OPL/Concert) with a valid license. The Java MILP code uses the OPL/Concert APIs (ilog.opl.*, ilog.concert.*, IloCplex) to build/solve models and callbacks.

Running Experiments (Java)

You can run batch drivers from your IDE (recommended) or from CLI with a full runtime classpath. Each batch writes instance JSON and solution CSVs under batch/<type>/<size>/<cv>[/<rho>] and prints progress to stdout.

Baselines (Python)

  • Run the heuristic/B&B over generated normal instances:
    1. Generate normal instances via SKPNormalBatch (it creates normal_instances.json under batch/...)
    2. From repo root or src/main/python/..., run one of:
python src/main/python/.../skp_batch.py    # solve normal_instances.json in the current directory
							               # or call recursive_solve() inside the script to traverse a root directory

Where outputs are written

  • Batch runs create per-experiment folders under batch/<instance_type>/<N>/<cv>[/<rho>], with:
    • normal_instances.json or multinormal_instances.json (inputs)
    • solved_.json and solved_.csv (solutions)
  • Curated CSVs used in the paper are mirrored under results/.