I use Python API in Cplex to solve a Linear programing problem. When using Cplex, I had the result below:
But then I saved my LP prolem as a lp file and use Cplex to solve again, the result was a little bit difference from the first one:
Below is my function:
def SubProblem(myobj,myrow,mysense,myrhs,mylb):
c = cplex.Cplex()
c.objective.set_sense(c.objective.sense.minimize)
c.variables.add(obj = myobj,lb = mylb)
c.linear_constraints.add(lin_expr = myrow, senses = mysense,rhs = myrhs)
c.solve()
lpfile = "Save_models\clem.lp"
c.write(lpfile)
print("\nFile '%s' was saved"%(lpfile))