I am spinning up on ILPs using Matlab tools as the "vehicle" for this. They have both a conventional "solver" based (SB) formulation and a "problem" based (PB) formulation at a higher level of abstraction.
The difference between SB and PB is that, for PB, the user doesn't have to worry about what problem variables map to elements of the ILP column vector of variables. An optimization problem object accepts the optimization function and equality/inequality constraints in symbolic form, and the class methods handle the bookkeeping of defining a column vector of problem variables, the coefficients of the optimization function and the matrices & associated RHSs for equality & inequality constraints.
One can actually examine the SB counterpart to the PB formulation by using prob2struct
to convert from PB to SB. Unfortunately, it isn't clear how prob2struct
decides which PB variables map to which elements of the column vector of variables.
I tried searching through the optimization problem object in the PB formulation to see if it contains its own internal SB formulation details (regardless if it matches those of prob2struct
), or at least the variable mapping. I couldn't find such details.
For prob2struct
, is there a reliable rule for us to know which symbolic PB variables maps to which elements in the SB's column vector of variables?