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

How to add a binary variable without objective value using the Java API

回答済み

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Michael,

    You can set the obj argument value to 0. Then, the variable will not be added to the objective function. Note that 0 is the default value for the obj argument in the addVar Python method, that is why it is not necessary to explicitly set it.

    PPS: How do I format Math equations on this forum?

    This is explained in Posting to the Community Forum. You can either use \(\texttt{\\( \\)}\) or \(\texttt{\[ \]}\) to enclose math code.

    Best regards, 
    Jaromił

    0

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