Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chapter 15 - Dynamic Programming, Introductions to Algorithms (CLRS)

Chapter 15 - Dynamic Programming, Introductions to Algorithms (CLRS)

アルゴリズムイントロダクション 第15章 動的計画法

研究室内の非公式の輪読会で使用した資料です。
内容: 動的計画法の基本的な考え方(トップダウン、ボトムアップ)、ロッド切出し、連鎖行列積

8462b18bc6d57cac5579ef4b2f64a6de?s=128

Keisuke Okumura | 奥村圭祐

November 29, 2020
Tweet

Transcript

  1. blog.pramp.com アルゴリズムイントロダクション 第三版 15章 動的計画法 2020.7.22 奥村圭祐 20年度 東工大Defago研・裏輪行 DYNAMIC

    PROGRAMMING
  2. /25 2 公開用の断り書き https://tanukifont.com/ フォントはたぬきフォントを使用させていただいています。 本資料は研究室内の非公式の輪読会で使用したもので、 対象書籍は「アルゴリズム イントロダクション」の第三版(通称CLRS)になります。 スライド中の擬似コード(英語)は英語版のスクリーンショットを使用しています。 厳密性に欠いているところはありますがご容赦ください。

    間違い等ございましたら okumura.k[at]coord.c.titech.ac.jp まで、 ご連絡いただけると幸いです。
  3. /25 15.1 ロッド切出し 15.2 連鎖行列積 15.3 動的計画法の基本要素 15.4 最長共通部分列 15.5

    最適2分探索木 15章の構成 目標: 動的計画法が適応できそうだ!と見積もりが立てられるようになること 3
  4. /25 Wikipediaより 復習: 分割統治法 部分問題の解を組合わせて元の解を得る 結合 部分問題を再帰的に解く 統治 問題をいくつかの部分問題に分割 分割

  5. /25 5 ケーススタディ1: ロッド切出し問題 1本の金属棒からいくつかの金属棒を切り出すとき 収益最大化を達成するような切断箇所を決定したい 長さ 1 2 3

    4 5 6 7 8 9 10 価格 1 5 8 9 10 17 17 20 24 30 i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW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OsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH2F+M9g==</latexit> 入力 - 価格表 出力 切り出した棒を価格表に従って販売して得ることのできる収益の最大値 例 n = 4 <latexit sha1_base64="4oLZWzjS5iueWcCbZp2dz20UMJU=">AAAB6nicbVDLSgNBEOyNrxhfUY9eBoPgKezGgF6EoBePEc0DkiXMTmaTIbOzy0yvEEI+wYsHRbz6Rd78GyfJHjSxoKGo6qa7K0ikMOi6305ubX1jcyu/XdjZ3ds/KB4eNU2casYbLJaxbgfUcCkUb6BAyduJ5jQKJG8Fo9uZ33ri2ohYPeI44X5EB0qEglG00oO6rvaKJbfszkFWiZeREmSo94pf3X7M0ogrZJIa0/HcBP0J1SiY5NNCNzU8oWxEB7xjqaIRN/5kfuqUnFmlT8JY21JI5urviQmNjBlHge2MKA7NsjcT//M6KYZX/kSoJEWu2GJRmEqCMZn9TfpCc4ZybAllWthbCRtSTRnadAo2BG/55VXSrJS9i3Llvlqq3WRx5OEETuEcPLiEGtxBHRrAYADP8ApvjnRenHfnY9Gac7KZY/gD5/MHzpWNew==</latexit> 9 1 8 5 5 1 5 1 最適解 1 1 1 1
  6. /25 6 アルゴリズムの設計指針 最適な分割を仮定 n = i1 + i2 +

    · · · + ik <latexit sha1_base64="2T77fa2FlFqC1BTs6p2ra15IY7M=">AAACBHicbVDLSgMxFM3UV62vUZfdBIsgCGWmCroRim5cVrAPaIeSSTNtaCYzJHeEMnThxl9x40IRt36EO//GdDoLbT2Qy8m595Dc48eCa3Ccb6uwsrq2vlHcLG1t7+zu2fsHLR0lirImjUSkOj7RTHDJmsBBsE6sGAl9wdr++GbWbz8wpXkk72ESMy8kQ8kDTgkYqW+XJb7CvO/iU1NrpvYGEejsNu7bFafqZMDLxM1JBeVo9O0v46ZJyCRQQbTuuk4MXkoUcCrYtNRLNIsJHZMh6xoqSci0l2ZLTPGxUQY4iJQ5EnCm/nakJNR6EvpmMiQw0ou9mfhfr5tAcOmlXMYJMEnnDwWJwBDhWSJ4wBWjICaGEKq4+SumI6IIBZNbyYTgLq68TFq1qntWrd2dV+rXeRxFVEZH6AS56ALV0S1qoCai6BE9o1f0Zj1ZL9a79TEfLVi55xD9gfX5AwFRlSU=</latexit> 分割された棒の長さ rn = pi1 + pi2 + · · · + pik <latexit sha1_base64="xO9E+n5o2Z3PBRLclx6e+8YRu48=">AAACEnicbZDLSgMxFIbPeK31VnXpJlgERSgzVdCNUHTjsoK9QDsMmTTThmYyQ5IRytBncOOruHGhiFtX7nwbM+0I2vpD4OM/5yQ5vx9zprRtf1kLi0vLK6uFteL6xubWdmlnt6miRBLaIBGPZNvHinImaEMzzWk7lhSHPqctf3id1Vv3VCoWiTs9iqkb4r5gASNYG8srHUtPoEsUeynznDE6mVI1o24v0urHGY69Utmu2BOheXByKEOuulf6NDeQJKRCE46V6jh2rN0US80Ip+NiN1E0xmSI+7RjUOCQKjedrDRGh8bpoSCS5giNJu7viRSHSo1C33SGWA/UbC0z/6t1Eh1cuCkTcaKpINOHgoQjHaEsH9RjkhLNRwYwkcz8FZEBlphok2LRhODMrjwPzWrFOa1Ub8/Ktas8jgLswwEcgQPnUIMbqEMDCDzAE7zAq/VoPVtv1vu0dcHKZ/bgj6yPbwt3m9c=</latexit> 最適な収益 個に分割 k <latexit sha1_base64="S3l8nnBLDerjgmOsR9KRP3N3+lk=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOl5rhfrrhVdw6ySrycVCBHo1/+6g1ilkYoDRNU667nJsbPqDKcCZyWeqnGhLIxHWLXUkkj1H42P3RKzqwyIGGsbElD5urviYxGWk+iwHZG1Iz0sjcT//O6qQmv/YzLJDUo2WJRmApiYjL7mgy4QmbExBLKFLe3EjaiijJjsynZELzll1dJu1b1Lqq15mWlfpPHUYQTOIVz8OAK6nAHDWgBA4RneIU359F5cd6dj0VrwclnjuEPnM8f09OM8w==</latexit> rn = max (pn, r1 + rn 1, r2 + rn 2, . . . , rn 1 + r1) <latexit sha1_base64="VF5YgItC26ZaRlklvBN81eSkKj8=">AAACOHicbVBNSwMxEM36WetX1aOXYFEqatmtgl6EohdvVrC20C1LNs22odnsksyKZenP8uLP8CZePCji1V9g+iFodSDhzXszk8zzY8E12PaTNTU9Mzs3n1nILi4tr6zm1tZvdJQoyqo0EpGq+0QzwSWrAgfB6rFiJPQFq/nd84Feu2VK80heQy9mzZC0JQ84JWAoL3epPIl3TrEbkjtXsAAKsSf3sfIcvGfuVB44/UFa+k5LJnVbEej9b3moOK7i7Q7serm8XbSHgf8CZwzyaBwVL/doptEkZBKoIFo3HDuGZkoUcCpYP+smmsWEdkmbNQyUJGS6mQ4X7+Ntw7RwEClzJOAh+7MjJaHWvdA3lSGBjp7UBuR/WiOB4KSZchknwCQdPRQkAkOEBy7iFleMgugZQKji5q+YdogiFIzXWWOCM7nyX3BTKjqHxdLVUb58NrYjgzbRFiogBx2jMrpAFVRFFN2jZ/SK3qwH68V6tz5GpVPWuGcD/Qrr8wuFtKim</latexit> 部分構造最適性に着目 長さが と の2つの金属棒に切断, それぞれの金属棒を最適に 分割することで得られる総収入 n i <latexit sha1_base64="AMTEmYgqxguyFb26Fa9BmJlDjkI=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4sSRV0GPRi8eK9gPaUDbbTbt0swm7E6GE/gQvHhTx6i/y5r9x2+agrQ8GHu/NMDMvSKQw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmjjVjDdYLGPdDqjhUijeQIGStxPNaRRI3gpGt1O/9cS1EbF6xHHC/YgOlAgFo2ilB3UueqWyW3FnIMvEy0kZctR7pa9uP2ZpxBUySY3peG6CfkY1Cib5pNhNDU8oG9EB71iqaMSNn81OnZBTq/RJGGtbCslM/T2R0ciYcRTYzoji0Cx6U/E/r5NieO1nQiUpcsXmi8JUEozJ9G/SF5ozlGNLKNPC3krYkGrK0KZTtCF4iy8vk2a14l1UqveX5dpNHkcBjuEEzsCDK6jBHdShAQwG8Ayv8OZI58V5dz7mrStOPnMEf+B8/gAGqI2g</latexit> i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> 切断なし 上式をもっと簡略化 rn = max 1in (pi + rn i) <latexit sha1_base64="6RTdfevw2pAJ9wQarvRglSTkhQM=">AAACHnicbVDLSgMxFM3UV62vqks3wSJUxDJTFd0IRTcuK9gHdMqQSTNtaCYzJnfEMvRL3PgrblwoIrjSvzF9LLR6INzDOfdyc48fC67Btr+szNz8wuJSdjm3srq2vpHf3KrrKFGU1WgkItX0iWaCS1YDDoI1Y8VI6AvW8PuXI79xx5TmkbyBQczaIelKHnBKwEhe/kR5Ep9jNyT3Xuq4gt1ijsdFDk0JoBh7HB9g5aXykA9dxbs92PfyBbtkj4H/EmdKCmiKqpf/cDsRTUImgQqidcuxY2inRAGngg1zbqJZTGifdFnLUElCptvp+Lwh3jNKBweRMk8CHqs/J1ISaj0IfdMZEujpWW8k/ue1EgjO2imXcQJM0smiIBEYIjzKCne4YhTEwBBCFTd/xbRHFKFgEs2ZEJzZk/+SernkHJXK18eFysU0jizaQbuoiBx0iiroClVRDVH0gJ7QC3q1Hq1n6816n7RmrOnMNvoF6/MbSKqhXA==</latexit> 分割を左端から切り出された長さ の金属棒と 右側に残る長さ の部分とみなす i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> n i <latexit sha1_base64="AMTEmYgqxguyFb26Fa9BmJlDjkI=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4sSRV0GPRi8eK9gPaUDbbTbt0swm7E6GE/gQvHhTx6i/y5r9x2+agrQ8GHu/NMDMvSKQw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmjjVjDdYLGPdDqjhUijeQIGStxPNaRRI3gpGt1O/9cS1EbF6xHHC/YgOlAgFo2ilB3UueqWyW3FnIMvEy0kZctR7pa9uP2ZpxBUySY3peG6CfkY1Cib5pNhNDU8oG9EB71iqaMSNn81OnZBTq/RJGGtbCslM/T2R0ciYcRTYzoji0Cx6U/E/r5NieO1nQiUpcsXmi8JUEozJ9G/SF5ozlGNLKNPC3krYkGrK0KZTtCF4iy8vk2a14l1UqveX5dpNHkcBjuEEzsCDK6jBHdShAQwG8Ayv8OZI58V5dz7mrStOPnMEf+B8/gAGqI2g</latexit>
  7. /25 7 再帰的トップダウン型実現 rn = max 1in (pi + rn

    i) <latexit sha1_base64="6RTdfevw2pAJ9wQarvRglSTkhQM=">AAACHnicbVDLSgMxFM3UV62vqks3wSJUxDJTFd0IRTcuK9gHdMqQSTNtaCYzJnfEMvRL3PgrblwoIrjSvzF9LLR6INzDOfdyc48fC67Btr+szNz8wuJSdjm3srq2vpHf3KrrKFGU1WgkItX0iWaCS1YDDoI1Y8VI6AvW8PuXI79xx5TmkbyBQczaIelKHnBKwEhe/kR5Ep9jNyT3Xuq4gt1ijsdFDk0JoBh7HB9g5aXykA9dxbs92PfyBbtkj4H/EmdKCmiKqpf/cDsRTUImgQqidcuxY2inRAGngg1zbqJZTGifdFnLUElCptvp+Lwh3jNKBweRMk8CHqs/J1ISaj0IfdMZEujpWW8k/ue1EgjO2imXcQJM0smiIBEYIjzKCne4YhTEwBBCFTd/xbRHFKFgEs2ZEJzZk/+SernkHJXK18eFysU0jizaQbuoiBx0iiroClVRDVH0gJ7QC3q1Hq1n6816n7RmrOnMNvoF6/MbSKqhXA==</latexit> 棒の長さがゼロであれば最適解はゼロ このアルゴリズムは効率的だろうか? 価格表 棒の長さ を返す rn = pi1 + pi2 + · · · + pik <latexit sha1_base64="xO9E+n5o2Z3PBRLclx6e+8YRu48=">AAACEnicbZDLSgMxFIbPeK31VnXpJlgERSgzVdCNUHTjsoK9QDsMmTTThmYyQ5IRytBncOOruHGhiFtX7nwbM+0I2vpD4OM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z6Rd78GyfJHjSxoKGo6qa7K0ikMOi6305ubX1jcyu/XdjZ3ds/KB4eNU2casYbLJaxbgfUcCkUb6BAyduJ5jQKJG8Fo9uZ33ri2ohYPeI44X5EB0qEglG00oO6rvaKJbfszkFWiZeREmSo94pf3X7M0ogrZJIa0/HcBP0J1SiY5NNCNzU8oWxEB7xjqaIRN/5kfuqUnFmlT8JY21JI5urviQmNjBlHge2MKA7NsjcT//M6KYZX/kSoJEWu2GJRmEqCMZn9TfpCc4ZybAllWthbCRtSTRnadAo2BG/55VXSrJS9i3Llvlqq3WRx5OEETuEcPLiEGtxBHRrAYADP8ApvjnRenHfnY9Gac7KZY/gD5/MHzpWNew==</latexit> の場合 2 1 0 0 葉の数: 2n 1 <latexit sha1_base64="XbIHs5xrBIKTkV3UijySlIVcn7I=">AAAB7nicbVBNS8NAEJ34WetX1aOXxSJ4sSRV0GPRi8cK9gPaWDbbTbt0swm7E6GE/ggvHhTx6u/x5r9x2+agrQ8GHu/NMDMvSKQw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmjjVjDdYLGPdDqjhUijeQIGStxPNaRRI3gpGt1O/9cS1EbF6wHHC/YgOlAgFo2ilVvUxU+fepFcquxV3BrJMvJyUIUe9V/rq9mOWRlwhk9SYjucm6GdUo2CST4rd1PCEshEd8I6likbc+Nns3Ak5tUqfhLG2pZDM1N8TGY2MGUeB7YwoDs2iNxX/8zophtd+JlSSIldsvihMJcGYTH8nfaE5Qzm2hDIt7K2EDammDG1CRRuCt/jyMmlWK95FpXp/Wa7d5HEU4BhO4Aw8uIIa3EEdGsBgBM/wCm9O4rw4787HvHXFyWeO4A+czx+dbI8Y</latexit> 問題を解くのに に関して 指数時間必要とする n <latexit sha1_base64="2QmInd+nHO60uhS7AYCvgpiU4a8=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlpuyXK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH2F+M9g==</latexit> 何度も同じ部分問題を解くのは無駄 各部分問題を”一度だけ”解くようにすれば効率的なはず!
  9. /25 9 履歴管理を用いるトップダウン方式 保存された結果を利用 部分問題の解を保存 rn = max 1in (pi

    + rn i) <latexit sha1_base64="6RTdfevw2pAJ9wQarvRglSTkhQM=">AAACHnicbVDLSgMxFM3UV62vqks3wSJUxDJTFd0IRTcuK9gHdMqQSTNtaCYzJnfEMvRL3PgrblwoIrjSvzF9LLR6INzDOfdyc48fC67Btr+szNz8wuJSdjm3srq2vpHf3KrrKFGU1WgkItX0iWaCS1YDDoI1Y8VI6AvW8PuXI79xx5TmkbyBQczaIelKHnBKwEhe/kR5Ep9jNyT3Xuq4gt1ijsdFDk0JoBh7HB9g5aXykA9dxbs92PfyBbtkj4H/EmdKCmiKqpf/cDsRTUImgQqidcuxY2inRAGngg1zbqJZTGifdFnLUElCptvp+Lwh3jNKBweRMk8CHqs/J1ISaj0IfdMZEujpWW8k/ue1EgjO2imXcQJM0smiIBEYIjzKCne4YhTEwBBCFTd/xbRHFKFgEs2ZEJzZk/+SernkHJXK18eFysU0jizaQbuoiBx0iiroClVRDVH0gJ7QC3q1Hq1n6816n7RmrOnMNvoF6/MbSKqhXA==</latexit> 履歴表を初期化 4 3 0 2 1 0 0 1 1 0 2 ⇥ n2 <latexit sha1_base64="HgiBb1IwoGeFkFQot3wSnD2hmNc=">AAAB/3icbVDLSgNBEJyNrxhfq4IXL4tBiJewGwU9Br14jJAXZGOYnfQmQ2Znl5leIcQc/BUvHhTx6m9482+cPA6aWNBQVHXT3RUkgmt03W8rs7K6tr6R3cxtbe/s7tn7B3Udp4pBjcUiVs2AahBcQg05CmgmCmgUCGgEg5uJ33gApXksqzhMoB3RnuQhZxSN1LGP/GofkPoCQizI+5KveK+PZx077xbdKZxl4s1JnsxR6dhffjdmaQQSmaBatzw3wfaIKuRMwDjnpxoSyga0By1DJY1At0fT+8fOqVG6ThgrUxKdqfp7YkQjrYdRYDojin296E3E/7xWiuFVe8RlkiJINlsUpsLB2JmE4XS5AoZiaAhliptbHdanijI0keVMCN7iy8ukXip658XS3UW+fD2PI0uOyQkpEI9ckjK5JRVSI4w8kmfySt6sJ+vFerc+Zq0Zaz5zSP7A+vwBXiOVrQ==</latexit> 計算量:
  10. /25 10 ボトムアップ方式 履歴表を初期化 3 2 0 1 4 ⇥

    n2 <latexit sha1_base64="HgiBb1IwoGeFkFQot3wSnD2hmNc=">AAAB/3icbVDLSgNBEJyNrxhfq4IXL4tBiJewGwU9Br14jJAXZGOYnfQmQ2Znl5leIcQc/BUvHhTx6m9482+cPA6aWNBQVHXT3RUkgmt03W8rs7K6tr6R3cxtbe/s7tn7B3Udp4pBjcUiVs2AahBcQg05CmgmCmgUCGgEg5uJ33gApXksqzhMoB3RnuQhZxSN1LGP/GofkPoCQizI+5KveK+PZx077xbdKZxl4s1JnsxR6dhffjdmaQQSmaBatzw3wfaIKuRMwDjnpxoSyga0By1DJY1At0fT+8fOqVG6ThgrUxKdqfp7YkQjrYdRYDojin296E3E/7xWiuFVe8RlkiJINlsUpsLB2JmE4XS5AoZiaAhliptbHdanijI0keVMCN7iy8ukXip658XS3UW+fD2PI0uOyQkpEI9ckjK5JRVSI4w8kmfySt6sJ+vFerc+Zq0Zaz5zSP7A+vwBXiOVrQ==</latexit> 計算量: 部分問題グラフ と呼ばれる を計算 rj <latexit sha1_base64="5phcDxLPvTMs4BrLH+U90NbRX7c=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4KkkV9Fj04rGi/YA2lM12067dbMLuRCihP8GLB0W8+ou8+W/ctjlo64OBx3szzMwLEikMuu63s7K6tr6xWdgqbu/s7u2XDg6bJk414w0Wy1i3A2q4FIo3UKDk7URzGgWSt4LRzdRvPXFtRKwecJxwP6IDJULBKFrpXvcee6WyW3FnIMvEy0kZctR7pa9uP2ZpxBUySY3peG6CfkY1Cib5pNhNDU8oG9EB71iqaMSNn81OnZBTq/RJGGtbCslM/T2R0ciYcRTYzoji0Cx6U/E/r5NieOVnQiUpcsXmi8JUEozJ9G/SF5ozlGNLKNPC3krYkGrK0KZTtCF4iy8vk2a14p1XqncX5dp1HkcBjuEEzsCDS6jBLdShAQwG8Ayv8OZI58V5dz7mrStOPnMEf+B8/gBaPo3X</latexit> 小さい問題から 順に解く
  11. /25 11 解の再構成 もともとのモチベーション 1本の金属棒からいくつかの金属棒を切り出すとき 収益最大化を達成するような切断箇所を決定したい 左端からの切出し位置 切出し位置の保存 長さ 1

    2 3 4 5 6 7 価格 1 5 8 9 10 17 17 i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> pi <latexit sha1_base64="d859ofo0ri5GbQo8/CJ8f1zry30=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48V7Qe0oWy2k3bpZhN2N0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU0nGqGDZZLGLVCahGwSU2DTcCO4lCGgUC28H4dua3n1BpHstHM0nQj+hQ8pAzaqz0kPR5v1xxq+4cZJV4OalAjka//NUbxCyNUBomqNZdz02Mn1FlOBM4LfVSjQllYzrErqWSRqj9bH7qlJxZZUDCWNmShszV3xMZjbSeRIHtjKgZ6WVvJv7ndVMTXvsZl0lqULLFojAVxMRk9jcZcIXMiIkllClubyVsRBVlxqZTsiF4yy+vklat6l1Ua/eXlfpNHkcRTuAUzsGDK6jDHTSgCQyG8Ayv8OYI58V5dz4WrQUnnzmGP3A+fwBVro3U</latexit> 練習. 下の価格表に対し の場合の 最適な切分けを求めよ n = 7 <latexit sha1_base64="uOVCHv/GHlxDxnmLqcZixtu+GXo=">AAAB6nicbVDLSgNBEOyNrxhfUY9eBoPgKexGIV6EoBePEc0DkiXMTnqTIbOzy8ysEEI+wYsHRbz6Rd78GyfJHjSxoKGo6qa7K0gE18Z1v53c2vrG5lZ+u7Czu7d/UDw8auo4VQwbLBaxagdUo+ASG4Ybge1EIY0Cga1gdDvzW0+oNI/loxkn6Ed0IHnIGTVWepDX1V6x5JbdOcgq8TJSggz1XvGr249ZGqE0TFCtO56bGH9CleFM4LTQTTUmlI3oADuWShqh9ifzU6fkzCp9EsbKljRkrv6emNBI63EU2M6ImqFe9mbif14nNeGVP+EySQ1KtlgUpoKYmMz+Jn2ukBkxtoQyxe2thA2poszYdAo2BG/55VXSrJS9i3Ll/rJUu8niyMMJnMI5eFCFGtxBHRrAYADP8ApvjnBenHfnY9Gac7KZY/gD5/MH0yGNfg==</latexit> 答え: i1 = 1, i2 = 6 <latexit sha1_base64="gTecf2SyGBStgt0axZz3KCN1+NM=">AAAB+XicbZDLSsNAFIZP6q3WW9Slm8EiuJCStKJuhKIblxXsBdoQJtNJO3QyCTOTQgl9EzcuFHHrm7jzbZy2WWjrDwMf/zmHc+YPEs6Udpxvq7C2vrG5Vdwu7ezu7R/Yh0ctFaeS0CaJeSw7AVaUM0GbmmlOO4mkOAo4bQej+1m9PaZSsVg86UlCvQgPBAsZwdpYvm0z30W3yL1AzK8auPLtslNx5kKr4OZQhlwN3/7q9WOSRlRowrFSXddJtJdhqRnhdFrqpYommIzwgHYNChxR5WXzy6fozDh9FMbSPKHR3P09keFIqUkUmM4I66Fars3M/2rdVIc3XsZEkmoqyGJRmHKkYzSLAfWZpETziQFMJDO3IjLEEhNtwiqZENzlL69Cq1pxa5Xq42W5fpfHUYQTOIVzcOEa6vAADWgCgTE8wyu8WZn1Yr1bH4vWgpXPHMMfWZ8/b+KQ7w==</latexit>
  12. /25 12 分割統治法っぽい手法で問題を解こうとするときに, 何度も同じ部分問題に遭遇する場合, その部分問題の解を保存しておき適宜利用すれば効率的 ここまでのハイライト

  13. /25 13 ケーススタディ2: 連鎖行列積 個の行列が与えられたとき を求めたい. A1A2 · · ·

    An <latexit sha1_base64="UyNC00PT78D/svO/N5YRdIsZfXQ=">AAAB+3icbZDLSgMxFIYzXmu91bp0EyyCqzJTBV22unFZwV6gHYZMJtOGZpIhOSOW0ldx40IRt76IO9/GtJ2Ftv4Q+PjPOZyTP0wFN+C6387a+sbm1nZhp7i7t39wWDoqt43KNGUtqoTS3ZAYJrhkLeAgWDfVjCShYJ1wdDurdx6ZNlzJBxinzE/IQPKYUwLWCkrlRuDhRlDDfRopMBatWXGr7lx4FbwcKihXMyh99SNFs4RJoIIY0/PcFPwJ0cCpYNNiPzMsJXREBqxnUZKEGX8yv32Kz6wT4Vhp+yTguft7YkISY8ZJaDsTAkOzXJuZ/9V6GcTX/oTLNAMm6WJRnAkMCs+CwBHXjIIYWyBUc3srpkOiCQUbV9GG4C1/eRXatap3Ua3dX1bqN3kcBXSCTtE58tAVqqM71EQtRNETekav6M2ZOi/Ou/OxaF1z8plj9EfO5w+uvJLt</latexit> n <latexit sha1_base64="2QmInd+nHO60uhS7AYCvgpiU4a8=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlpuyXK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH2F+M9g==</latexit> (単純に)行列積を実行するのに必要なスカラー積の回数: 例 に対して の2通りの計算順序がある hA1, A2, A3 i <latexit sha1_base64="TTs6ndWGIyX4K/CVNCfBWzULGB4=">AAACA3icbVDLSgMxFM3UV62vUXe6CRbBhZSZVtCFSKsblxXsA9oyZNJMG5rJDMkdoZSCG3/FjQtF3PoT7vwbM20X2nrgXg7n3Etyjx8LrsFxvq3M0vLK6lp2PbexubW9Y+/u1XWUKMpqNBKRavpEM8ElqwEHwZqxYiT0BWv4g5vUbzwwpXkk72EYs05IepIHnBIwkmcftAUL4LLiuae44hXTVmor3uvDlWfnnYIzAV4k7ozk0QxVz/5qdyOahEwCFUTrluvE0BkRBZwKNs61E81iQgekx1qGShIy3RlNbhjjY6N0cRApUxLwRP29MSKh1sPQN5Mhgb6e91LxP6+VQHDRGXEZJ8AknT4UJAJDhNNAcJcrRkEMDSFUcfNXTPtEEQomtpwJwZ0/eZHUiwW3VCjeneXL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9gff4A14SQnQ==</latexit> , C <latexit sha1_base64="re76Zkt0iSC9uIARbCEdpPGTKdg=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELh4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfj2txvP6HSPJYPZpKgH9Gh5CFn1FipUesXS27ZXYCsEy8jJchQ7xe/eoOYpRFKwwTVuuu5ifGnVBnOBM4KvVRjQtmYDrFrqaQRan+6OHRGLqwyIGGsbElDFurviSmNtJ5Ege2MqBnpVW8u/ud1UxPe+lMuk9SgZMtFYSqIicn8azLgCpkRE0soU9zeStiIKsqMzaZgQ/BWX14nrUrZuypXGtel6l0WRx7O4BwuwYMbqMI91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AJczjMs=</latexit> A <latexit sha1_base64="Lihtv2jYSe0RaYbwwPdS8141boc=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI+oF4+QyCOBDZkdemFkdnYzM2tCCF/gxYPGePWTvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCoqeNUMWywWMSqHVCNgktsGG4EthOFNAoEtoLR3cxvPaHSPJYPZpygH9GB5CFn1FipftMrltyyOwdZJV5GSpCh1it+dfsxSyOUhgmqdcdzE+NPqDKcCZwWuqnGhLIRHWDHUkkj1P5kfuiUnFmlT8JY2ZKGzNXfExMaaT2OAtsZUTPUy95M/M/rpCa89idcJqlByRaLwlQQE5PZ16TPFTIjxpZQpri9lbAhVZQZm03BhuAtv7xKmpWyd1Gu1C9L1dssjjycwCmcgwdXUIV7qEEDGCA8wyu8OY/Oi/PufCxac042cwx/4Hz+AJQrjMk=</latexit> B <latexit sha1_base64="wW6OXYFoJg3RvlrYIdlxqPzQzSE=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI8ELx4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfju7nffkKleSwfzCRBP6JDyUPOqLFSo9YvltyyuwBZJ15GSpCh3i9+9QYxSyOUhgmqdddzE+NPqTKcCZwVeqnGhLIxHWLXUkkj1P50ceiMXFhlQMJY2ZKGLNTfE1MaaT2JAtsZUTPSq95c/M/rpia89adcJqlByZaLwlQQE5P512TAFTIjJpZQpri9lbARVZQZm03BhuCtvrxOWpWyd1WuNK5L1VoWRx7O4BwuwYMbqMI91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AJWvjMo=</latexit> C <latexit sha1_base64="re76Zkt0iSC9uIARbCEdpPGTKdg=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELh4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfj2txvP6HSPJYPZpKgH9Gh5CFn1FipUesXS27ZXYCsEy8jJchQ7xe/eoOYpRFKwwTVuuu5ifGnVBnOBM4KvVRjQtmYDrFrqaQRan+6OHRGLqwyIGGsbElDFurviSmNtJ5Ege2MqBnpVW8u/ud1UxPe+lMuk9SgZMtFYSqIicn8azLgCpkRE0soU9zeStiIKsqMzaZgQ/BWX14nrUrZuypXGtel6l0WRx7O4BwuwYMbqMI91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AJczjMs=</latexit> A.columns <latexit sha1_base64="9YLEa9C8sPOGS0rejJCUWgb5KgY=">AAAB+3icbVC7TsMwFHXKq5RXKCOLRYXEFCUFCcYCC2OR6ENqo8px3daq40T2DaKK8issDCDEyo+w8Tc4bQZoOZKlo3PutY9PEAuuwXW/rdLa+sbmVnm7srO7t39gH1bbOkoUZS0aiUh1A6KZ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UGr4LjKtihp+rVz27aJTceZA68RdkiIs0fTtr/4gJmlEhSYcK9VznUR7GZaaEU6n+X6qaILJGA9pz1CBI6q8bH74FF0YZYDCWJoSGs3V3xsZjpSaRIGZjLAeqVVvJv7n9VIdXnsZE0mqqSCLh8KUIx2jWQpowCQlmk8MwUQycysiIywx0SarvAnBXf3yOmlXK26tUr2/LNZvlnHk4AzOoQQuXEEd7qAJLSCQwjO8wpv1ZL1Y79bHYnTDWu6cwh9Ynz/YJJCd</latexit> ((A1A2)A3) <latexit sha1_base64="NmmJcp9OveOg5+3uYB5HWejcZSI=">AAAB+HicbVDLTgIxFL3jE/HBqEs3jcQENmQGTHQJunGJiTwSmEw6pUBDpzNpOyY44UvcuNAYt36KO//GArNQ8CT35uSce9PbE8ScKe0439bG5tb2zm5uL79/cHhUsI9P2ipKJKEtEvFIdgOsKGeCtjTTnHZjSXEYcNoJJrdzv/NIpWKReNDTmHohHgk2ZARrI/l2oVRq+C5q+NWyabWybxedirMAWiduRoqQoenbX/1BRJKQCk04VqrnOrH2Uiw1I5zO8v1E0RiTCR7RnqECh1R56eLwGbowygANI2lKaLRQf2+kOFRqGgZmMsR6rFa9ufif10v08NpLmYgTTQVZPjRMONIRmqeABkxSovnUEEwkM7ciMsYSE22yypsQ3NUvr5N2teLWKtX7y2L9JosjB2dwDiVw4QrqcAdNaAGBBJ7hFd6sJ+vFerc+lqMbVrZzCn9gff4A14SQnQ==</latexit> とすると 10 ⇥ 100 <latexit sha1_base64="oogigaoiv4AhIYZm3mefTUoi2U8=">AAAB83icbVDLSgNBEOz1GeMr6tHLYBA8hdko6DHoxWME84DsEmYns8mQ2QczvUJY8htePCji1Z/x5t84SfagiQUNRVU33V1BqqRBSr+dtfWNza3t0k55d2//4LBydNw2Saa5aPFEJbobMCOUjEULJSrRTbVgUaBEJxjfzfzOk9BGJvEjTlLhR2wYy1ByhlbyXOqhjIQhLqX9SpXW6BxklbgFqUKBZr/y5Q0SnkUiRq6YMT2XpujnTKPkSk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sha1_base64="L2DgauvEnVHlq4VE5JGZaxQm9sA=">AAAB63icbVBNSwMxEJ2tX7V+VT16CRbBU9mtlXosevFYwX5Au5Rsmm1Dk+ySZIWy9C948aCIV/+QN/+N2XYP2vpg4PHeDDPzgpgzbVz32ylsbG5t7xR3S3v7B4dH5eOTjo4SRWibRDxSvQBrypmkbcMMp71YUSwCTrvB9C7zu09UaRbJRzOLqS/wWLKQEWwyqXHtusNyxa26C6B14uWkAjlaw/LXYBSRRFBpCMda9z03Nn6KlWGE03lpkGgaYzLFY9q3VGJBtZ8ubp2jC6uMUBgpW9Kghfp7IsVC65kIbKfAZqJXvUz8z+snJrzxUybjxFBJlovChCMToexxNGKKEsNnlmCimL0VkQlWmBgbT8mG4K2+vE46tap3Va091CvN2zyOIpzBOVyCBw1owj20oA0EJvAMr/DmCOfFeXc+lq0FJ585hT9wPn8A1teNcg==</latexit> 回 75000 <latexit sha1_base64="PyFLqLOiWbmQFW6/04vHYHL/BC8=">AAAB7HicbVBNTwIxEJ3FL8Qv1KOXRmLiiXQRg0eiF4+YuEACG9ItXWjodjdt14Rs+A1ePGiMV3+QN/+NBfag4EsmeXlvJjPzgkRwbTD+dgobm1vbO8Xd0t7+weFR+fikreNUUebRWMSqGxDNBJfMM9wI1k0UI1EgWCeY3M39zhNTmsfy0UwT5kdkJHnIKTFW8hrXGONBuYKreAG0TtycVCBHa1D+6g9jmkZMGiqI1j0XJ8bPiDKcCjYr9VPNEkInZMR6lkoSMe1ni2Nn6MIqQxTGypY0aKH+nshIpPU0CmxnRMxYr3pz8T+vl5rwxs+4TFLDJF0uClOBTIzmn6MhV4waMbWEUMXtrYiOiSLU2HxKNgR39eV10q5V3atq7aFead7mcRThDM7hElxoQBPuoQUeUODwDK/w5kjnxXl3PpatBSefOYU/cD5/AEVcjaw=</latexit> 回 10倍の差! 問題: スカラー乗算回数を最小化するよう積 を括弧付けせよ A1A2 · · · An <latexit sha1_base64="UyNC00PT78D/svO/N5YRdIsZfXQ=">AAAB+3icbZDLSgMxFIYzXmu91bp0EyyCqzJTBV22unFZwV6gHYZMJtOGZpIhOSOW0ldx40IRt76IO9/GtJ2Ftv4Q+PjPOZyTP0wFN+C6387a+sbm1nZhp7i7t39wWDoqt43KNGUtqoTS3ZAYJrhkLeAgWDfVjCShYJ1wdDurdx6ZNlzJBxinzE/IQPKYUwLWCkrlRuDhRlDDfRopMBatWXGr7lx4FbwcKihXMyh99SNFs4RJoIIY0/PcFPwJ0cCpYNNiPzMsJXREBqxnUZKEGX8yv32Kz6wT4Vhp+yTguft7YkISY8ZJaDsTAkOzXJuZ/9V6GcTX/oTLNAMm6WJRnAkMCs+CwBHXjIIYWyBUc3srpkOiCQUbV9GG4C1/eRXatap3Ua3dX1bqN3kcBXSCTtE58tAVqqM71EQtRNETekav6M2ZOi/Ou/OxaF1z8plj9EfO5w+uvJLt</latexit>
  14. /25 14 シラミツブシに調べる方法 個の行列の列に対する異なる括弧付けの個数 n <latexit sha1_base64="2QmInd+nHO60uhS7AYCvgpiU4a8=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlpuyXK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH2F+M9g==</latexit> P(n) <latexit sha1_base64="HchU+tX/rCiKb9jre2IN2GPF2gc=">AAAB63icbVBNSwMxEJ2tX7V+VT16CRahXspuK+ix6MVjBfsB7VKyabYNTbJLkhXK0r/gxYMiXv1D3vw3Zts9aOuDgcd7M8zMC2LOtHHdb6ewsbm1vVPcLe3tHxwelY9POjpKFKFtEvFI9QKsKWeStg0znPZiRbEIOO0G07vM7z5RpVkkH80spr7AY8lCRrDJpFZVXg7LFbfmLoDWiZeTCuRoDctfg1FEEkGlIRxr3ffc2PgpVoYRTuelQaJpjMkUj2nfUokF1X66uHWOLqwyQmGkbEmDFurviRQLrWcisJ0Cm4le9TLxP6+fmPDGT5mME0MlWS4KE45MhLLH0YgpSgyfWYKJYvZWRCZYYWJsPCUbgrf68jrp1Gteo1Z/uKo0b/M4inAG51AFD66hCffQgjYQmMAzvMKbI5wX5935WLYWnHzmFP7A+fwBPOGNtQ==</latexit>

    : P(n) = ( 1 if n = 1 Pn 1 k=1 P(k)P(n k) otherwise <latexit sha1_base64="8dr+RPWc/nTfvki0ha267cc4nls=">AAACSnicbVDPb9MwGHVKYSMbUODIxaJiag+r4jJpu1Sa4MKxSHSb1HSV435prThOZH/ZqKLw73HhxI0/gssOQ4gLbhuk/eBJlp7e+75n+0W5khaD4IfXeNB8+Ghr+7G/s/vk6bPW8xcnNiuMgJHIVGbOIm5BSQ0jlKjgLDfA00jBaZS8X/mnF2CszPQnXOYwSflcy1gKjk6atviwo7t0QMMI5lKXwkXZymf+XojwGUsZV1/0gPlh6Ie2SKdlMmDVean3WTXsJF23vJ90/w1nuABzKS1Ufgh6VodNW+2gF6xB7xNWkzapMZy2voezTBQpaBSKWztmQY6TkhuUQq2yCws5Fwmfw9hRzVOwk3JdRUXfOGVG48y4o5Gu1ZsbJU+tXaaRm0w5LuxdbyX+zxsXGB9NSqnzAkGLzUVxoShmdNUrnUkDAtXSES6MdG+lYsENF+ja910J7O6X75OTfo+97fU/HrSP39V1bJNX5DXpEEYOyTH5QIZkRAT5Sn6Sa/LL++Zdeb+9P5vRhlfvvCS30Gj+BS/2sWQ=</latexit> どこで分割するか それぞれの部分積の括弧付けが とりうるパターンの組合せ ⌦ ⇣ 4n/n3/2 ⌘ <latexit sha1_base64="MrcjM09jcWAjadDUiuaBjuQIuz4=">AAACC3icbVA9SwNBEN3zM8avU0ubxSDEJrlLBC1FGzsVjAr5Ym8zlyzZ2zt254RwpLfxr9hYKGLrH7Dz37iJKTTxwcDjvZndmRckUhj0vC9nbn5hcWk5t5JfXVvf2HS3tm9MnGoONR7LWN8FzIAUCmooUMJdooFFgYTboH828m/vQRsRq2scJNCMWFeJUHCGVmq7e42LCLqsISHEYv6wpWiZqlZWLVeG+YYW3R4etN2CV/LGoLPEn5ACmeCy7X42OjFPI1DIJTOm7nsJNjOmUXAJ9t3UQMJ4n3WhbqliEZhmNr5lSPet0qFhrG0ppGP190TGImMGUWA7I4Y9M+2NxP+8eorhcTMTKkkRFP/5KEwlxZiOgqEdoYGjHFjCuBZ2V8p7TDOONr68DcGfPnmW3FRKfrVUuTosnJxO4siRXbJHisQnR+SEnJNLUiOcPJAn8kJenUfn2Xlz3n9a55zJzA75A+fjG8HMmPU=</latexit> この数列は の速さで増加 シラミツブシに調べる戦略は連鎖行列の最適括弧付けには適さない. 部分問題の構造を利用する.
  15. /25 15 アルゴリズムの設計指針 最適な括弧付けを仮定 AiAi+1 · · · Aj <latexit

    sha1_base64="d4BgiSep36myJr90VrduqqMWnMo=">AAACAHicbVDLSgMxFM3UV62vURcu3ASLIAhlpgq6bHXjsoJ9QDsMmUymjc0kQ5IRyjAbf8WNC0Xc+hnu/BvTdhZaPXDh5Jx7yb0nSBhV2nG+rNLS8srqWnm9srG5tb1j7+51lEglJm0smJC9ACnCKCdtTTUjvUQSFAeMdIPx9dTvPhCpqOB3epIQL0ZDTiOKkTaSbx80fQqbfkZP3RzCAQ6FVuZ979tVp+bMAP8StyBVUKDl25+DUOA0JlxjhpTqu06ivQxJTTEjeWWQKpIgPEZD0jeUo5goL5sdkMNjo4QwEtIU13Cm/pzIUKzUJA5MZ4z0SC16U/E/r5/q6NLLKE9STTiefxSlDGoBp2nAkEqCNZsYgrCkZleIR0girE1mFROCu3jyX9Kp19yzWv32vNq4KuIog0NwBE6ACy5AA9yAFmgDDHLwBF7Aq/VoPVtv1vu8tWQVM/vgF6yPb2K6lP4=</latexit> を と分割 ((Ai · · · Ak)(Ak+1 · · · Aj)) <latexit sha1_base64="k59hsmDFzcxNMr0EB3JZmtHTbi8=">AAACEHicbZDLSsNAFIYn9VbrLerSzWARW4SSVEGXrW5cVrAXaEOYTKbtmMkkzEyEEvoIbnwVNy4UcevSnW/jtA2orT8M/HznHM6c34sZlcqyvozc0vLK6lp+vbCxubW9Y+7utWSUCEyaOGKR6HhIEkY5aSqqGOnEgqDQY6TtBVeTevueCEkjfqtGMXFCNOC0TzFSGrnmcalUdynsYT9SEtbdoAw1SIMTe/wD78pl1yxaFWsquGjszBRBpoZrfvb8CCch4QozJGXXtmLlpEgoihkZF3qJJDHCARqQrrYchUQ66fSgMTzSxIf9SOjHFZzS3xMpCqUchZ7uDJEayvnaBP5X6yaqf+GklMeJIhzPFvUTBlUEJ+lAnwqCFRtpg7Cg+q8QD5FAWOkMCzoEe/7kRdOqVuzTSvXmrFi7zOLIgwNwCErABuegBq5BAzQBBg/gCbyAV+PReDbejPdZa87IZvbBHxkf30HTmjc=</latexit> どちらも最適な括弧付けになっていなければならない 必要なスカラー積の回数 m[i, j] = m[i, k] + m[k + 1, j] + pi 1pkpj <latexit sha1_base64="yJO/ZMC8To04j95kfl2Mt+uSk+o=">AAACFnicbZDLSsNAFIYnXmu9RV26GSyCUFuSKuhGKLpxWcFeIA1hMp2200ySYWYilNCncOOruHGhiFtx59s4TbPQ1h8GPv5zDmfO73NGpbKsb2NpeWV1bb2wUdzc2t7ZNff2WzJOBCZNHLNYdHwkCaMRaSqqGOlwQVDoM9L2g5tpvf1AhKRxdK/GnLghGkS0TzFS2vLMSujQUzhy4RXMKHBhWVNQtjO3DLmX0oo94V7AvZFnlqyqlQkugp1DCeRqeOZXtxfjJCSRwgxJ6dgWV26KhKKYkUmxm0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6K4ZWfCZWkyBWbLwpTSTAm079JX2jOUI4toUwLeythQ6opQ5tO0YbgLb68TJrVindeqd5flGs3eRwFOIYTOAMPLqEGd1CHBjAYwDO8wpsjnRfn3fmYt644+cwR/IHz+QMRHI2n</latexit> として のサイズを 部分問題のコストの和 に新規で必要なスカラー積の回数 ((Ai · · · Ak)(Ak+1 · · · Aj)) <latexit sha1_base64="k59hsmDFzcxNMr0EB3JZmtHTbi8=">AAACEHicbZDLSsNAFIYn9VbrLerSzWARW4SSVEGXrW5cVrAXaEOYTKbtmMkkzEyEEvoIbnwVNy4UcevSnW/jtA2orT8M/HznHM6c34sZlcqyvozc0vLK6lp+vbCxubW9Y+7utWSUCEyaOGKR6HhIEkY5aSqqGOnEgqDQY6TtBVeTevueCEkjfqtGMXFCNOC0TzFSGrnmcalUdynsYT9SEtbdoAw1SIMTe/wD78pl1yxaFWsquGjszBRBpoZrfvb8CCch4QozJGXXtmLlpEgoihkZF3qJJDHCARqQrrYchUQ66fSgMTzSxIf9SOjHFZzS3xMpCqUchZ7uDJEayvnaBP5X6yaqf+GklMeJIhzPFvUTBlUEJ+lAnwqCFRtpg7Cg+q8QD5FAWOkMCzoEe/7kRdOqVuzTSvXmrFi7zOLIgwNwCErABuegBq5BAzQBBg/gCbyAV+PReDbejPdZa87IZvbBHxkf30HTmjc=</latexit> m[i, j] = ( 0 i = j minik<j {m[i, k] + m[k + 1, j] + pi 1pkpj } i < j <latexit sha1_base64="RGC7YO2yAVsDzNpaX+1PX9wH2uw=">AAACZnicbVFNb9QwFHTCVxugbFshDlyeWFEhLaySFgkOVKrgwrFIbFspjiLH6+x6YzvGdpBWUf4kN85c+Bk4aQ7Q8iRLo3lv5tnjQgtuXRz/DMI7d+/df7CzGz189HjvyWT/4MLWjaFsQWtRm6uCWCa4YgvHnWBX2jAiC8Eui+pT37/8zozltfrqtpplkqwULzklzlP5pJMpfw2bDE4BF2zFVUu9m+2i+Aj46SbCOMKSq7zlgAX7BhV8gE3X49LhNhrUVQYzkGk1SwanGWg//ibpdF7p3FsYvlo73EVHvBdHmKnluCWfTON5PBTcBskIpmis83zyAy9r2kimHBXE2jSJtctaYhyngnURbizThFZkxVIPFZHMZu0QUwcvPbOEsjb+KAcD+7eiJdLarSz8pCRubW/2evJ/vbRx5fus5Uo3jil6vahsBLga+sxhyQ2jTmw9INRwf1ega2IIdf5nIh9CcvPJt8HF8Tw5mR9/eTs9+zjGsYOeoxfoFUrQO3SGPqNztEAU/Qp2g4PgMPgd7oVPw2fXo2Ewag7RPxXCH7iFsvI=</latexit> 再帰的定義
  16. /25 16 履歴管理を用いるトップダウン方式 初期化 既知の値であれば結果を再利用 O(n 3) <latexit sha1_base64="s1YvWRMWwySboD4m9GsP4RT+J10=">AAAB7XicbVBNSwMxEJ31s9avqkcvwSLUS9ltBT0WvXizgv2Adi3ZNNvGZpMlyQpl6X/w4kERr/4fb/4b03YP2vpg4PHeDDPzgpgzbVz321lZXVvf2Mxt5bd3dvf2CweHTS0TRWiDSC5VO8CaciZowzDDaTtWFEcBp61gdD31W09UaSbFvRnH1I/wQLCQEWys1LwtiYfqWa9QdMvuDGiZeBkpQoZ6r/DV7UuSRFQYwrHWHc+NjZ9iZRjhdJLvJprGmIzwgHYsFTii2k9n107QqVX6KJTKljBopv6eSHGk9TgKbGeEzVAvelPxP6+TmPDST5mIE0MFmS8KE46MRNPXUZ8pSgwfW4KJYvZWRIZYYWJsQHkbgrf48jJpVspetVy5Oy/WrrI4cnAMJ1ACDy6gBjdQhwYQeIRneIU3RzovzrvzMW9dcbKZI/gD5/MHY7yOWQ==</latexit> 計算量:

    m[i, j] = ( 0 minik<j {m[i, k] + m[k + 1, j] + pi 1pkpj <latexit sha1_base64="RGC7YO2yAVsDzNpaX+1PX9wH2uw=">AAACZnicbVFNb9QwFHTCVxugbFshDlyeWFEhLaySFgkOVKrgwrFIbFspjiLH6+x6YzvGdpBWUf4kN85c+Bk4aQ7Q8iRLo3lv5tnjQgtuXRz/DMI7d+/df7CzGz189H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FsvI=</latexit>
  17. /25 17 ボトムアップ方式 l <latexit sha1_base64="0C8sfUJYbrjC43r1LRBZ8OgM3fg=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlpuiXK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH1VeM9A==</latexit> i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> j

    <latexit sha1_base64="sezUAcifLCsPU4ANWRbU4nmBeg4=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELx4hkUcCGzI79MLA7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJU8epYthgsYhVO6AaBZfYMNwIbCcKaRQIbAXj+7nfekKleSwfzSRBP6IDyUPOqLFSfdQrltyyuwBZJ15GSpCh1it+dfsxSyOUhgmqdcdzE+NPqTKcCZwVuqnGhLIxHWDHUkkj1P50ceiMXFilT8JY2ZKGLNTfE1MaaT2JAtsZUTPUq95c/M/rpCa89adcJqlByZaLwlQQE5P516TPFTIjJpZQpri9lbAhVZQZm03BhuCtvrxOmpWyd1Wu1K9L1bssjjycwTlcggc3UIUHqEEDGCA8wyu8OSPnxXl3PpatOSebOYU/cD5/ANJPjPI=</latexit> k <latexit sha1_base64="S3l8nnBLDerjgmOsR9KRP3N3+lk=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOl5rhfrrhVdw6ySrycVCBHo1/+6g1ilkYoDRNU667nJsbPqDKcCZyWeqnGhLIxHWLXUkkj1H42P3RKzqwyIGGsbElD5urviYxGWk+iwHZG1Iz0sjcT//O6qQmv/YzLJDUo2WJRmApiYjL7mgy4QmbExBLKFLe3EjaiijJjsynZELzll1dJu1b1Lqq15mWlfpPHUYQTOIVz8OAK6nAHDWgBA4RneIU359F5cd6dj0VrwclnjuEPnM8f09OM8w==</latexit> A1A2 · · · An <latexit sha1_base64="UyNC00PT78D/svO/N5YRdIsZfXQ=">AAAB+3icbZDLSgMxFIYzXmu91bp0EyyCqzJTBV22unFZwV6gHYZMJtOGZpIhOSOW0ldx40IRt76IO9/GtJ2Ftv4Q+PjPOZyTP0wFN+C6387a+sbm1nZhp7i7t39wWDoqt43KNGUtqoTS3ZAYJrhkLeAgWDfVjCShYJ1wdDurdx6ZNlzJBxinzE/IQPKYUwLWCkrlRuDhRlDDfRopMBatWXGr7lx4FbwcKihXMyh99SNFs4RJoIIY0/PcFPwJ0cCpYNNiPzMsJXREBqxnUZKEGX8yv32Kz6wT4Vhp+yTguft7YkISY8ZJaDsTAkOzXJuZ/9V6GcTX/oTLNAMm6WJRnAkMCs+CwBHXjIIYWyBUc3srpkOiCQUbV9GG4C1/eRXatap3Ua3dX1bqN3kcBXSCTtE58tAVqqM71EQtRNETekav6M2ZOi/Ou/OxaF1z8plj9EfO5w+uvJLt</latexit> 小さい問題から順に解く m[i, j] = ( 0 i = j minik<j {m[i, k] + m[k + 1, j] + pi 1pkpj } i < j <latexit sha1_base64="RGC7YO2yAVsDzNpaX+1PX9wH2uw=">AAACZnicbVFNb9QwFHTCVxugbFshDlyeWFEhLaySFgkOVKrgwrFIbFspjiLH6+x6YzvGdpBWUf4kN85c+Bk4aQ7Q8iRLo3lv5tnjQgtuXRz/DMI7d+/df7CzGz189HjvyWT/4MLWjaFsQWtRm6uCWCa4YgvHnWBX2jAiC8Eui+pT37/8zozltfrqtpplkqwULzklzlP5pJMpfw2bDE4BF2zFVUu9m+2i+Aj46SbCOMKSq7zlgAX7BhV8gE3X49LhNhrUVQYzkGk1SwanGWg//ibpdF7p3FsYvlo73EVHvBdHmKnluCWfTON5PBTcBskIpmis83zyAy9r2kimHBXE2jSJtctaYhyngnURbizThFZkxVIPFZHMZu0QUwcvPbOEsjb+KAcD+7eiJdLarSz8pCRubW/2evJ/vbRx5fus5Uo3jil6vahsBLga+sxhyQ2jTmw9INRwf1ega2IIdf5nIh9CcvPJt8HF8Tw5mR9/eTs9+zjGsYOeoxfoFUrQO3SGPqNztEAU/Qp2g4PgMPgd7oVPw2fXo2Ewag7RPxXCH7iFsvI=</latexit> 括弧付けの位置 計算量: ⇥(n3) <latexit sha1_base64="G8WRpL5exN/uz8BAetuwevH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数 1 2 3 4 5 6 1 0 15750 7875 9375 11875 15125 2 0 2625 4375 7125 10500 3 0 750 2500 5375 4 0 1000 3500 5 0 5000 6 0 j <latexit sha1_base64="sezUAcifLCsPU4ANWRbU4nmBeg4=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELx4hkUcCGzI79MLA7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJU8epYthgsYhVO6AaBZfYMNwIbCcKaRQIbAXj+7nfekKleSwfzSRBP6IDyUPOqLFSfdQrltyyuwBZJ15GSpCh1it+dfsxSyOUhgmqdcdzE+NPqTKcCZwVuqnGhLIxHWDHUkkj1P50ceiMXFilT8JY2ZKGLNTfE1MaaT2JAtsZUTPUq95c/M/rpCa89adcJqlByZaLwlQQE5P516TPFTIjJpZQpri9lbAhVZQZm03BhuCtvrxOmpWyd1Wu1K9L1bssjjycwTlcggc3UIUHqEEDGCA8wyu8OSPnxXl3PpatOSebOYU/cD5/ANJPjPI=</latexit> i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> 1 2 3 4 5 6 1 1 1 3 3 3 2 2 3 3 3 3 3 3 3 4 4 5 5 5 6 j <latexit sha1_base64="sezUAcifLCsPU4ANWRbU4nmBeg4=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELx4hkUcCGzI79MLA7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJU8epYthgsYhVO6AaBZfYMNwIbCcKaRQIbAXj+7nfekKleSwfzSRBP6IDyUPOqLFSfdQrltyyuwBZJ15GSpCh1it+dfsxSyOUhgmqdcdzE+NPqTKcCZwVuqnGhLIxHWDHUkkj1P50ceiMXFilT8JY2ZKGLNTfE1MaaT2JAtsZUTPUq95c/M/rpCa89adcJqlByZaLwlQQE5P516TPFTIjJpZQpri9lbAhVZQZm03BhuCtvrxOmpWyd1Wu1K9L1bssjjycwTlcggc3UIUHqEEDGCA8wyu8OSPnxXl3PpatOSebOYU/cD5/ANJPjPI=</latexit> s <latexit sha1_base64="8r6dWOvdyfgmPOHEanDSQrmgcis=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlpu6XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH3/OM+w==</latexit> 括弧付の位置 m[1, 2] + m[3, 3] + p0p2p3 =15750 + 0 + 30 · 15 · 5 =18000 <latexit sha1_base64="EQRDOm5SM0LAYObsWWAGh12UCFk=">AAACMXicbVBPS8MwHE39b/039eglOBRhMtLWoRdB9OJRwemgLSXNMg1L2pCkwih+JS9+E/HiQRGvfgmzrQedPvjB4733I/m9VHKmDUKvztT0zOzc/MKiu7S8srpWW9+41nmhCG2TnOeqk2JNOcto2zDDaUcqikXK6U3aPxv6N/dUaZZnV2YgaSzwbcZ6jGBjpaR2vitCb9+PGyIM9oO4IRMkE18mAXSj6Bjueq3DFoINOJwARaSbG+i14Ji0qswRQiip1VETjQD/Eq8idVDhIqk9R92cFIJmhnCsdeghaeISK8MIpw9uVGgqMenjWxpammFBdVyOLn6AO1bpwl6u7GQGjtSfGyUWWg9EapMCmzs96Q3F/7ywML2juGSZLAzNyPihXsGhyeGwPthlihLDB5Zgopj9KyR3WGFibMmuLcGbPPkvufabXtD0Lw/qJ6dVHQtgC2yDPeCBQ3ACzsEFaAMCHsELeAPvzpPz6nw4n+PolFPtbIJfcL6+AdcloX0=</latexit> m[1, 1] + m[2, 3] + p0p1p3 =0 + 2625 + 30 · 35 · 5 =7875 <latexit sha1_base64="goRi8AeV4kDLjmSPq1gUUtTM/zw=">AAACL3icbVBLSwMxGMz6rPVV9eglWCxCS9mHtb0IRUE8VrBW2F2WbJpqMNkNSVYopf/Ii3+lFxFFvPovTB8HtQ6EDDPzkXwTC0aVtu1Xa2FxaXllNbeWX9/Y3Nou7OzeqDSTmLRxylJ5GyNFGE1IW1PNyK2QBPGYkU78cD72O49EKpom17ovSMjRXUJ7FCNtpKhwUeK+U3HCMvfdiheWRWSLyBGRB/NBcApLNixD98StmcuzA9xNNfRqcEpq00i9Ua9FhaJdtSeA88SZkSKYoRUVRkE3xRknicYMKeU7ttDhAElNMSPDfJApIhB+QHfENzRBnKhwMNl3CA+N0oW9VJqTaDhRf04MEFeqz2OT5Ejfq7/eWPzP8zPda4QDmohMkwRPH+plDOoUjsuDXSoJ1qxvCMKSmr9CfI8kwtpUnDclOH9Xnic3btXxqu7VcbF5NqsjB/bBATgCDqiDJrgELdAGGDyBEXgD79az9WJ9WJ/T6II1m9kDv2B9fQPss6EX</latexit> ((A1(A2A3))((A4A5)A6)) <latexit sha1_base64="bf9jgUFhG9RjRShPJCXQ5ZAZHcU=">AAACCHicbVC7TsMwFHXKq5RXgJEBiwqpWaqkLY+xhYWxSLRUaqPIcd3WquNEtoNURR1Z+BUWBhBi5RPY+BucNgO0HOlax+fcK/seP2JUKtv+NnIrq2vrG/nNwtb2zu6euX/QlmEsMGnhkIWi4yNJGOWkpahipBMJggKfkXt/fJ369w9ESBryOzWJiBugIacDipHSkmcel0oNz9FVgQ2valnptabpmaWPc8vyzKJdtmeAy8TJSBFkaHrmV68f4jggXGGGpOw6dqTcBAlFMSPTQi+WJEJ4jIakqylHAZFuMltkCk+10oeDUOjiCs7U3xMJCqScBL7uDJAayUUvFf/zurEaXLoJ5VGsCMfzhwYxgyqEaSqwTwXBik00QVhQ/VeIR0ggrHR2BR2Cs7jyMmlXyk61XLmtFetXWRx5cAROQAk44ALUwQ1oghbA4BE8g1fwZjwZL8a78TFvzRnZzCH4A+PzB+WAlM8=</latexit> Q. 最適な括弧付けは?:
  19. /25 19 何度も同じ部分問題を解くのは無駄 各部分問題を一度だけ解くようにすれば効率的なはず! 2つのケーススタディで共通している観点

  20. /25 20 動的計画法は分割統治法と同様, 部分問題の解を統合することによって問題を解く方法である. 計算結果を保存しておくことで, 部分部分問題を再計算する労を避ける. 部分構造最適性 (optimal substructure) 部分問題重複性

    (overlapping subproblems) どんなときに適応できるのか? and ボトムアップ方式 (bottom-up method) 履歴管理を用いるトップダウン方式 (top-down with memorization) どのように実現するのか? or
  21. /25 21 部分構造最適性 連鎖行列積 AiAi+1 · · · Aj <latexit

    sha1_base64="d4BgiSep36myJr90VrduqqMWnMo=">AAACAHicbVDLSgMxFM3UV62vURcu3ASLIAhlpgq6bHXjsoJ9QDsMmUymjc0kQ5IRyjAbf8WNC0Xc+hnu/BvTdhZaPXDh5Jx7yb0nSBhV2nG+rNLS8srqWnm9srG5tb1j7+51lEglJm0smJC9ACnCKCdtTTUjvUQSFAeMdIPx9dTvPhCpqOB3epIQL0ZDTiOKkTaSbx80fQqbfkZP3RzCAQ6FVuZ979tVp+bMAP8StyBVUKDl25+DUOA0JlxjhpTqu06ivQxJTTEjeWWQKpIgPEZD0jeUo5goL5sdkMNjo4QwEtIU13Cm/pzIUKzUJA5MZ4z0SC16U/E/r5/q6NLLKE9STTiefxSlDGoBp2nAkEqCNZsYgrCkZleIR0girE1mFROCu3jyX9Kp19yzWv32vNq4KuIog0NwBE6ACy5AA9yAFmgDDHLwBF7Aq/VoPVtv1vu8tWQVM/vgF6yPb2K6lP4=</latexit> を と分割 ((Ai · · · Ak)(Ak+1 · · · Aj)) <latexit sha1_base64="k59hsmDFzcxNMr0EB3JZmtHTbi8=">AAACEHicbZDLSsNAFIYn9VbrLerSzWARW4SSVEGXrW5cVrAXaEOYTKbtmMkkzEyEEvoIbnwVNy4UcevSnW/jtA2orT8M/HznHM6c34sZlcqyvozc0vLK6lp+vbCxubW9Y+7utWSUCEyaOGKR6HhIEkY5aSqqGOnEgqDQY6TtBVeTevueCEkjfqtGMXFCNOC0TzFSGrnmcalUdynsYT9SEtbdoAw1SIMTe/wD78pl1yxaFWsquGjszBRBpoZrfvb8CCch4QozJGXXtmLlpEgoihkZF3qJJDHCARqQrrYchUQ66fSgMTzSxIf9SOjHFZzS3xMpCqUchZ7uDJEayvnaBP5X6yaqf+GklMeJIhzPFvUTBlUEJ+lAnwqCFRtpg7Cg+q8QD5FAWOkMCzoEe/7kRdOqVuzTSvXmrFi7zOLIgwNwCErABuegBq5BAzQBBg/gCbyAV+PReDbejPdZa87IZvbBHxkf30HTmjc=</latexit> どちらも最適な括弧付けになっていなければならない rn = max (pn, r1 + rn 1, r2 + rn 2, . . . , rn 1 + r1) <latexit sha1_base64="VF5YgItC26ZaRlklvBN81eSkKj8=">AAACOHicbVBNSwMxEM36WetX1aOXYFEqatmtgl6EohdvVrC20C1LNs22odnsksyKZenP8uLP8CZePCji1V9g+iFodSDhzXszk8zzY8E12PaTNTU9Mzs3n1nILi4tr6zm1tZvdJQoyqo0EpGq+0QzwSWrAgfB6rFiJPQFq/nd84Feu2VK80heQy9mzZC0JQ84JWAoL3epPIl3TrEbkjtXsAAKsSf3sfIcvGfuVB44/UFa+k5LJnVbEej9b3moOK7i7Q7serm8XbSHgf8CZwzyaBwVL/doptEkZBKoIFo3HDuGZkoUcCpYP+smmsWEdkmbNQyUJGS6mQ4X7+Ntw7RwEClzJOAh+7MjJaHWvdA3lSGBjp7UBuR/WiOB4KSZchknwCQdPRQkAkOEBy7iFleMgugZQKji5q+YdogiFIzXWWOCM7nyX3BTKjqHxdLVUb58NrYjgzbRFiogBx2jMrpAFVRFFN2jZ/SK3qwH68V6tz5GpVPWuGcD/Qrr8wuFtKim</latexit> ロッド切出し問題 長さが と の2つの金属棒に切断, それぞれの金属棒を最適に 分割することで得られる総収入 n i <latexit sha1_base64="AMTEmYgqxguyFb26Fa9BmJlDjkI=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4sSRV0GPRi8eK9gPaUDbbTbt0swm7E6GE/gQvHhTx6i/y5r9x2+agrQ8GHu/NMDMvSKQw6Lrfzsrq2vrGZmGruL2zu7dfOjhsmjjVjDdYLGPdDqjhUijeQIGStxPNaRRI3gpGt1O/9cS1EbF6xHHC/YgOlAgFo2ilB3UueqWyW3FnIMvEy0kZctR7pa9uP2ZpxBUySY3peG6CfkY1Cib5pNhNDU8oG9EB71iqaMSNn81OnZBTq/RJGGtbCslM/T2R0ciYcRTYzoji0Cx6U/E/r5NieO1nQiUpcsXmi8JUEozJ9G/SF5ozlGNLKNPC3krYkGrK0KZTtCF4iy8vk2a14l1UqveX5dpNHkcBjuEEzsCDK6jBHdShAQwG8Ayv8OZI58V5dz7mrStOPnMEf+B8/gAGqI2g</latexit> i <latexit sha1_base64="hA2BMjcr0btVk5qY1/HOr4xO94Q=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlJu+XK27VnYOsEi8nFcjR6Je/eoOYpRFKwwTVuuu5ifEzqgxnAqelXqoxoWxMh9i1VNIItZ/ND52SM6sMSBgrW9KQufp7IqOR1pMosJ0RNSO97M3E/7xuasJrP+MySQ1KtlgUpoKYmMy+JgOukBkxsYQyxe2thI2ooszYbEo2BG/55VXSrlW9i2qteVmp3+RxFOEETuEcPLiCOtxBA1rAAOEZXuHNeXRenHfnY9FacPKZY/gD5/MH0MuM8Q==</latexit> 切断なし 問題の最適解をその部分問題の最適解から構成できるか? 1. ある部分問題の解が最適でないと仮定 2. その部分問題の最適解に貼替える 3. 元の問題に対するよりよい解を得ることができる -> 矛盾 切貼り法(cut-and-paste)を用いて妥当性を確認
  22. /25 22 あるグラフと2点 u, v が与えられたとき u->v への最短路を求めよ u->v への最長単純道を求めよ

    部分構造最適性: YES 部分構造最適性: NO 解 u->w->v に対して 切出し法によるチェック 1. u->w への最短路を p とする 2. p より短い道 q が存在すると仮定 3. p を q に貼替える 4. 元の解より短い道が完成 -> 矛盾 u w v x uからvへの最長路: u->w->v uからwへの最長路: u->x->v->w wからvへの最長路: w->u->x->v 組合せても解にならない 部分問題が独立ではない
  23. /25 23 部分問題重複性 再帰アルゴリズムが同じ問題を繰返し訪れているか? 4 Cut-Rod(p, 4) <latexit sha1_base64="VXW9NeIZVP5wdRHbBH6CItNX4HI=">AAACAXicbVDLSgNBEJyNrxhfq14EL4NBiKBhNwb0GMzFYxTzgCSE2dnZZMjsg5leMSzx4q948aCIV//Cm3/jJNmDJhY0FFXddHc5keAKLOvbyCwtr6yuZddzG5tb2zvm7l5DhbGkrE5DEcqWQxQTPGB14CBYK5KM+I5gTWdYnfjNeyYVD4M7GEWs65N+wD1OCWipZx50gD1A0lEUV2M4uw3dcSE6xeWTnpm3itYUeJHYKcmjFLWe+dVxQxr7LAAqiFJt24qgmxAJnAo2znVixSJCh6TP2poGxGeqm0w/GONjrbjYC6WuAPBU/T2REF+pke/oTp/AQM17E/E/rx2Dd9lNeBDFwAI6W+TFAkOIJ3Fgl0tGQYw0IVRyfSumAyIJBR1aTodgz7+8SBqlon1eLN2U85WrNI4sOkRHqIBsdIEq6BrVUB1R9Iie0St6M56MF+Pd+Ji1Zox0Zh/9gfH5A8amlck=</latexit> 3

    0 2 1 0 0 1 0 1 0 0 2 1 0 0 ロッド切出し問題 4 3 0 2 1 0 0 1 1 0 2 Memorized-Cut-Rod-Aux(p, 4, r) <latexit sha1_base64="QfpOujYtrp8AIhkz+GJXWLhPbh4=">AAACEnicbVDLSgNBEJz1bXxFPXoZDIKCCbsa0KOPixdBxSRCEsLsbCcZnN1ZZnolcck3ePFXvHhQxKsnb/6Nk8dBowUNRVU33V1+LIVB1/1yJianpmdm5+YzC4tLyyvZ1bWyUYnmUOJKKn3jMwNSRFBCgRJuYg0s9CVU/NvTvl+5A22Eiq6xG0M9ZK1INAVnaKVGdqeG0MG0Zjg9h1BpcQ9B/jTB/JUK8sdJp7cd79LiLtU7jWzOLbgD0L/EG5EcGeGikf2sBYonIUTIJTOm6rkx1lOmUXAJvUwtMRAzfstaULU0YiGYejp4qUe3rBLQptK2IqQD9edEykJjuqFvO0OGbTPu9cX/vGqCzcN6KqI4QYj4cFEzkRQV7edDA6GBo+xawrgW9lbK20wzjjbFjA3BG3/5LynvFbz9wt5lMXd0MopjjmyQTbJNPHJAjsgZuSAlwskDeSIv5NV5dJ6dN+d92DrhjGbWyS84H98PfJxl</latexit>
  24. /25 24 動的計画法の応用例 遺伝子コードの比較, 系統樹の作成など 配列アラインメント (The Needleman Wunsch algorithm)

    時系列データの比較, 音声認識など 動的時間伸縮法 (dynamic time warping) グラフィカルモデルにおける推論手法 max-sum アルゴリズム
  25. /25 25 まとめ 大きい問題を分割, 部分問題を解いて得られた解を結合して 元の問題の答えを得る. 部分問題の解を保存しておき適宜利用する. 動的計画法 適用可能かの判断 解に部分構造最適性と部分問題重複性があるかどうか

    実現方法 履歴管理を用いるトップダウン方式 or ボトムアップ方式