清华大学算法分析与设计 第09讲动态规划方法.docx
《清华大学算法分析与设计 第09讲动态规划方法.docx》由会员分享,可在线阅读,更多相关《清华大学算法分析与设计 第09讲动态规划方法.docx(29页珍藏版)》请在冰豆网上搜索。
![清华大学算法分析与设计 第09讲动态规划方法.docx](https://file1.bdocx.com/fileroot1/2022-12/16/bf5feec7-fa3f-4d15-9cfd-ee11213ccd75/bf5feec7-fa3f-4d15-9cfd-ee11213ccd751.gif)
清华大学算法分析与设计第09讲动态规划方法
Cut
•Acut(S,T)dividestheflowG=(E,V)intotwopartsSandT,whereS∩T=φ,andS∪T=E,s∈S,t∈T.
•Netflowacrossacut(S,T)isdefinedtobef(S,T),thecapacityof(S,T)isc(S,T)
•c(S,T)=∑u∈S,v∈Tc(u,v)
•f(S,T)=∑u∈S,v∈Tf(u,v)
清华大学软件学院宋斌恒23
TheBasicFord-Fulkersonalgorithm
•Ford-Fulkerson(G,s,t)
1.Foreachedge(u,v)inE[G]
1.f[u,v]⓪0
2.f[v,u]⓪0
2.WhilethereexistsapathpfromstotintheresidualnetworkGf
1.cf(p)⓪min{cf(u,v):
(u,v)inp}
2.Foreachedge(u,v)inp1.f[u,v]⓪f[u,v]+cf(p)2.f[v,u]⓪-f[u,v]
清华大学软件学院宋斌恒29
Proofofstep1(Lemma26.8)
•Supposethatthereexistsaflowf,anextaugmentedflowf’andavertexv’inV-{s,t}notsatisfiesthepropertymentionedinstep1,
thatisδf(s,v’)≤δf’(s,v’)doesnothold,thenwechoosevbeoneofsuchelementswhichtakestheminimumdistancefromsinGf’itmeans
•【假设不满足递增规律】
•【蓝字什么意思?
为什么能这样假设?
】
清华大学软件学院宋斌恒44
◻δf(s,v)>δf’(s,v)
–Letp=s--->u⓪vbeashortestpathfromstov,sothat(u,v)inEf’and
–δf’(s,u)≤δf’(s,v)-1and
◻δf’(s,u)≥δf(s,u),
•Weclaim(u,v)notinEf.
–Ifitis,then
–δf(s,v)≤δf(s,u)+1(triangleinequality)
–≤δf’(s,u)+1(seeabove)
–≤δf’(s,v)
–Acontradiction!
【如下所示】
•Howcanwehave(u,v)notinEfbutinEf’?
清华大学软件学院宋斌恒45