Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
線形計画法とカーマーカー法 〜プログラマのための数学勉強会#3〜
Search
Shintaro Kaneko
May 22, 2015
Programming
3
74k
線形計画法とカーマーカー法 〜プログラマのための数学勉強会#3〜
カーマーカー法はやめて「線形計画法と整数計画法」です。
Shintaro Kaneko
May 22, 2015
Tweet
Share
More Decks by Shintaro Kaneko
See All by Shintaro Kaneko
How to keep growing SRE team at Eureka
kaneshin
3
8.9k
Go - CLI Tools Design
kaneshin
0
6.7k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
87
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
85
Summer Internship 2018 - How to develop a product
kaneshin
0
67
How to write Go code
kaneshin
8
8k
Go Package Guidelines
kaneshin
1
1.1k
net/http package ~GoConference 2017 Spring~
kaneshin
1
2.7k
Essentials of Golang
kaneshin
5
13k
Other Decks in Programming
See All in Programming
Cohesion in Modeling and Design
mploed
3
200
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
200
Beyond Laravel Octane - Hyperf for Laravel Artisans
albertcht
1
130
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
170
"noncopyable types" の使いどころについて考えてみた
andpad
0
150
pytest プラグインを開発して DRY に自動テストを書こう
inuatsu
2
260
実践Dash - 手を抜きながら本気で作るデータApplicationの基本と応用 / Dash for Python and Baseball
shinyorke
2
260
自分だけの世界を創るクリエイティブコーディング / Creative Coding: Creating Your Own World
chobishiba
2
860
GitHub Copilot Workspace で我々のアプリ開発がどう変わるのか?
shuyakinjo
0
920
Re:PandasAI:生成AIがデータ分析業務にもたらすパラダイムシフト【増補改訂版】
negi111111
1
900
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
180
AWS認定資格を受験するにあたり、気づいたこと・実践していたことのまとめ
satoshi256kbyte
1
120
Featured
See All Featured
Navigating Team Friction
lara
183
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Facilitating Awesome Meetings
lara
49
6k
Adopting Sorbet at Scale
ufuk
73
9k
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Six Lessons from altMBA
skipperchong
26
3.4k
How GitHub (no longer) Works
holman
311
140k
How to name files
jennybc
77
99k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
1
290
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
A designer walks into a library…
pauljervisheath
202
24k
Making the Leap to Tech Lead
cromwellryan
131
8.8k
Transcript
ઢܗܭը๏ͱΧʔϚʔΧʔ๏ ϓϩάϥϚͷͨΊͷֶษڧձ
ઢܗܭը๏ͱΧʔϚʔΧʔ๏
ΧʔϚʔΧʔͷ୭ಘ
ΧʔϚʔΧʔͷ୭ಘ ͑ͬʂʁ
ઢܗܭը๏ͱΧʔϚʔΧʔ๏
ઢܗܭը๏ͱܭը๏
ࣗݾհ Shintaro Kaneko ‣ גࣜձࣾΤϨΧ ‣ pairsͷ։ൃશൠ୲ ‣ ࠷ۙGoݴޠͰ։ൃ͍ͯ͠·͢ ‣
େֶ࣌ ‣ ࠷దԽͷඇઢܗܭը๏Λઐ߈ ‣ github.com/kaneshin/lbfgs ʢݹʣ ‣ ඍํఔ͕͖ࣜͩͬͨ kaneshin kaneshinth shintaro.kaneko
ࣗݾհ Shintaro Kaneko ‣ גࣜձࣾΤϨΧ ‣ pairsͷ։ൃશൠ୲ ‣ ࠷ۙGoݴޠͰ։ൃ͍ͯ͠·͢ ‣
େֶ࣌ ‣ ࠷దԽͷඇઢܗܭը๏Λઐ߈ ‣ github.com/kaneshin/lbfgs ʢݹʣ ‣ ඍํఔ͕͖ࣜͩͬͨ kaneshin kaneshinth shintaro.kaneko ٱ͠ৼΓͷֶʂ
Copyright © 2009-2015 eureka, Inc. All rights reserved.
Copyright © 2009-2015 eureka, Inc. All rights reserved.
Copyright © 2009-2015 eureka, Inc. All rights reserved. ‣ pairsϚονϯάΞϧΰϦζϜ͕ඇৗʹॏཁ
‣ ๛ͳϢʔβʔͷσʔλͷ׆༻ ‣ ΤϯδχΞ͕Ϗδωε໘͔ΒΞϧΰϦζϜΛߟ͑Δ ‣ ࣾษڧձͰRษڧʴ౷ܭֶͷษڧձ։࠵ ‣ ϏοάσʔλΛਖ਼͍ࣝ͠Ͱ༻͢Δ ‣ ౷ܭΛؒҧͬͨೝࣝͰ༻͠ͳ͍ʢภͬͨσʔλΛΘͳ͍
ຊ౷ܭͷͰ ͋Γ·ͤΜʂ
ຊͷΰʔϧ
ຊͷΰʔϧ ࠷దԽʢཧܭըʣΛ ͪΐͬͱͰͬͯΒ͏
ຊ͢͜ͱ
ຊ͢͜ͱ ΦϖϨʔγϣϯζɾϦαʔν ࠷దԽʢཧܭըʣ ઢܗܭըͱܭը
ຊΒͳ͍͜ͱ Βͳ͍͜ͱ ϓϩάϥϜͰγϛϡϨʔγϣϯ Γ͔ͨͬͨΜͰ͕͢ ͕࣌ؒݫ͍͠ͷͰׂѪ
ຊ͢͜ͱ ΦϖϨʔγϣϯζɾϦαʔν ࠷దԽʢཧܭըʣ ઢܗܭըͱܭը
ΦϖϨʔγϣϯζɾϦαʔν
ΦϖϨʔγϣϯζɾϦαʔνʢORʣ ‣ OR૬͍Λࢦ͢ ‣ ༷ʑͳܭըʹରͯ͠࠷ޮతʹͳΔΑ͏ҙࢥܾఆ͢Δ ‣ ֶɾ౷ܭతϞσϧɺΞϧΰϦζϜͷར༻ ‣ ʮγϛϡϨʔγϣϯʯͷཱ֬ORཱ͕ऀ ‣
ORͰݱ࣮ͷΛཧϞσϧʹஔ͖͑Δ ‣ ࠷దԽɼͪߦྻɼ֬ͳͲ ‣ ܉ࣄతؔ৺ͱܦࡁతؔ৺͕ڧ͍
ͭ·Γʁ
ྫ͑ɼேͷ௨ۈిं
ேͷ௨ۈిं ‣ ܦ࿏ݕࡧʹʮYahoo!࿏ઢʯ͍ͬͯΔͱࢥ͍·͢ ‣ ཪଆͰʮܦ࿏ޮʯʮίετޮʯͷߟྀ ‣ Ո͔ΒӺ·Ͱʹཁ͢Δ࣌ؒΛܭࢉ ‣ ెาӺͰిंΛͨͳ͍Α͏ʹग़ൃ͢Δܭը ‣
ࢁखઢͷَͷΑ͏ͳμΠϠ ‣ γϛϡϨʔγϣϯ͕Կສճ͞Εͨ݁Ռ
ேͷ௨ۈిं ‣ ܦ࿏ݕࡧʹʮYahoo!࿏ઢʯ͍ͬͯΔͱࢥ͍·͢ ‣ ཪଆͰʮܦ࿏ޮʯʮίετޮʯͷߟྀ ‣ Ո͔ΒӺ·Ͱʹཁ͢Δ࣌ؒΛܭࢉ ‣ ెาӺͰిंΛͨͳ͍Α͏ʹग़ൃ͢Δܭը ‣
ࢁखઢͷَͷΑ͏ͳμΠϠ ‣ γϛϡϨʔγϣϯ͕Կສճ͞Εͨ݁Ռ ͜ΕΒORͷҰछ
ׂͱۙʹOR
ຊ͢͜ͱ ΦϖϨʔγϣϯζɾϦαʔν ࠷దԽʢཧܭըʣ ઢܗܭըͱܭը
࠷దԽ
࠷దԽORͷҰཁૉ
ઢܗܭը ඇઢܗܭը ܭը ήʔϜཧ OR σʔλ ϚΠχϯά : : :
: ۚ༥ֶ ࠷దԽ
࠷దԽͱ ʢoptimization problemʣ ཧܭըͱΑΕΔ ʢMathematical Programming Problemʣ
࠷దԽͱ ༩͑ΒΕͨ݅ͷͱͰ ԿΒ͔ͷؔΛ࠷খԽɾ࠷େԽ͢Δ
࠷దԽͱ ༩͑ΒΕͨ݅ͷͱͰ ԿΒ͔ͷؔΛ࠷খԽɾ࠷େԽ͢Δ
࠷దԽͱ
࠷దԽͱ ੍݅ͷͱͰ
࠷దԽͱ ੍݅ͷͱͰɼతؔͷ
࠷దԽͱ ੍݅ͷͱͰɼతؔͷ ࠷దͱͳΔ
࠷దԽͱ ੍݅ͷͱͰɼతؔͷ ࠷దͱͳΔ࠷దղΛ
࠷దԽͱ ੍݅ͷͱͰɼతؔͷ ࠷దͱͳΔ࠷దղΛ࣮ߦՄೳྖҬ͔Β୳͢
࠷దԽͱ ੍݅ͷͱͰɼతؔͷ ࠷దͱͳΔ࠷దղΛ࣮ߦՄೳྖҬ͔Β୳͢
తؔɾ੍݅ʹΑͬͯ ࠷దԽྨ͞ΕΔ
࠷దԽͷྨʢ෦తʣ ‣ ઢܗܭը ‣ తؔɾ੍݅ͷू߹͕̍࣍ࣜͷΈ ‣ ඇઢܗܭը ‣ తؔɾ੍݅ʹඇઢܗ͕ࣜଘࡏ͢Δ ‣
ܭըʢࠞ߹ɾ७ʣ ‣ ੍݅ͷҰ෦·ͨશͯͷมͷͱΔ͕ ‣ ̎࣍ܭը ‣ త͕ؔ̎࣍ࣜɼ੍݅ͷू߹͕̍࣍ࣜ etc…
ઢܗܭը ඇઢܗܭը ܭը ήʔϜཧ OR ࠷దԽ σʔλ ϚΠχϯά : :
: : ۚ༥ֶ
ઢܗܭը ඇઢܗܭը ܭը ήʔϜཧ OR ࠷దԽ σʔλ ϚΠχϯά : :
: : ۚ༥ֶ
ຊ͢͜ͱ ΦϖϨʔγϣϯζɾϦαʔν ࠷దԽʢཧܭըʣ ઢܗܭըͱܭը
ઢܗܭը
ઢܗܭը తؔɾ੍݅ͷू߹͕̍࣍ࣜͷΈ
ྫɿੜ࢈ܭը
̎มͷੜ࢈ܭը ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ
̎มͷੜ࢈ܭը ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t
̎มͷੜ࢈ܭը ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ
̎มͷੜ࢈ܭը ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ ‣ P2ͷੜ࢈ ‣ M1Λ6t, M2Λ6t, M3Λ1t ‣ ར५5ສʂ
̎มͷੜ࢈ܭը ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ ‣ P2ͷੜ࢈ ‣ M1Λ6t, M2Λ6t, M3Λ1t ‣ ར५5ສʂ ར५Λ࠷େԽ͍ͨ͠
̎มͷੜ࢈ܭը ݪྉʘ P1 P2 ར༻Մೳྔ M1 2 6 27 M2
8 6 45 M3 3 1 15 ར५ 2 5
̎มͷੜ࢈ܭը ݪྉʘ P1 P2 ར༻Մೳྔ M1 2 6 27 M2
8 6 45 M3 3 1 15 ར५ 2 5
̎มͷੜ࢈ܭը P1, P2ͷੜ࢈ྔΛมྔ (x1, x2) ͱ͢Δͱ Λ࠷େԽͤ͞Δ࠷దԽͱͳΔ
̎มͷੜ࢈ܭը ݪྉʘ P1 P2 ར༻Մೳྔ M1 2 6 27 M2
8 6 45 M3 3 1 15 ར५ 2 5
̎มͷੜ࢈ܭը ੍݅ར༻Մೳͳݪྉͷྔͱඇෛ
̎มͷੜ࢈ܭը ੍݅ར༻Մೳͳݪྉͷྔͱඇෛ
̎มͷੜ࢈ܭը ઢܗܭըͱͯ͠ఆࣜԽ
̎มͷੜ࢈ܭը ઢܗܭըͱͯ͠ఆࣜԽ ͜ͷͷ࠷దղΛٻΊ͍ͨ
ͱ͜ΖͰ
࿈ଓ͔ʁ
ܭը
ܭը ੍݅ͷҰ෦·ͨશͯͷมͷͱΔ͕
ྫɿੜ࢈ܭըʢʣ
̎มͷੜ࢈ܭըʢʣ ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ ‣ P2ͷੜ࢈ ‣ M1Λ6t, M2Λ6t, M3Λ1t ‣ ར५5ສʂ ར५Λ࠷େԽ͍ͨ͠
̎มͷੜ࢈ܭըʢʣ ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ɹݸͰΫϨ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ ‣ P2ͷੜ࢈ɹݸͰΫϨ ‣ M1Λ6t, M2Λ6t, M3Λ1t ‣ ར५5ສʂ ར५Λ࠷େԽ͍ͨ͠
̎มͷੜ࢈ܭըʢʣ ‣ M1, M2, M3ͷݪྉΛ༻͍ͯɼP1, P2Λੜ࢈͍ͯ͠Δ ‣ ར༻ՄೳྔɿM1 ≦ 27t,
M2 ≦ 45t, M3 ≦15t ‣ P1ͷੜ࢈ɹݸͰΫϨ ‣ M1Λ2t, M2Λ8t, M3Λ3t ‣ ར५2ສʂ ‣ P2ͷੜ࢈ɹݸͰΫϨ ‣ M1Λ6t, M2Λ6t, M3Λ1t ‣ ར५5ສʂ ར५Λ࠷େԽ͍ͨ͠
̎มͷੜ࢈ܭըʢʣ ઢܗܭըͱͯ͠ఆࣜԽ
̎มͷੜ࢈ܭըʢʣ ઢܗܭըͱͯ͠ఆࣜԽ ͰΫϨ ͰΫϨ
̎มͷੜ࢈ܭըʢʣ ܭըͱͯ͠ఆࣜԽ
̎มͷੜ࢈ܭըʢʣ ܭըͱͯ͠ఆࣜԽ ͜ͷͷ࠷దղΛٻΊ͍ͨ
άϥϑͰΈΔղ๏ ԼهΛάϥϑͰදݱ͢Δ
None
None
ઢܗܭըͷ߹
ઢܗܭըͷ߹
ઢܗܭըͷ߹
ઢܗܭըͷ߹ ࠷దղ
ܭըͷ߹
ܭըͷ߹ ࠷దղ?
ܭըͷ߹ ࠷దղ!
ઢܗܭըͱܭըͷҧ͍ ‣ ઢܗܭըͷ࠷దղ ‣ ୯ମ๏ͱ͍͏ɺลΛḷ͍ͬͯ͘ํ๏͕࣮༻త ‣ ଟ߲ࣜ࣌ؒͰղ͚ͳ͍ͱ͖͕͋Δ ‣ ๏ͱ͍͏ղ๏ଘࡏ͢Δ ‣
࣮ߦྖҬͷ෦͔ΒղΛ୳ࡧ͢Δ ‣ ܭըͷ࠷దղ ‣ ઢܗܭըͰಘΒΕͨ࠷దղʹ͍ۙͷ͕࠷దղʹͳΒͳ͍ ߹͕͋Δ ๏ ϫγ͕ҭͯͨ
·ͱΊ
·ͱΊ ࠷దԽ ͳΜͱͳ͘ཧղͯ͠Β͑ͨͰ͠ΐ͏͔ʁ
·ͱΊ - ࠷ޙʹ ‣ ͜ͷ·ͩ·ͩϓϩάϥϜͷࢿ࢈͕গͳ͍ ‣ ཧϞσϧʹམͱͨ͢Ίʹֶͷ͕ࣝͳ͍ͱ͍͠ ‣ ઐతͳاۀ͕ಠ͍ͯ͠Δײ͕͋Δ ‣
ͦΕͧΕͷܭըߟ͑Δ͜ͱ͕ҧ͏ ‣ ݚڀ͍ͨ͠߹ΛߜΔ͖
·ͱΊ ͜ΕҎ্ͷ࠷దԽͷ γϛϡϨʔγϣϯͳͲ ୭͔͕ͬͯ͘ΕΔͱ৴͍ͯ͡·͢ʂ
Thank you :)
͓·͚ - ๏ʢΧʔϚʔΧʔ๏ʣ