Forum Discussion

FICO's avatar
FICO
Community Manager
6 years ago

Has anyone seen an issue with binary variables becoming non-binary?

I'm new to the community and fairly new to xpress. I've attached my code for the project (both as text and PDF). Whenever I am running this code, I am getting a solution but my solutions are not binary. I'm hoping someone has seen this issue before and can point me in the right direction.

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    Your current model formulation results in an infeasibility.

    As a general recommendation, I would suggest that you check the problem status before trying to report on a solution. In addition, for debugging purposes it is usually helpful to enable the display of the solver log, e.g., surrounding the call to the solver by the following lines:

    setparam("XPRS_verbose",true)

    minimize(Cost)

    if getprobstat=XPRS_INF then

     writeln("Problem is infeasible")

     exit(1)

    end-if

    I think that the infeasibility is related to the constraints for eliminating sub-cycles.

    With the following form I obtain a feasible solution:

    n(1) = 0

    forall(i,j in 2..Orders+1|i<>j) n(i) - n(j) + Orders*x(i,j) <= Orders-1