google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
11.19k stars 2.12k forks source link

Dumping problematic LNS model #2779

Closed TeXitoi closed 3 years ago

TeXitoi commented 3 years ago

What version of OR-Tools and what language are you using? Version: v9.0 Language: rust via C++

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)

CP-SAT

What operating system (Linux, Windows, ...) and version?

Debian oldstable 10.10

What did you do?

During a search:

Starting CP-SAT solver.
Parameters: log_search_progress: true max_deterministic_time: 60 num_search_workers: 8

Initial optimization model '':
#Variables: 1441 (1 in objective)
  - 8 in [-2147483648,2147483647]
  - 1345 in [0,1]
  - 9 in [0,2]
  - 9 in [0,3]
  - 6 in [0,4]
  - 2 in [0,5]
  - 4 in [0,6]
  - 4 in [0,7]
  - 1 in [0,8]
  - 1 in [0,10]
  - 2 in [0,11]
  - 1 in [0,14]
  - 2 in [0,15]
  - 1 in [0,24]
  - 1 in [0,26]
  - 1 in [0,33]
  - 44 in [0,2147483647]
#kAtMostOne: 158 (#literals: 3729)
#kExactlyOne: 57 (#literals: 1345)
#kLinMax: 88
#kLinear1: 2
#kLinearN: 6 (#terms: 6750)

Starting presolve at 0.00s
[Probing] deterministic_time: 0.00878026 (limit: 1) wall_time: 0.051692 (1347/1347)
[Probing]  - new fixed Boolean: 205 (208/1347)
[Probing]  - new integer bounds: 2
[MaxClique] Merged 136(3153 literals) into 46(1139 literals) at_most_ones.

Presolve summary:
  - 209 affine relations were detected.
  - 204 variable equivalence relations were detected.
  - rule 'affine: new relation' was applied 6 times.
  - rule 'at_most_one: empty or all false' was applied 1 time.
  - rule 'at_most_one: removed literals' was applied 2 times.
  - rule 'at_most_one: satisfied' was applied 6 times.
  - rule 'at_most_one: transformed into max clique.' was applied 1 time.
  - rule 'at_most_one: x and not(x)' was applied 262 times.
  - rule 'exactly_one: removed literals' was applied 50 times.
  - rule 'exactly_one: satisfied' was applied 1 time.
  - rule 'exactly_one: singleton' was applied 2 times.
  - rule 'exactly_one: size one' was applied 1 time.
  - rule 'exactly_one: size two' was applied 5 times.
  - rule 'lin_max: Removed exprs' was applied 9 times.
  - rule 'linear: always true' was applied 1 time.
  - rule 'linear: fixed or dup variables' was applied 258 times.
  - rule 'linear: reduced variable domains' was applied 1 time.
  - rule 'linear: remapped using affine relations' was applied 14 times.
  - rule 'linear: singleton column' was applied 1 time.
  - rule 'linear: size one' was applied 2 times.
  - rule 'linear: variable substitution 0' was applied 5 times.
  - rule 'presolve: iteration' was applied 1 time.

Presolved optimization model '':
#Variables: 1216 (1130 in objective)
  - 1142 in [0,1]
  - 16 in [0,2]
  - 11 in [0,3]
  - 8 in [0,4]
  - 7 in [0,5]
  - 6 in [0,6]
  - 5 in [0,7]
  - 1 in [0,8]
  - 2 in [0,9]
  - 1 in [0,10]
  - 1 in [0,11]
  - 2 in [0,12]
  - 3 in [0,14]
  - 2 in [0,15]
  - 1 in [0,25]
  - 2 in [1,3]
  - 1 in [1,6]
  - 1 in [1,11]
  - 1 in [1,24]
  - 1 in [1,25]
  - 1 in [1,33]
  - 1 in [2,26]
#kAtMostOne: 44 (#literals: 1135)
#kBoolAnd: 2 (#enforced: 2) (#literals: 2)
#kExactlyOne: 48 (#literals: 1118)
#kLinMax: 88

Preloading model.
#Bound   0.07s best:-inf  next:[22,6328]  initial_domain

Starting Search at 0.07s with 8 workers and subsolvers: [ default_lp, reduced_costs, pseudo_costs, no_lp, max_lp, core, feasibility_pump, rnd_var_lns_default, rnd_cst_lns_default, graph_var_lns_default, graph_cst_lns_default, rins_lns_default, rens_lns_default ]
#1       0.17s best:316   next:[318,6328] core [hint] fixed_bools:1/1142
#Bound   0.17s best:316   next:[318,6188] core
I0618 10:58:59.302490  3710 cp_model_solver.cc:2654] Dumping problematic LNS model to '/tmp/.pbtxt'.
F0618 10:59:01.147460  3710 cp_model_solver.cc:2656] Infeasible LNS solution! rnd_var_lns_default(d=0.50 s=8 t=0.10 p=0.00)
*** Check failure stack trace: ***

dumped file: https://texitoi.eu/texitoi/.pbtxt

What did you expect to see

No crash

What did you see instead?

A crash

Anything else we should know about your project / environment

lperron commented 3 years ago

can you send us the .pbtxt model ?

lperron commented 3 years ago

So maybe the bug is still there, but we have become pedantic with hints, asking that the variable appears only once

Starting CP-SAT solver.
Setting number of workers to 16
Parameters: log_search_progress: true num_search_workers: 16
Invalid model: The solution hint contains duplicate variables like the variable with index #124

CpSolverResponse summary:
status: MODEL_INVALID
objective: 0
best_bound: 0
booleans: 0
conflicts: 0
branches: 0
propagations: 0
integer_propagations: 0
restarts: 0
lp_iterations: 0
walltime: 0.000176
usertime: 0.000176
deterministic_time: 0
primal_integral: 0
TeXitoi commented 3 years ago

Mmm, strange, will double check hint.

TeXitoi commented 3 years ago

Double checked, I can't see how I can have duplicates. Maybe that's the LNS generated model that duplicates hints?

lperron commented 3 years ago

can you send us the original model ? (model.ExportToFile("issue2779.pb.txt") ? (provided it is mapped from Rust to C++).

TeXitoi commented 3 years ago

I'll try, but can't guarantee as that's a chain of local optimization, and cp sat with 8 threads might not be deterministic.

TeXitoi commented 3 years ago

Seen a second time, so I should be able to find it by insisting.

My rust protobuf library don't support pbtxt, is it OK if I give a binary format, or I should bind something to c++ to have the text version?

lperron commented 3 years ago

binary is fine. Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53 00

Le mer. 22 sept. 2021 à 17:42, Guillaume P. @.***> a écrit :

Seen a second time, so I should be able to find it by insisting.

My rust protobuf library don't support pbtxt, is it OK if I give a binary format, or I should bind something to c++ to have the text version?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2779#issuecomment-925051099, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3PWSHMBV4V2UCWDRB3UDH2PFANCNFSM5EOUNETQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

TeXitoi commented 3 years ago

I suppose that's the same bug, and potentially related to #2784 I have an assertion fail:

2021-09-23 09:43:28: F0226 21:36:06.060791 10896 cp_model_solver.cc:3175] Check failed: SolutionIsFeasible( model_proto, std::vector<int64_t>(response->solution().begin(), response->solution().end()), &mapping_proto, &postsolve_mapping) final postsolved solution

while solving https://texitoi.eu/texitoi/bugs/check_failed_solution_is_feasible.pb

lperron commented 3 years ago

The last proto solves successfully on the master branch. Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53 00

Le jeu. 23 sept. 2021 à 09:49, Guillaume P. @.***> a écrit :

I suppose that's the same bug, and potentially related to #2784 https://github.com/google/or-tools/issues/2784 I have an assertion fail:

2021-09-23 09:43:28: F0226 21:36:06.060791 10896 cp_model_solver.cc:3175] Check failed: SolutionIsFeasible( model_proto, std::vector(response->solution().begin(), response->solution().end()), &mapping_proto, &postsolve_mapping) final postsolved solution

while solving https://texitoi.eu/texitoi/bugs/check_failed_solution_is_feasible.pb

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2779#issuecomment-925578389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3NGHOXFITWXKWGB2XLUDLLYFANCNFSM5EOUNETQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

TeXitoi commented 3 years ago

I can't reproduce on master. Closing it.