Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Aug 16, 2023
1 parent 7ab3a53 commit 7c8d37a
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 210 deletions.
6 changes: 3 additions & 3 deletions examples/notebook/algorithms/knapsack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
" ]\n",
" weights = [\n",
" # fmt: off\n",
" [7, 0, 30, 22, 80, 94, 11, 81, 70, 64, 59, 18, 0, 36, 3, 8, 15, 42, 9, 0,\n",
" 42, 47, 52, 32, 26, 48, 55, 6, 29, 84, 2, 4, 18, 56, 7, 29, 93, 44, 71, 3,\n",
" 86, 66, 31, 65, 0, 79, 20, 65, 52, 13],\n",
" [7, 0, 30, 22, 80, 94, 11, 81, 70, 64, 59, 18, 0, 36, 3, 8, 15, 42, 9, 0,\n",
" 42, 47, 52, 32, 26, 48, 55, 6, 29, 84, 2, 4, 18, 56, 7, 29, 93, 44, 71,\n",
" 3, 86, 66, 31, 65, 0, 79, 20, 65, 52, 13],\n",
" # fmt: on\n",
" ]\n",
" capacities = [850]\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebook/algorithms/simple_knapsack_program.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"\n",
" weights = [\n",
" # fmt:off\n",
" [565, 406, 194, 130, 435, 367, 230, 315, 393, 125, 670, 892, 600, 293, 712, 147, 421, 255],\n",
" [565, 406, 194, 130, 435, 367, 230, 315, 393, 125, 670, 892, 600, 293, 712, 147, 421, 255],\n",
" # fmt:on\n",
" ]\n",
" capacities = [850]\n",
Expand Down
5 changes: 3 additions & 2 deletions examples/notebook/examples/cover_rectangle_sat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
" print(\"%s found in %0.2fs\" % (solver.StatusName(status), solver.WallTime()))\n",
"\n",
" # Prints solution.\n",
" if status == cp_model.OPTIMAL or status == cp_model.FEASIBLE:\n",
" solution_found = status == cp_model.OPTIMAL or status == cp_model.FEASIBLE\n",
" if solution_found:\n",
" display = [[\" \" for _ in range(size_x)] for _ in range(size_y)]\n",
" for i in range(num_squares):\n",
" sol_x = solver.Value(x_starts[i])\n",
Expand All @@ -175,7 +176,7 @@
"\n",
" for line in range(size_y):\n",
" print(\" \".join(display[line]))\n",
" return status == cp_model.OPTIMAL\n",
" return solution_found\n",
"\n",
"\n",
"def main(argv: Sequence[str]) -> None:\n",
Expand Down
Loading

0 comments on commit 7c8d37a

Please sign in to comment.