メインコンテンツへスキップ

Gurobi Java API

コメント

2件のコメント

  • Tobias Achterberg
    Gurobi Staff Gurobi Staff

    Why do you want to use SOS1? An SOS1 constraint says that at most one of the variables must be non-zero. If all variables are binary (as in your case), an SOS1 constraint on a set x1, x2, ..., xn is therefore equivalent to a linear constraint

    x1 + x2 + ... + xn <= 1

    Consequently, the all-zero solution is feasible. But in your AMPL model you have equations. Why don't you just use linear constraints just like in the AMPL model?

    0
  • A.Omidi
    Gurobi-versary
    Conversationalist
    Investigator

    Dear Tobias,

    Thanks for your reply.

    I have written the model using binary (or integer) variables and it works fine (using GUROBI Java API). AKAIK, the SOS1 variables could reduce the solving time. In the GAMS/Gurobi with the define of SOS1 variable it works and the solution is the same as the binary variable solution. I try to write the model using GUROBI Java API but, I have issues that mentioned before (to use SOS1). Unfortunately, I have a problem to write such constraint. Could you tell me is there any way to use SOS1 to my model or the only possible way is to use binary (or integer) variables?
    I would be appreciated for any help.

    Regards

    Omidi. A 

     

    0

サインインしてコメントを残してください。