Skip to content

Commit f00c276

Browse files
authored
Release JijModeling 1.12.1
1 parent 0b1bc7c commit f00c276

13 files changed

+504
-209
lines changed

docs/en/_toc.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,32 @@
44
format: jb-book
55
root: introduction
66
parts:
7-
- caption: Switch Language
8-
chapters:
9-
- url: https://jij-inc.github.io/JijModeling-Tutorials/ja/
10-
title: 日本語
11-
- caption: Quick Start
12-
chapters:
13-
- file: quickstart/scip
14-
- file: quickstart/openjij
15-
- caption: Tutorial
16-
chapters:
17-
- file: tutorials/creating_models
18-
- file: tutorials/types_and_bounds
19-
- file: tutorials/expressions
20-
- file: tutorials/constraint_and_penalty
21-
- caption: Reference
22-
chapters:
23-
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
24-
title: "jijmodeling API Reference"
25-
- file: references/tips
26-
- file: references/cheat_sheet
27-
- caption: Release Note
28-
chapters:
29-
- file: releases/jijmodeling-1.12.0
30-
- file: releases/jijmodeling-1.11.0
31-
- file: releases/jijmodeling-1.10.1
32-
- file: releases/jijmodeling-1.10.0
33-
- file: releases/jijmodeling-1.9.0
34-
- file: releases/jijmodeling-1.8.0
7+
- caption: Switch Language
8+
chapters:
9+
- url: https://jij-inc.github.io/JijModeling-Tutorials/ja/
10+
title: 日本語
11+
- caption: Quick Start
12+
chapters:
13+
- file: quickstart/scip
14+
- file: quickstart/openjij
15+
- caption: Tutorial
16+
chapters:
17+
- file: tutorials/creating_models
18+
- file: tutorials/types_and_bounds
19+
- file: tutorials/expressions
20+
- file: tutorials/constraint_and_penalty
21+
- caption: Reference
22+
chapters:
23+
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
24+
title: jijmodeling API Reference
25+
- file: references/tips
26+
- file: references/cheat_sheet
27+
- caption: Release Note
28+
chapters:
29+
- file: releases/jijmodeling-1.12.1
30+
- file: releases/jijmodeling-1.12.0
31+
- file: releases/jijmodeling-1.11.0
32+
- file: releases/jijmodeling-1.10.1
33+
- file: releases/jijmodeling-1.10.0
34+
- file: releases/jijmodeling-1.9.0
35+
- file: releases/jijmodeling-1.8.0

docs/en/releases/jijmodeling-1.10.0.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"## Feature Enhancements\n",
1212
"\n",
13-
"### `Interpreter` 1-hot Constraint Detection\n",
13+
"### 1-hot Constraint Detection in `Interpreter`\n",
1414
"\n",
1515
"The `Interpreter` now identifies 1-hot constraints during constraint evaluation in the following form:\n",
1616
"\n",

docs/en/releases/jijmodeling-1.11.0.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"\n",
2121
"## Improvements in Hint Detection\n",
2222
"\n",
23-
"- You can now `hints` optional argument to `eval_problem`, which specifies the list of constraint types to be detected. This should be useful when you use specific solvers that supports only a subset of constraint types are supported.\n",
23+
"- You can now pass `hints` optional argument to `eval_problem`, which specifies the list of constraint types to be detected. This should be useful when you use specific solvers that supports only a subset of constraint types are supported.\n",
2424
" + `hints = None` (default): Detects the default set of constraint types (currently, `OneHot` only).\n",
2525
" + `hints = []`: Disables hint detection entirely.\n",
2626
"- Now hint detection mechanism can take into account some algebraic congruence (though not complete).\n",
@@ -30,7 +30,7 @@
3030
" \\sum_i 2 x_i + 1 = 3\n",
3131
" $$\n",
3232
"- Now `jm.eval_problem()` can derive additional constraints for duplicated variables. For example, if you have $\\sum_{i < 3} x_i = 1$ with $x_1 = x_2$, then it outputs new constraint $x_1 = 0$.\n",
33-
"- `jm.eval_problem()` can now raise an exception when infeasible constraint is detected, e.g. $\\sum_{i < 0} x_i = 1$.\n",
33+
"- `jm.eval_problem()` now raises an exception when infeasible constraint is detected, e.g. $\\sum_{i < 0} x_i = 1$.\n",
3434
"\n",
3535
"## Other Improvements\n",
3636
"\n",
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "plaintext"
8+
}
9+
},
10+
"source": [
11+
"# JijModeling 1.12.1 Release Notes\n",
12+
"\n",
13+
"## Feature Enhancements"
14+
]
15+
},
16+
{
17+
"cell_type": "markdown",
18+
"metadata": {},
19+
"source": [
20+
"### Human Readable Errors in Interpreters\n",
21+
"\n",
22+
"Now [`Interpreter`](https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html#Interpreter) fails with more human-readable error message. For example:"
23+
]
24+
},
25+
{
26+
"cell_type": "code",
27+
"execution_count": 15,
28+
"metadata": {},
29+
"outputs": [
30+
{
31+
"data": {
32+
"text/latex": [
33+
"$$\\begin{array}{cccc}\\text{Problem:} & \\text{shift\\_optimization} & & \\\\& & \\min \\quad \\displaystyle \\sum_{d = 0}^{D - 1} \\sum_{t = 0}^{T - 1} \\sum_{i = 0}^{N - 1} x_{d, t, i} & \\\\\\text{{s.t.}} & & & \\\\ & \\text{night\\_shift} & \\displaystyle R_{d + 1, i} \\leq x_{d, T - 1, i} & \\forall d \\in \\left\\{0,\\ldots,D - 1\\right\\} \\forall i \\in \\left\\{0,\\ldots,N - 1\\right\\} \\\\\\text{{where}} & & & \\\\& x & 3\\text{-dim binary variable}\\\\\\end{array}$$"
34+
],
35+
"text/plain": [
36+
"<jijmodeling.Problem at 0x105472000>"
37+
]
38+
},
39+
"execution_count": 15,
40+
"metadata": {},
41+
"output_type": "execute_result"
42+
}
43+
],
44+
"source": [
45+
"import jijmodeling as jm\n",
46+
"\n",
47+
"D = jm.Placeholder(\"D\", dtype=jm.DataType.INTEGER)\n",
48+
"T = jm.Placeholder(\"T\", dtype=jm.DataType.INTEGER)\n",
49+
"N = jm.Placeholder(\"N\", dtype=jm.DataType.INTEGER)\n",
50+
"H = jm.Placeholder(\"H\", shape=(D, T, N))\n",
51+
"R = jm.Placeholder(\"R\", shape=(D, N))\n",
52+
"\n",
53+
"x = jm.BinaryVar(\"x\", shape=(D, T, N))\n",
54+
"d = jm.Element(\"d\", belong_to=(0, D))\n",
55+
"t = jm.Element(\"t\", belong_to=(0, T))\n",
56+
"i = jm.Element(\"i\", belong_to=(0, N))\n",
57+
"\n",
58+
"problem = jm.Problem(name=\"shift_optimization\")\n",
59+
"problem += jm.Constraint(\"night_shift\", R[d+1, i] <= x[d, T-1, i], forall=[d, i])\n",
60+
"problem += jm.sum([d, t, i], x[d, t, i])\n",
61+
"\n",
62+
"problem"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": 17,
68+
"metadata": {},
69+
"outputs": [
70+
{
71+
"name": "stdout",
72+
"output_type": "stream",
73+
"text": [
74+
"Traceback (most recent last):\n",
75+
" while evaluating Problem `shift_optimization',\n",
76+
" while evaluating constraint: `night_shift',\n",
77+
" while evaluating expression `R[d + 1, i] - x[d, T - 1, i]',\n",
78+
" while evaluating expression `R[d + 1, i]',\n",
79+
"\n",
80+
"IndexError: Index [7, 0] is out of range for shape [7, 5]\n"
81+
]
82+
}
83+
],
84+
"source": [
85+
"num_days = 7\n",
86+
"num_times = 3\n",
87+
"num_people = 5\n",
88+
"\n",
89+
"data = problem.generate_random_dataset(\n",
90+
" options={\n",
91+
" \"D\": {\"value\": num_days},\n",
92+
" \"T\": {\"value\": num_times},\n",
93+
" \n",
94+
" \"N\": {\"value\": num_people},\n",
95+
" }\n",
96+
")\n",
97+
"interp = jm.Interpreter(data)\n",
98+
"\n",
99+
"try:\n",
100+
" interp.eval_problem(problem)\n",
101+
"except Exception as e:\n",
102+
" print(e)"
103+
]
104+
},
105+
{
106+
"cell_type": "markdown",
107+
"metadata": {},
108+
"source": [
109+
"## Bugfixes"
110+
]
111+
},
112+
{
113+
"cell_type": "markdown",
114+
"metadata": {},
115+
"source": [
116+
"### Fixes the Performance Bug in `Interpreter.eval_*`.\n",
117+
"\n",
118+
"Previously, evaluating expressions with `Interpreter` takes much more times than intended.\n",
119+
"This was due to the direct call to the arithmetic operations on OMMX `Function`s, which goes through conversion between intermediate expressions and re-allocates memory from the ground up. This results in quadratic performance degradation in some summation operations.\n",
120+
"\n",
121+
"Now JijModeling uses dedicated intermediate form of functions, so the overhead of conversion should be greatly tamed now."
122+
]
123+
}
124+
],
125+
"metadata": {
126+
"kernelspec": {
127+
"display_name": ".venv",
128+
"language": "python",
129+
"name": "python3"
130+
},
131+
"language_info": {
132+
"codemirror_mode": {
133+
"name": "ipython",
134+
"version": 3
135+
},
136+
"file_extension": ".py",
137+
"mimetype": "text/x-python",
138+
"name": "python",
139+
"nbconvert_exporter": "python",
140+
"pygments_lexer": "ipython3",
141+
"version": "3.9.20"
142+
}
143+
},
144+
"nbformat": 4,
145+
"nbformat_minor": 2
146+
}

docs/ja/_toc.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,32 @@
44
format: jb-book
55
root: introduction
66
parts:
7-
- caption: Switch Language
8-
chapters:
9-
- url: https://jij-inc.github.io/JijModeling-Tutorials/en/
10-
title: English
11-
- caption: "クイックスタート"
12-
chapters:
13-
- file: quickstart/scip
14-
- file: quickstart/openjij
15-
- caption: "チュートリアル"
16-
chapters:
17-
- file: tutorials/creating_models
18-
- file: tutorials/types_and_bounds
19-
- file: tutorials/expressions
20-
- file: tutorials/constraint_and_penalty
21-
- caption: "リファレンス"
22-
chapters:
23-
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
24-
title: "jijmodeling API Reference"
25-
- file: references/tips
26-
- file: references/cheat_sheet
27-
- caption: "リリースノート"
28-
chapters:
29-
- file: releases/jijmodeling-1.12.0
30-
- file: releases/jijmodeling-1.11.0
31-
- file: releases/jijmodeling-1.10.1
32-
- file: releases/jijmodeling-1.10.0
33-
- file: releases/jijmodeling-1.9.0
34-
- file: releases/jijmodeling-1.8.0
7+
- caption: Switch Language
8+
chapters:
9+
- url: https://jij-inc.github.io/JijModeling-Tutorials/en/
10+
title: English
11+
- caption: クイックスタート
12+
chapters:
13+
- file: quickstart/scip
14+
- file: quickstart/openjij
15+
- caption: チュートリアル
16+
chapters:
17+
- file: tutorials/creating_models
18+
- file: tutorials/types_and_bounds
19+
- file: tutorials/expressions
20+
- file: tutorials/constraint_and_penalty
21+
- caption: リファレンス
22+
chapters:
23+
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
24+
title: jijmodeling API Reference
25+
- file: references/tips
26+
- file: references/cheat_sheet
27+
- caption: リリースノート
28+
chapters:
29+
- file: releases/jijmodeling-1.12.1
30+
- file: releases/jijmodeling-1.12.0
31+
- file: releases/jijmodeling-1.11.0
32+
- file: releases/jijmodeling-1.10.1
33+
- file: releases/jijmodeling-1.10.0
34+
- file: releases/jijmodeling-1.9.0
35+
- file: releases/jijmodeling-1.8.0

0 commit comments

Comments
 (0)