Analysis of algorithms

Analysis of algorithms

ID:40878714

大小:282.43 KB

页数:91页

时间:2019-08-09

Analysis of algorithms_第1页
Analysis of algorithms_第2页
Analysis of algorithms_第3页
Analysis of algorithms_第4页
Analysis of algorithms_第5页
资源描述:

《Analysis of algorithms》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、CS445Analysisofalgorithms2LinearprogrammingEricSchost´eschost@uwo.ca1Top10algorithmsAccordingtoSIAM(societyforindustrialandappliedmath)•...•Simplexalgorithmforlinearprogramming•FastFourierTransform•Quicksort•...Ifonewouldtakestatisticsaboutwhichmathematicalproblemisusingupmostofthecomputertimeinthew

2、orld,then...theanswerwouldprobablybelinearprogramming.2SetupLinearprogrammingdealswithsatisfiabilityandoptimizationproblemsforlinearconstraints.•Alinearconstraintisarelationoftheforma1x1+···+anxn=b,ora1x1+···+anxn≤bora1x1+···+anxn≥b,wheretheaiandbareconstantsandthexiaretheunknowns.•satisfiability:give

3、nseverallinearconstraints,isthereavalue(x1,...,xn)thatsatisfiesthemall?•optimization:givenseverallinearconstraints,assumingthereisavalue(x1,...,xn)thatsatisfiesthemall,findonewhichmaximizesc1x1+···+cnxn.3AbabyexampleYouareallowedtoshareyourtimebetweentwocompanies.•companyC1pays1dollarperhour;•companyC2

4、pays10dollarsperhour.Knowingthatyoucanonlyworkupto8hoursperday,whatscheduleshouldyougofor?Ofcourse,workfull-timeatcompanyC2.•Linearformulation:x1isthetimespentatC1andx2thetimespentatC2.•Constraints:x1≥0,x2≥0,x1+x2≤8.•Objectivefunction:maximizex1+10x2.•Solution:x1=0,x2=8.4Moreexamples5AdietproblemNut

5、ritionfactscarbsproteinfatironpricesliceofbread3051.51030cupofyogurt1092.5080tspofbutter6818620minimum3005070100Goal:Minimize30x1+80x2+20x3.Constraints:30x1+10x2+6x3≥3005x1+9x2+8x3≥501.5x1+2.5x2+18x3≥7010x1+6x3≥1006MaximalflowInput:•agraphG,•acapacityfunctioncontheedges,•asourcesandasinkt,findamaximal

6、flowfromstot.Solution:•Createavariablefu,vforeachedge(u,v)andthelinearconstraintsXXfu,v≥0,fu,v≤c(u,v),fu,v=fv,w(u,v)edge(v,w)edge•MaximizeXfs,v.(s,v)edge7ShortestpathInput:•agraphG,•alengthfunction`ontheedges,•asourcesandatargett,findashortestpathfromstot.Solution:•Createavariabledvforeachvertexvandth

7、elinearconstraintsds=0anddv≤du+`(u,v),whenever(u,v)isanedge.•Minimizedt.8MinimumcostflowInput:•agraphG,•acapacityfunctioncontheedges,•acostfunctionaontheedges,•asourcesandasinkt.PThecostofaflowisa(e)f(e

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

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

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