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

Retrieve the objective function value for multiple solutions

回答済み

コメント

3件のコメント

  • 正式なコメント
    Gwyneth Butera
    • Gurobi Staff

    Hi Ana - Please see Retrieving Solutions in the Reference Manual:

    Sub-optimal solutions can be obtained by first setting the SolutionNumber parameter and then querying the Xn attribute to obtain the solution or the PoolObjVal attribute to obtain the objective value for the corresponding solution.

    Gwyneth

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Ana Guasque Ortega
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Many thanks! That was the solution. 

    Is there any way of obtaining not-repeated solutions? For example, in a classical multiple Knapsack problem, if I have 2 bins and 4 items, I'll get these solutions:

    Solution 1: 

          Bin0: item0, item2, item3

          Bin1: item 1

    Solution 2: 

          Bin0: item 1

          Bin1: item0, item2, item3

    , and they are equal. I also get other solutions, which are exactly the same, for example Solution3 = Solution 2. Is they any way of avoiding this if I don't know the actual number of solutions or should I evaluate them later?

    Thanks.

    0

投稿コメントは受け付けていません。