Skip to main content

Solutions are the same for darts game

Answered

Comments

10 comments

  • Official comment
    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?.
  • Matthias Miltenberger
    • Gurobi Staff

    Hi Huib,

    It seems that you have deleted your previous post about the same issue - including the entire discussion. This community forum is also meant to help solve similar issues of other users, so please do not delete your post after it has been answered.

    Best regards,
    Matthias

    0
  • Huib Meulenbelt
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Hi Matthias,

    Noted. The answer of Jaromił gave as output only S2. I included his excellent tips and added the loop over the solutions, making this question/script way more robust. However, as a result my question changed to such an extend I believed I needed to open a new topic.

    0
  • Matthias Miltenberger
    • Gurobi Staff

    Hi Huib,

    It is completely fine to open a new post - also for related questions. This is actually good practice to keep single posts more concise and to the point.

    With the original discussion inaccessible now, your new post is more difficult to comprehend and answer.

    Best regards,
    Matthias

    0
  • Huib Meulenbelt
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Understood. Basically I want to know why SolutionNumber 1 is equal to SolutionNumber 4. If I run the code below for solution #1 

    print([(var.Xn, var.VarName) for var in m.getVars() if var.Xn != 0])

    I get the following output

    [(1.0, 'D1'), (1.0, 'new score')]

    If I run the same for #4 I get:

    [(1.0, 'D1'), (1.0, 'new score')]

    So, the solutions are the same right? Why doesn't my model observe this? Thanks in advance

    0
  • Huib Meulenbelt
    • Gurobi-versary
    • Investigator
    • Conversationalist

    After searching for similar topics I found the this topic https://support.gurobi.com/hc/en-us/community/posts/360074565451-Unexpected-identical-solutions-in-solutions-pool 

    Here the solution is to change PoolSearchMode to 1. If I do this, I only get a single solution, namely S1.

    "The behavior comes from how indicator constraints are handled during presolving." Can I change something in my code that prevents this mentioned behavior? Or is there another solution with PoolSearchMode = 1. Thanks in advance

    0
  • Tobias Achterberg
    • Gurobi Staff

    It is an interesting coincidence that you are running into this issue now, because I am currently trying to improve this behavior of Gurobi. I think that I found a nice way to do so and will pick up your model as an additional test. Thanks!

    0
  • Tobias Achterberg
    • Gurobi Staff

    Indeed, with our current development version, I still get the wrong behavior for your model:

    found 5 solutions
    S2 used
    D1 used
    S1 used
    D2 used
    D1 used

    But with my fix I get

    found 4 solutions
    S2 used
    D1 used
    S1 used
    D2 used

    I guess this is what you would have expected.

    This fix will most likely be part of the Gurobi 9.5 release, which is scheduled for November 2021.

    1
  • Huib Meulenbelt
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Okay good to hear! Looking forward to the new release!

    0
  • Maliheh Aramon
    • Gurobi Staff

    Hi Huib, 

    Gurobi 9.5 was recently released. Included in this release is a fix for the bug you observed, reporting duplicate solutions for a model with indicator constraints and PoolSearchMode=2. Using Gurobi 9.5, you should see the output you expected. 

    We hope this fix works well for you. Thank you for reporting this bug and please let us know of any other issues in the future.

    Best regards,

    Maliheh

    0

Post is closed for comments.