First, I added a new model: a portfolio optimization model that shows matrix-based modeling and computes matrix data using numpy.
Next, I cleaned the code of the TSP, luggage and milk models. Specifically:
Replaced superfluous sets (lists) with direct initialization of objects
Made better use of tupledict.sum()
For symmetric models (TSP, milk), replaced constraint x[j,i] == x[i,j] with copying objects; this also has the side-effect that TSP now fits inside the trial size limit
Simplified callback functions
Added hierarchical objective to luggage model, so that it fully implements HP Williams' example
First, I added a new model: a portfolio optimization model that shows matrix-based modeling and computes matrix data using numpy.
Next, I cleaned the code of the TSP, luggage and milk models. Specifically: