2022年动态规划的技巧——阶段的划分和状态的表示.docx





《2022年动态规划的技巧——阶段的划分和状态的表示.docx》由会员分享,可在线阅读,更多相关《2022年动态规划的技巧——阶段的划分和状态的表示.docx(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品学习资源动态规划的技巧 阶段的划分和状态的表示在动态规划的设计过程中, 阶段的划分和状态的表示是特别重要的两步, 这两步会直接影响该问题的运算复杂性, 有时候阶段划分或状态表示的不合理仍会使得动态规划法不适用;例 9 街道问题在以下图中找出从左下角到右上角的最短路径,每步只能向右方或上方走;这是一道简洁而又典型的动态规划题, 很多介绍动态规划的书与文章中都拿它来做例子;通常,书上的解答是这样的:依据图中的虚线来划分阶段,即阶段变量 k 表示走过的步数,而状态变量 xk 表示当前处于这一阶段上的哪一点; 这时的模型实际上已经转化成欢迎下载精品学习资源了一个特别的多段图; 用决策变量 uk=0
2、 表示向右走, uk=1 表示向上走, 就状态转移方程如下:这里的 row 是地图竖直方向的行数我们看到,这个状态转移方程需要依据k 的取值分两种情形争论, 显得特别麻烦;相应的,把它代入规划方程而付诸实现时,算法也很繁;因而我们在实现时,一般是不会这么做的,而代之以下面方法:这里 Distance 表示相邻两点间的边长这样做的确要比上面的方法简洁多了, 但是它已经破坏了动态规划的原来面目, 而不存在明确的阶段特点了;假如说这种方法是以地图中的行A、B、C、D来划分阶段的话,那么它的 状态转移 就不全是在两个阶段之间进行的了;欢迎下载精品学习资源或许这没什么大不了的,由于实践比理论更有说服力;
3、但是,假如我们把题目扩展一下: 在地图中找出从左下角到右上角的两条路径,两条路径中的 任何一条边都不能重叠 ,并且要求两条路径的总长度最短; 这时, 再用这种 简洁 的方法就不太好办了;假如非得套用这种方法的话,就最优指标函数就需要有四维的下标,并且难以处理两条路径 不能重叠 的问题;而我们回到原先 标准 的动态规划法,就会发觉这个问题很好解决,只需要加一维状态变量就成了; 即用 xk=ak,bk分别表示两条路径走到阶段k 时所处的位置,相应的,决策变量也增加一维,用uk=xk,yk分别表示两条路径的行走方向;状态转移时将两条路径分别考虑在写规划方程时,只要对两条路径走到同一个点的情形略微处理
4、一下, 削减可选的决策个数:从这个例子可以看出, 合理地划分阶段和挑选状态可以给解题带来便利;例 10 LITTLE SHOP OF FLOWERSIOI 99PROBLEM欢迎下载精品学习资源You want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued
5、onto the shelf and are numbered consecutively 1 throughV, where V is the number of vases, from left to right so that the vase 1 is the leftmost, and the vaseV is the rightmost vase. The bunches are moveable and are uniquely identified by integers between 1 andF. These id-numbers have a significance:
6、 They determine the required order of appearance of the flower bunches in the row of vases so that the bunchimust be in a vase to the left of the vase containingbunch j whenever i j. Suppose, for example, you have a bunch of azaleas id-number=1, a bunch of begonias id-number=2 and a bunch of carnati
7、ons id-number=3. Now, all the bunches must be put into the vases keeping their id-numbers in order. The bunch of azaleas must be in a vase to the left of begonias, and the bunch of begonias must be in a vase to the left of carnations. If there are more vases than bunches of flowers then the excess w
8、ill be left empty. A vase can hold only one bunch of flowers.Each vase has a distinct characteristic just like flowers do. Hence, puttinga bunch of flowers in a vase results in a certain aesthetic value, expressed by an integer. The aesthetic values are presented in a table as shown below.Leaving a
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 动态 规划 技巧 阶段 划分 状态 表示

限制150内