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
9k
Go - CLI Tools Design
kaneshin
0
6.7k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
92
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
88
Summer Internship 2018 - How to develop a product
kaneshin
0
69
How to write Go code
kaneshin
8
8.1k
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
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
930
Refactor your code - refactor yourself
xosofox
1
260
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
320
良いユニットテストを書こう
mototakatsu
5
2k
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
130
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
1
520
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
return文におけるstd::moveについて
onihusube
1
1k
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
710
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Practical Orchestrator
shlominoach
186
10k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
How GitHub (no longer) Works
holman
311
140k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Optimizing for Happiness
mojombo
376
70k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
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 :)
͓·͚ - ๏ʢΧʔϚʔΧʔ๏ʣ