The code sample
Presents the code sample used in this tutorial.
This tutorial shows how to use external functions and work with a run configuration of the cutstock example.
In the code sample Using an external knapsack algorithm, the cutstock_ext_main example shows how to call a knapsack dynamic programming algorithm written in Java from an OPL main column generation script. This is an extension of the distributed example cutstock_main, which uses CPLEX to solve the subproblem consisting of a simple knapsack constraint. For this type of constraint, powerful specific algorithms, with a polynomial complexity, are provided. The same kind of mechanism could be used to solve shortest-path problems, flow in graph problems, or any other subproblem in which dedicated efficient algorithms can be implemented in Java.