The document discusses current trends in supply chain optimization. It notes that logistics costs have increased more than 50% from 2002-2007 due to globalization and long lead times. As a result, sustainability in the face of disruptions has become more important than cost minimization alone. The document also outlines the speaker's research history, including work on the traveling salesman problem, vehicle routing, supply chain optimization, and supply chain risk management. It briefly describes an ongoing project modeling supply chain languages.
Mr. Python asked the God of Python how to tidy up his messy room of toys. The God taught Mr. Python to use the list method to store his toys in boxes that fell from heaven, allowing him to access toys by their position in the list. The God then suggested using a dictionary to allow Mr. Python to immediately retrieve his toys without sorting. Using these new organizational tools, Mr. Python was finally able to efficiently manage his toys.
3. オジェクトの例 (Gurobi)
• 変数オブジェクト x の属性
x.VarName => x の名前
x.LB => x の下限
• モデルオブジェクト m のメソッド
m.addVar() => m に変数を加える
m.addConstr() => m に制約を加える
m.optimize() => m を最適化する
5. リストの反復
• リスト内の要素を順に for 反復で取り出す
L= [1,4,6,7]
for i in L:
print i, => 1 4 6 7 と出力
• 要素の順番と中身が欲しい
L= [1,4,6,7]
for index,i in enumerate(L):
print index, i
=> 0 1
14
26
37
と出力
6. リスト内包表記
• リストを for 文を中に入れて生成
L= [ i for i in range(5) ]
=> [0 , 1, 2 ,3, 4] を返す
• if 文を入れて条件付きで生成
例: 0 から 10 までの奇数
(2で割った剰余が1) のリストを生成
[ i for i in range(11) if i%2 ==1 ]
=> [1, 3, 5, 7, 9] を返す
7. 合計を計算するための記法
• sum( ) で合計を計算
sum リストの中身の和をとる関数
例: sum ( [1,2,3] ) => 6を返す
リスト内包表記でリストを生成してもOK
例: sum( [ i for i in range(11)] ) =>55 を返す
リストを表す [ ] を省略してもOK
sum( i for i in range(11) )
8. 合計を計算するための記法 (Gurobi)
• sum( ) もしくは高速版 quicksum を使う
例:変数オブジェクトx,y,z の和をとる
sum ( [ x,y,z] ) => x+y+z を返す
リスト内包表記でリストを生成してもOK
例: 変数オブジェクト x[0], x[1],・・・, x[10] の
和をとる
sum( x[i] for i in range(11) )
=> x[0]+x[1]+ ・・・ +x[10] を返す
9. sum関数を用いた制約の追加の例
• モデルオブジェクト model に
x[0]+x[1]+・・・+x[10] <=8
を追加
model.addConstr(
sum( x[i] for i in range(11) ) <=8
)
大規模問題のときには quicksum を使う!