cleanups
This commit is contained in:
@@ -34,8 +34,8 @@ from typing import Dict, Sequence
|
||||
from absl import app
|
||||
from absl import flags
|
||||
|
||||
from ortools.sat.python import cp_model
|
||||
|
||||
from ortools.sat.python import cp_model
|
||||
|
||||
_INPUT = flags.DEFINE_string("input", "", "Input file to parse and solve.")
|
||||
_PARAMS = flags.DEFINE_string("params", "", "Sat solver parameters.")
|
||||
|
||||
@@ -26,9 +26,9 @@ import collections
|
||||
from absl import app
|
||||
from absl import flags
|
||||
|
||||
from ortools.sat.python import cp_model
|
||||
from ortools.scheduling import rcpsp_pb2
|
||||
from ortools.scheduling.python import rcpsp
|
||||
from ortools.sat.python import cp_model
|
||||
|
||||
_INPUT = flags.DEFINE_string("input", "", "Input file to parse and solve.")
|
||||
_OUTPUT_PROTO = flags.DEFINE_string(
|
||||
|
||||
@@ -68,12 +68,8 @@ def solve_sudoku() -> None:
|
||||
if initial_grid[i][j]:
|
||||
model.add(grid[(i, j)] == initial_grid[i][j])
|
||||
|
||||
model.export_to_file('/tmp/sudoku_sat.pb.txt')
|
||||
|
||||
# Solves and prints out the solution.
|
||||
solver = cp_model.CpSolver()
|
||||
solver.parameters.num_workers = 1
|
||||
solver.parameters.log_search_progress = True
|
||||
status = solver.solve(model)
|
||||
if status == cp_model.OPTIMAL:
|
||||
for i in line:
|
||||
|
||||
Reference in New Issue
Block a user