An Integer Programming Solver for The Wicker Rod Optimization Problem
To manufacture a wicker rattan box,
Can be found on theory.pdf
.
It's divided in the following sections:
- Introduction: A basic, non technical introduction to the problem
- Formalization and formulation: The necessary notions are formalized and the problem is formulated mathematically using this notions
- Formulations as an IP problem: An Integer Programming equivalent version of the problem in section 2 is formulated.
- Implementation details: Where some implementation caveats are explained
The whole implementation can be found under solver.py
. This solver is basically an adapter script on top of the python port for the IBM CPLEX solver for Integer Programming problems.
Assuming that you have python3 and pip3 installed in your system, running the solver is pretty simple: Start by downloading the CPLEX port by executing on a terminal
pip3 install cplex
Then you can run the solver with the desired parameters
python3 solver.py l l1 l2 l3 m1 m2 m3 n_bound
where l
is the rod length, l1 > l2 > l3
are the manufacturing lengths, m1, m2, m3
are the manufacturing multiplicities
and the best solution found using a batch size of at most n_bound
will be printed into STDOUT.
The following screenshot shows the output for the original problem's parameters, that motivated this development.