I am trying to write a mixed integer linear programming for a constraint related to the rank of a specific variable, as follows:
- I have X1, X2, X3, X4 as decision variables.
- There is a constraint asking to define i as a rank of X1 (For example, if X1 is the largest number amongst X1, X2, X3, X4, then i=1; if X1 is the second largest number then i=2, if X1 is the 3rd largest number then i=3, else i=4)
How could I write this constraint into a mixed integer linear programming?