問題文 考え方 • LpVariableで決定変数を定義する。 • name:変数の名前 • cat:変数の型 • {0, 1}変数は’Binary’と指定する • 商品集合Iを用いた内包表記で1行で定義を行う • pulpでは以下のように書いても同様の辞書に格納された決定 変数を定義することができる x = {i: pulp.Lpvariable(name=f’x{i}’, cat=‘Binary’) for i in I} x = pulp.Lpvariable.dicts(’x’, I, cat=’Binary’)