model = cp_model.CpModel()
variables = []
for i in range(N):
variables.append(model.NewBoolVar("variable_n%d" % i))
conditions = []
for clause in clauses:
assert len(clause) <= 3
conditions.append(model.AddBoolOr([variables[i] for i in clause]))
model.Maximize(sum(conditions))
model.Add(sum(variables) <= M)
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/4455ba6d-5310-480d-a147-ceef1eb4e701%40googlegroups.com.
solver = cp_model.CpSolver()
solver.parameters.log_search_progress = True
solver.parameters.num_search_workers = 4
status = solver.Solve(model)
Parameters: log_search_progress: true num_search_workers: 4
Optimization model '':
#Variables: 108600 (78600 in objective)
- 108600 in [0,1]
#kBoolAnd: 78600 (#enforced: 78600) (#literals: 220800)
#kBoolOr: 78600 (#enforced: 78600) (#literals: 220800)
#kLinearN: 1
*** starting model presolve at 0.03s
- 0 affine relations were detected.
- 0 variable equivalence relations were detected.
- rule 'bool_or: removed enforcement literal' was applied 78600 times.
- rule 'linear: simplified rhs' was applied 1 time.
- rule 'presolve: iteration' was applied 1 time.
Optimization model '':
#Variables: 108600 (78600 in objective)
- 108600 in [0,1]
#kBoolAnd: 78600 (#enforced: 78600) (#literals: 220800)
#kBoolOr: 78600 (#literals: 299400)
#kLinearN: 1
*** starting Search at 3.35s with 4 workers and strategies: [ auto, lp_br, pseudo_cost, no_lp, helper, rnd_lns_auto, var_lns_auto, cst_lns_auto, rins/rens_lns_auto ]
#Bound 3.98s best:-inf next:[-0,78600] no_lp
#1 4.20s best:74038 next:[74039,78600] no_lp num_bool:108600
#2 4.25s best:74039 next:[74040,78600] no_lp num_bool:108600
#3 7.04s best:74040 next:[74041,78600] no_lp num_bool:108600
#4 17.48s best:74041 next:[74042,78600] pseudo_cost num_bool:108600
#5 609.68s best:74042 next:[74043,78600] no_lp num_bool:108600
#6 609.79s best:74043 next:[74044,78600] no_lp num_bool:108600
#7 1022.74s best:74044 next:[74045,78600] no_lp num_bool:108600
#8 1023.00s best:74045 next:[74046,78600] no_lp num_bool:108600
#9 1024.32s best:74046 next:[74047,78600] no_lp num_bool:108600
#10 1122.25s best:74048 next:[74049,78600] no_lp num_bool:108600
#11 1124.18s best:74049 next:[74050,78600] no_lp num_bool:108600
#12 1497.10s best:74050 next:[74051,78600] no_lp num_bool:108600
#13 2156.26s best:74051 next:[74052,78600] no_lp num_bool:108600
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/a9953a72-001c-4ac6-b135-8919fb0baf4a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/CABqCn%3DdmWzAceUgjHu-K0kqqq16KPpqry7EiVueb9GfjX5-1Eg%40mail.gmail.com.