动态规划与静态规划的关系

动态规划与静态规划的关系

ID:16464865

大小:22.62 KB

页数:6页

时间:2018-08-10

动态规划与静态规划的关系_第1页
动态规划与静态规划的关系_第2页
动态规划与静态规划的关系_第3页
动态规划与静态规划的关系_第4页
动态规划与静态规划的关系_第5页
资源描述:

《动态规划与静态规划的关系》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、动态规划与静态规划的关系动态规划与静态规划(线性和非线性规划等)研究的对象本质上都是在若干约束条件下的函数极值问题。两种规划在很多情况下原则上可以相互转换。动态规划可以看作求决策u1,u2,...,un ,使指标函数V1n(xl,u1,u2,...,un)达到最优(最大或最小)的极值问题,状态转移方程、端点条件以及允许状态集、允许决策集等是约束条件,原则上可以用非线性规划方法求解。一些静态规划只要适当引入阶段变量、状态、决策等就可以用动态规划方法求解。下面用例子说明:[例11] 用动态规划解下列非线性规划:其中gk(uk)为任意的已知函

2、数。解:按变量uk的序号k划分阶段,看作n段决策过程;设状态为x1,x2,..xn,取问题中的变量u1,u2,..,un为决策;状态转移方程为:取gk(uk)为阶段指标,最优值函数的基本方程为(注意到xn+1=0):解此动态规划即可得到原静态规划的解。上面这个静态规划的模型有很多实际应用,比如下面这个问题:[例12]InflateThemorepointsstudentsscoreinourcontests,thehappierwehereattheUSACOare.Wetrytodesignourcontestssothatpeopl

3、ecanscoreasmanypointsaspossible,andwouldlikeyourassistance.Wehaveseveralcategoriesfromwhichproblemscanbechosen,wherea"category"isanunlimitedsetofcontestproblemswhichallrequirethesameamountoftimetosolveanddeservethesamenumberofpointsforacorrectsolution.Yourtaskiswriteapro

4、gramwhichtellstheUSACOstaffhowmanyproblemsfromeachcategorytoincludeinacontestsoastomaximizethetotalnumberofpointsinthechosenproblemswhilekeepingthetotalsolutiontimewithinthelengthofthecontest.Theinputincludesthelengthofthecontest,M(1<=M<=10,000)(don'tworry,youwon'thaveto

5、competeinthelongercontestsuntiltrainingcamp)andN,thenumberofproblemcategories,where1<=N<=10,000.EachofthesubsequentNlinescontainstwointegersdescribingacategory:thefirstintegertellsthenumberofpointsaproblemfromthatcategoryisworth(1<=points<=10000);thesecondtellsthenumbero

6、fminutesaproblemfromthatcategorytakestosolve(1<=minutes<=10000).Yourprogramshoulddeterminethenumberofproblemsweshouldtakefromeachcategorytomakethehighest-scoringcontestsolvablewithinthelengthofthecontest.Remember,thenumberfromanycategorycanbeanynonnegativeinteger(0,one,o

7、rmany).Calculatethemaximumnumberofpossiblepoints.PROGRAMNAME:inflateINPUTFORMATLine1:M,N--contestminutesandnumberofproblemclassesLines2-N+1:Twointegers:thepointsandminutesforeachclassSAMPLEINPUT(fileinflate.in)3004100602501201201003520OUTPUTFORMATAsinglelinewiththemaximu

8、mnumberofpointspossiblegiventheconstraints.SAMPLEOUTPUT(fileinflate.out)605显而易见,上面这个例题的数学模型就是例11的规划模型。与

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。