Skip to content

CPSAT presolve makes hint infeasible #4693

Closed

Description

@sghb

Hi,

It seems presolving can break a hint to CPSAT; see below.

Starting CP-SAT solver v9.13.4784
Parameters: log_search_progress: true

...

Starting presolve at 0.00s
The solution hint is complete and is feasible. Its objective value is 75235.

...

Preloading model.
#Bound   0.01s best:-inf  next:[-364008,315384] initial_domain
The solution hint is complete, but it is infeasible! we will try to repair it.
#Model   0.01s var:26/27 constraints:11/11

Is there anything I can do about this?

Activity

  1. lperron commented on Jun 18, 2025

    @lperron
    Collaborator

    please attach the model

  2. sghb commented on Jun 18, 2025

    @sghb
    Author
  3. lperron commented on Jun 18, 2025

    @lperron
    Collaborator

    Thanks. We will look at it.

  4. added theissue type on Jun 18, 2025
  5. added this to the v9.15 milestone on Jun 18, 2025
  6. added a commit that references this issue on Jun 23, 2025
    0ac20df
  7. lperron commented on Jun 23, 2025

    @lperron
    Collaborator

    Fixed on main.

    Thanks

  8. MarcelloTheArcane commented on Aug 11, 2025

    @MarcelloTheArcane

    @lperron I'm getting the same issue. I've got a big list of variables, if I truncate it to a small value, it works as expected.

    Logs and models attached - it's a multi-stage solve, and happens on stages 2 and 3.

    solve_2.txt
    solve_3.txt
    before_stage_2_clean.txt
    before_stage_3_clean.txt

    If I set solver.parameters.keep_all_feasible_solutions_in_presolve = True from #4373 it works, but I'm worried it might be slowing the solve down.

  9. lperron commented on Aug 11, 2025

    @lperron
    Collaborator
  10. lperron commented on Aug 11, 2025

    @lperron
    Collaborator

    This is what I get on main:

    Presolved optimization model 'before_stage_2_clean': (model_fingerprint: 0x87bca2315ef6884c)
    #Variables: 2'679 (#bools: 152 in objective) (2'255 primary variables)
      - 2'679 Booleans in [0,1]
    #kAtMostOne: 947 (#literals: 3'072)
    #kBoolAnd: 1'001 (#enforced: 1'001) (#literals: 3'894)
    #kBoolOr: 1 (#literals: 56)
    #kExactlyOne: 424 (#literals: 2'019)
    #kLinearN: 29 (#enforced: 1 #multi: 1) (#terms: 2'897)
    [Symmetry] Graph for symmetry has 10'994 nodes and 20'780 arcs.
    [Symmetry] Symmetry computation done. time: 0.003059 dtime: 0.00849814
    [Symmetry] #generators: 73, average support size: 42.9863
    [Symmetry] 398 orbits on 1967 variables with sizes: 24,24,24,24,24,24,24,24,24,10,...
    [Symmetry] Found orbitope of size 35 x 10
    
    Preloading model.
    #Bound   0.32s best:inf   next:[140,292]  initial_domain
    #1       0.32s best:219   next:[140,218]  complete_hint
    #Model   0.32s var:2679/2679 constraints:2402/2402
    
    

    and

    Presolved optimization model 'before_stage_3_clean': (model_fingerprint: 0x7d9e50ce457992db)
    #Variables: 2'967 (#bools: 512 in objective) (2'537 primary variables)
      - 2'967 Booleans in [0,1]
    #kAtMostOne: 1'155 (#literals: 3'751)
    #kBoolAnd: 992 (#enforced: 992) (#literals: 3'896)
    #kBoolOr: 124 (#literals: 425)
    #kExactlyOne: 430 (#literals: 2'038)
    #kLinearN: 30 (#terms: 3'124)
    [Symmetry] Graph for symmetry has 11'879 nodes and 22'320 arcs.
    [Symmetry] Symmetry computation done. time: 0.003463 dtime: 0.00980875
    [Symmetry] #generators: 87, average support size: 50.5977
    [Symmetry] 451 orbits on 2652 variables with sizes: 24,24,24,24,24,24,24,24,24,16,...
    [Symmetry] Found orbitope of size 36 x 16
    
    Preloading model.
    #Bound   0.33s best:inf   next:[227,851]  initial_domain
    #1       0.33s best:608   next:[227,607]  complete_hint
    #Model   0.34s var:2967/2967 constraints:2731/2731
    
  11. MarcelloTheArcane commented on Aug 12, 2025

    @MarcelloTheArcane

    Both the examples above don't work for me on v9.14.6206, they are two different solve stages.

    Here are some more complete examples:

    Small model, keep_all_feasible_solutions_in_presolve = False

    Small model, keep_all_feasible_solutions_in_presolve = True

    Large model, keep_all_feasible_solutions_in_presolve = False

    Large model, keep_all_feasible_solutions_in_presolve = True

  12. lperron commented on Aug 12, 2025

    @lperron
    Collaborator
  13. MarcelloTheArcane commented on Aug 13, 2025

    @MarcelloTheArcane

    Thanks @lperron!

    How long will it be before this gets to pip, or do I need to build from source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions