f(x) x S (optimal solution) f(x ) (optimal value) f(x) (1) 3 GLPK glpsol -m -d -m glpsol -h -m -d -o -y --simplex ( ) --interior --min --max --check -



Similar documents
( ) () () ( ) () () () ()

( ) ? () 1.1 ( 3 ) j x j 10 j 1 10 j = 1,..., 10 x 1 + x x 10 =

min. z = 602.5x x 2 + 2

2 1/2 1/4 x 1 x 2 x 1, x 2 9 3x 1 + 2x 2 9 (1.1) 1/3 RDA 1 15 x /4 RDA 1 6 x /6 1 x 1 3 x 2 15 x (1.2) (1.3) (1.4) 1 2 (1.5) x 1

. p.1/34

(B2) 序章 FICO Xpressの基礎

OR 2 Excel OK. 1a: Excel2007 Office. Excel b OK. 2.,,. ツール アドイン 1b: Excel2003 :,.,.,.,,,.,,. 1. Excel2003.



Solution Report

最適化手法 第1回 [3mm] 整数計画法 (1) [3mm]

XpressMemoForDash.dvi

AtCoder Regular Contest 073 Editorial Kohei Morita(yosupo) A: Shiritori if python3 a, b, c = input().split() if a[len(a)-1] == b[0] and b[len(

untitled

Numerical Optimizer SIMPLE チュートリアル V20 株式会社 NTT データ数理システム 2018 年 1 月

H22 BioS (i) I treat1 II treat2 data d1; input group patno treat1 treat2; cards; ; run; I

untitled

9 ZIMPL 言語と SCIP による数理最適化 Mathematical Optimization with ZIMPL and SCIP ネットワーク情報学部 School of Network and Information 高野祐一 Yuichi TAKANO Keywords : Mat

REALV5_A4…p_Ł\1_4A_OCF

untitled

「都市から地方への人材誘致・移住促進に関する調査」

<91498EE88CA D815B2E786C73>

〔 大 会 役 員 〕

橡本体資料+参考条文.PDF

Lecture on

all.dvi

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf ("%s", str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i

nakata/nakata.html p.1/20

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x

…p…^†[…fiflF”¯ Pattern Recognition

MQTT V3.1 プロトコル仕様

SIMPLE

コンピュータ概論

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble


2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA

パズルをSugar制約ソルバーで解く

OR#5.key

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

untitled

AN 100: ISPを使用するためのガイドライン

Parametric Polymorphism

2X Y Y X θ 1, θ 2,... Y = f(x, θ 1, θ 2,...) θ k III 8 ( ) 1 / 39



149 (Newell [5]) Newell [5], [1], [1], [11] Li,Ryu, and Song [2], [11] Li,Ryu, and Song [2], [1] 1) 2) ( ) ( ) 3) T : 2 a : 3 a 1 :

kubostat2018d p.2 :? bod size x and fertilization f change seed number? : a statistical model for this example? i response variable seed number : { i

untitled

コンピュータ概論

CM-3G 周辺モジュール拡張技術文書 INA226センサ(電流、電圧、電力)

n 2 n (Dynamic Programming : DP) (Genetic Algorithm : GA) 2 i

CVaR

untitled

2009 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA

ohp1.dvi

untitled


untitled

2011 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA enshu-


Exam : A JPN Title : SAS Base Programming for SAS 9 Vendor : SASInstitute Version : DEMO Get Latest & Valid A JPN Exam's Question and Answ

94 expression True False expression FalseMSDN IsNumber WorksheetFunctionIsNumberexpression expression True Office support.office.com/ja-jp/ S

s t 1, 2,..., 10 s t a, b,..., k t s 1, 2,..., 10 1 a, b,..., k 1 s t ts 1 0 ( 2.25) ½ ¾ ½¼ x 1j = 1 x 2c = 1 x 3e = 1



( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1

Numerical Analysis II, Exam End Term Spring 2017

/ 2 ( ) ( ) ( ) = R ( ) ( ) 1 1 1/ 3 = 3 2 2/ R :. (topology)

Isogai, T., Building a dynamic correlation network for fat-tailed financial asset returns, Applied Network Science (7):-24, 206,

FX ) 2

FX自己アフリエイトマニュアル

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1

../dvi98/me98enve.dvi

CRA2656-A

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

H22 BioS t (i) treat1 treat2 data d1; input patno treat1 treat2; cards; ; run; 1 (i) treat = 1 treat =


untitled

50. (km) A B C C 7 B A 0

1 [1, 2, 3, 4, 5, 8, 9, 10, 12, 15] The Boston Public Schools system, BPS (Deferred Acceptance system, DA) (Top Trading Cycles system, TTC) cf. [13] [

/ 2 n n n n x 1,..., x n 1 n 2 n R n n ndimensional Euclidean space R n vector point R n set space R n R n x = x 1 x n y = y 1 y n distance dx,

橡点検記録(集約).PDF

一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM

こんにちは由美子です

2

橡ボーダーライン.PDF

3 SIMPLE ver 3.2: SIMPLE (SIxteen-bit MicroProcessor for Laboratory Experiment) 1 16 SIMPLE SIMPLE 2 SIMPLE 2.1 SIMPLE (main memo

kiyo5_1-masuzawa.indd

(CC Attribution) Lisp 2.1 (Gauche )

Excel Excel Excel = Excel III 7 ( ) 1

main.dvi

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

橡Taro9-生徒の活動.PDF

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

I 11

13 Student Software TI-Nspire CX CAS TI Web TI-Nspire CX CAS Student Software ( ) 1 Student Software 37 Student Software Nspire Nspire Nspir

1

No.28

Transcription:

GLPK by GLPK http://mukun mmg.at.infoseek.co.jp/mmg/glpk/ 17 7 5 : update 1 GLPK GNU Linear Programming Kit GNU LP/MIP ILOG AMPL(A Mathematical Programming Language) 1. 2. 3. 2 (optimization problem) X S X f : X R f ( x S f(x) (1) x S (2) f (objective function) S (feasible region) (2) (constraint condition) x S f(x ) 1

f(x) x S (optimal solution) f(x ) (optimal value) f(x) (1) 3 GLPK glpsol -m -d -m glpsol -h -m -d -o -y --simplex ( ) --interior --min --max --check --nomip MIP LP --wmps MPS ( ) --wlpt CPLEX ( ) --wtxt ( ) glpsol -m model1.mod -d data1.dat -o result1.sol --wlpt cplexform.txt --min result1.sol CPLEX cplexform.txt 4 GLPK.mod 2

.dat 5 (set) GLPK set 5.1 set {, }; ) Node set Node; 5.2 := )Node 1,2,3,4 set Node := 1 2 3 4; 6 (parameter) 0 GLPK param 6.1 param {, }; 3

) Cost i i Node param Cost{Node}; 6.2 1 2 ) 1) 1 5 2 3 3 6 4 9 param Cost := 1 5 2 3 3 6 4 9; 2) param Cost[1] := 5; param Cost[2] := 3; param Cost[3] := 6; param Cost[4] := 9; ) ( ) 4

1 p 10 1 q 20 2 p 15 2 q 23 3 p 12 3 q 18 1 2 (tr) tr (transpose matrix) 1) 2) tr 1) param Val: p q := 1 10 20 2 15 23 3 12 18 2) param Val(tr): 1 2 3:= p 10 15 12 q 20 23 18 ) ( ) 1 2 1 10 1 2 2 15 1 3 1 13 1 3 2 17 5

1) param ArcResourceFC := 1 2 1 10 1 2 2 15 1 3 1 13 1 3 2 17 ; 2) param ArcResourceFC[1,2,1] := 10; param ArcResourceFC[1,2,2] := 15; param ArcResourceFC[1,3,1] := 13; param ArcResourceFC[1,3,2] := 17; ) param : ) 1 2 1 1 1 3 1 2 2 1 2 6 1 3 1 1 1 4 1 3 2 1 2 8 param: LT CT:= 1 2 1 1 1 3 1 2 2 1 2 6 6

1 3 1 1 1 4 1 3 2 1 2 8 ; 7 (variable) 0 GLPK var var {, } )2 Flow i,j i Node, j Node GLPK var Flow{Node, Node}; 7.1 0-1 2 ) x Z + integer binary 0-1 / set x integer, >=0; 8 (constraint condition) GLPK s.t. subject to s.t. {, } ) r Res x ir M i Node 7

s.t. COND1{i in Node}: sum{r in Res}x[i,r] <= M; in sum 1 1 9 (objective function) (maximize) (minimize) GLPK maximize minimize minimize : ) : min. Cost i x i i Node minimize OBJ: sum{i in Node} Cost[i] * x[i]; 10 GLPK GNU 10.1 + - * / less A > B A-B, A < B 0 div A/B mod A/B ** ˆ A B 8

10.2 / A < B A < B A <= B A B A > B A > B A >= B A B A <> B A! = B A B A in B A B A not in B A! in B A / B A within B A B 10.2.1 if( ) then else ) t 1 X t 1 t = 1 0 if(t!=1) X[t-1] else 0 10.2.2 : )i > j (i,j) Arc w ij (i > j) sum{(i,j) in Arc : i > j} w[i,j] 10.2.3 within within ) 9

set A; set K within A; K A set A := 1 2 3 4; set K := 5; 10.3 A union B A B A diff B A/B A simdiff B A B A inter B A B A cross B A B a.. b [a,b] 10.3.1 setof setof{(, ) in } (, ) ) ARP( (i,j), (r), (p) 3 ) (i,j) (p) 2 AP set AP := setof{(i,j,r,p) in ARP}(i,j,p); 10.4 ) param p default 9999; p 9999 10

10.5 display display ; display 11

11 AMPL AMPL GLPK 300 11.1 AMPL AMPL GLPK AMPL ampl ampl: AMPL model data solve option solver expand show display reset quit exit let commands AMPL AMPL m1.mod model m1.mod; AMPL commands option solver cplex; model m1.mod; data d1.dat; solve; com1.cms commands com1.cms; expand 12

reset; quit; MINOS( ) MIP MIP option solver cplex; CPLEX( ) AMPL 13

12 12.1 unbounded (or badly scaled) problem. 1 0 12.2 ( or ) must have * subscripts rather than # *,# * # 1 1 ) set Node; set Arc{Node, Node}; var X{Arc}; X Node2 14

12.3 ( or )[ ] out of domain ( ) 1 {1..N} 2 GLPK 12.3.1 param T; # set Period := 1..T; # param T:=10; # 15

12.3.2 param T; # set Period; # param T:=10; # set Period := 1..T; # 12.4 syntax error in set statementset = := = := VB param 12.5 operand preceding = has invalid type if 16

x > 0 y = 1 if if http://www.ampl.com/faq/ 17