Originally posted by: EdKlotz
This can happen because CPLEX performs additional preprocessing when you give in an MILP instead of the associated relaxation. For example, consider the following two constraints and 4 binary variables
2x1 + x2 + x3 = 2
x2 + x3 + x4 <= 1
xj binary
For a MIP, CPLEX's probing will recognize that if x = 0, x2 = x3 = 1 by the first constraint, which results in an infeasibility in the second constraint. Hence, since x1 is binary, we can immediately fix x1 to 1 when preprocessing the MIP. We can't do that in the LP case. While it still is true that setting x = 0 results in infeasibility for the LP as well, we can't just fix x1 to 1 since solutions exist with fractional values (e.g. x1 = 1/2, x2 = 1, x3 = 0, x4 = 0). Thus, additional, integrality based preprocessing can make a difference.
As a test, you could try turning off CPLEX's presolve and probing parameters when you call cplexmilp. That would probably yield more consistent results (albeit consistently slow). However, I don't think even doing that would guarantee that you get the same results, as CPLEX still might take advantage of integrality in some other way before the initial root node relaxation solve.
If you need to solve the MILP, I don't see any good reason why you should want to solve the associated initial LP relaxation separately. How do you want to use that LP solution? In general I would recommend just solving the MILP directly.
#CPLEXOptimizers#DecisionOptimization