Approximation & benchmarking framework for discrete optimization: (1D,2D) packing, scheduling,
Approx-Pack-Schedule is a research-oriented implementation and empirical evaluation of classical approximation algorithms for:
- 1D Bin Packing
- 2D Bin Packing
- Identical Machine Scheduling
- Unrelated Machine Scheduling (LP Relaxation + Rounding)
The project emphasizes:
- Clean and modular algorithm implementations
- Theoretical lower bounds
- Empirical approximation ratios
- Runtime scaling analysis
- Config-driven reproducible experiments
This repository is designed as an algorithm engineering project combining theory and experimentation.
- First Fit (FF)
- Best Fit (BF)
- First Fit Decreasing (FFD)
- Best Fit Decreasing (BFD)
- Hybrid heuristics
Volume lower bound:
- Number of bins
- Gap vs lower bound
- Approximation ratio
- Runtime
- Shelf (height-decreasing)
- Guillotine greedy
- Hybrid (best-of Shelf & Guillotine)
Area lower bound:
Rotation is currently not considered.
- List Scheduling
- LPT (Longest Processing Time first)
| Algorithm | Typical Ratio |
|---|---|
| LIST | ~1.03–1.15 |
| LPT | ~1.00–1.02 |
Minimize makespan ( T )
Subject to:
- SciPy
linprog(HiGHS backend)
- Assign each job to machine with largest fractional value
- Optional local search improvement
- Greedy baseline comparison
- 2-approximation
Typically:
LP_ROUND ≈ 1.10–1.20vs LP boundLP_ROUND + LSimproves further
Experiments are fully configurable via YAML:
python scripts/run_experiments.py --config configs/packing1d_small.yamlEach experiment execution records:
taskdistributioninstance_sizenum_machines(if applicable)seedalgorithmobjective_valuelower_boundlp_optimum(if applicable)approximation_ratioruntime
Results are saved under:
results/experiments/<experiment_name>/
- Uniform(0,1)
- Bimodal
- Heavy-tail
- Uniform processing times
- Exponential
- Correlated machine speeds (unrelated machines)
- Approximation ratio histograms
- Runtime vs. ( n ) scaling curves
- LP rounding quality plots
- Comparative scaling curves
All plots use Matplotlib.
src/apsuite/
packing1d/
packing2d/
scheduling/
identical/
unrelated/
experiments/
scripts/
run_experiments.py
plot_experiments.py
run_sched_unrelated.py
...
configs/
*.yaml
results/
tables/
figures/
experiments/
tests/
environment.yml
git clone https://github.com/Dipesh-Lc/approx-pack-schedule.git
cd approx-pack-scheduleconda env create -f environment.yml
conda activate approx-pack-schedulepip install -e .pytest -qAll phases are covered by unit tests:
- Packing heuristics
- Lower bounds
- Scheduling algorithms
- LP solver integration
- Rounding validity
- Local search improvement
python scripts/run_experiments.py --config configs/packing1d_scale.yamlpython scripts/plot_experiments.py --exp_dir results/experiments/packing1d_scale- Explicit random seeds
- Config-driven instance generation
- CSV result logging
- Deterministic rounding
- No hidden randomness
Designed to mirror research-grade experimental pipelines.
- FFD consistently near best practical heuristic
- Hybrid strategies sometimes improve robustness
- Shelf performs well on uniform
- Guillotine struggles on heavy-tail
- Hybrid improves consistency
- LPT nearly optimal empirically
- LP rounding significantly improves greedy baseline
- Local search provides additional gains
- Empirical ratios far below worst-case 2-approximation bound
- Classical approximation algorithms
- Clear separation of:
- Algorithm logic
- Lower bounds
- Experiment harness
- Runtime measured in harness, not algorithms
- Clean and extensible architecture
- Focus on clarity and reproducibility
Potential future work:
- 2D packing with rotation
- Karmarkar-Karp heuristic
- Exact ILP solver comparisons
- Statistical confidence intervals
- Log-scale runtime plots
- Advanced correlated speed models
- Larger LP experiments
- Coffman, Garey, Johnson -- Bin Packing
- Graham (1966) -- List Scheduling
- Shmoys & Tardos -- LP Rounding for Scheduling
- Williamson & Shmoys -- The Design of Approximation Algorithms
- ✅ Phase 1 -- 1D Packing
- ✅ Phase 2 -- 2D Packing
- ✅ Phase 3 -- Identical Scheduling
- ✅ Phase 4 -- Unrelated Scheduling
- ✅ Phase 5 -- Experiment Harness
- ✅ Phase 6 -- Experimental Evaluation
MIT License
Dipesh
Independent Research Project
Discrete Optimization & Approximation Algorithms
2026