Skip to content

spinsphere/sawmill-quantum-optima

Repository files navigation

Quantum-Classical Hybrid Sawmill Optimization

A simulation framework that applies Quantum Approximate Optimization (QAOA) to the sawmill log-cutting problem, benchmarked against classical greedy packing. Based on FAO "Cost Estimation in Sawmilling Industries" parameters.

Quick Start

pip install qiskit qiskit-aer numpy matplotlib scipy
python main.py

This runs the full pipeline: generates 50 synthetic logs, solves each with both the classical greedy heuristic and the quantum (QAOA) solver, then produces comparison charts in output/.

Project Structure

├── main.py                  # Entry point — runs full benchmark
├── data_generator.py        # Synthetic 3D log & defect generation
├── qubo_formulation.py      # QUBO / Ising Hamiltonian construction
├── classical_solver.py      # Greedy packing baseline
├── quantum_solver.py        # QAOA-based hybrid solver
├── visualize_results.py     # Plotting & visualization
├── ARCHITECTURE.md          # Mathematical model & design docs
└── SUMMARY.md               # Results & analysis

How It Works

  1. Log Generation — Cylindrical logs with realistic taper and stochastic 3D defect zones are synthesized.
  2. Board Candidate Enumeration — Feasible board placements are identified within the log cross-section, respecting sapwood boundaries.
  3. QUBO Construction — An objective function maximizes board value while penalizing spatial overlaps and defect intersections.
  4. Solving — Both a greedy classical solver and a QAOA quantum solver produce cutting patterns.
  5. Defect Re-optimization — When a cut reveals a hidden defect, the quantum solver dynamically re-plans the remaining volume.
  6. Benchmarking — 50-log batches compare value recovery, waste, and computation time across both approaches.

About

Quantum-classical hybrid simulation for sawmill log cutting. Uses QAOA to optimize board placement around internal defects — benchmarked against greedy packing across 50 synthetic logs. Built with Qiskit, based on FAO sawmilling cost parameters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages