You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The underlying MILP backends always work with matrices where each column corresponds to a linear variable. The variable corresponding to the i-th column (counting from 0) is displayed as x_i. MixedIntegerLinearProgram maintains a dynamic mapping from the arbitrary keys indexing the components of MIPVariable objects to the backend variables (indexed by nonnegative integers).
However, Sage does not provide a way to get the corresponding index of the backend variable. These indices are important when it comes to conversion of a MILP instance into a polyhedron since they indicate which MIP variables correspond to which coordinates in the resulting polyhedron.
When the requested method is added, it should be mentioned in the documentation for the .polyhedron() method.
Proposed Solution
It seems possible to obtain the backend index from the string representation (as x_i) of a MIP variable as follows:
Problem Description
Documentation says:
However, Sage does not provide a way to get the corresponding index of the backend variable. These indices are important when it comes to conversion of a MILP instance into a polyhedron since they indicate which MIP variables correspond to which coordinates in the resulting polyhedron.
When the requested method is added, it should be mentioned in the documentation for the
.polyhedron()
method.Proposed Solution
It seems possible to obtain the backend index from the string representation (as
x_i
) of a MIP variable as follows:but internally there should be a more direct way to get this number.
Alternatives Considered
N/A
Additional Information
No response
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: