Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions docs/en/releases/unreleased.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 29 additions & 3 deletions docs/ja/releases/unreleased.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 23 additions & 3 deletions markdowns/en/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,29 @@ problem

## Bugfixes

### Bugfix 1
### Fixed excessive memory consumption during constraint detection with unbounded decision variables

Compiling a model in which a decision variable was made unbounded by giving it an infinite bound — for example, `upper_bound=float("inf")` — could consume memory without limit when constraint detection was enabled.

## Other Changes
This bug has been fixed in this release, and such models now compile successfully even when constraint detection is enabled.
In addition, an error is now raised at definition time when a bound is `NaN` or when the bounds are inherently infeasible, such as when the upper bound is negative infinity.

- Change 1
```{code-cell} ipython3
import jijmodeling as jm


@jm.Problem.define("production", sense=jm.ProblemSense.MINIMIZE)
def problem(problem: jm.DecoratedProblem):
T = problem.Length(description="number of periods")
demand = problem.Float(shape=(T,), description="demand per period")
# No upper limit on how much can be produced in a single period.
x = problem.ContinuousVar(
lower_bound=0.0, upper_bound=float("inf"), shape=(T,)
)

problem += jm.sum(x[t] for t in T)
problem += problem.Constraint("meet_demand", [x[t] >= demand[t] for t in T])


problem.eval({"T": 3, "demand": [1.0, 2.0, 3.0]})
Comment thread
konn marked this conversation as resolved.
```
26 changes: 23 additions & 3 deletions markdowns/ja/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,29 @@ problem

## バグ修正

### バグ修正 1:
### 上限・下限が非有界な決定変数の存在下で制約検出がメモリを大量に消費する問題の修正

`upper_bound=float("inf")` のように決定変数へ無限大の上下界を与え非有界に指定したモデルを制約検出が有能な状態でコンパイルすると、メモリを際限なく消費することがありました。
Comment thread
konn marked this conversation as resolved.
Outdated

## その他の変更
今回のリリースではこのバグが修正され、制約検出が有効な状態でも問題なく実行されるようになりました。
また、併せて上下界に NaN を与えられたり、上界が負の無限大であるなどそもそも充足不能な場合には、定義時にエラーとなるようになりました。

- 変更 1:
```{code-cell} ipython3
import jijmodeling as jm


@jm.Problem.define("production", sense=jm.ProblemSense.MINIMIZE)
def problem(problem: jm.DecoratedProblem):
T = problem.Length(description="number of periods")
demand = problem.Float(shape=(T,), description="demand per period")
# 1 期あたりの生産量に上限を設けない
x = problem.ContinuousVar(
lower_bound=0.0, upper_bound=float("inf"), shape=(T,)
)

problem += jm.sum(x[t] for t in T)
problem += problem.Constraint("meet_demand", [x[t] >= demand[t] for t in T])


problem.eval({"T": 3, "demand": [1.0, 2.0, 3.0]})
Comment thread
konn marked this conversation as resolved.
```
Loading