欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > PPT文档下载
     

    第08章网络流和匹配NetworkFlows.ppt

    • 资源ID:2576586       资源大小:237.01KB        全文页数:14页
    • 资源格式: PPT        下载积分:4
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要4
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    第08章网络流和匹配NetworkFlows.ppt

    4/11/2019 10:12 AM,Network Flow,1,Chapter 8: Network Flow,w,s,v,u,t,z,3/3,1/9,1/1,3/3,4/7,4/6,3/5,1/1,3/5,2/2,c,4/11/2019 10:12 AM,Network Flow,2,Outline and Reading,Flow Networks Flow (§8.1.1) Cut (§8.1.2) Maximum flow Augmenting Path (§8.2.1) Maximum Flow and Minimum Cut (§8.2.1) Ford-Fulkersons Algorithm (§8.2.2-8.2.3) Sections §8.2.4-8.5 on Matching and Minimum Flow are optional.,4/11/2019 10:12 AM,Network Flow,3,Flow Network,A flow network (or just network) N consists of A weighted digraph G with nonnegative integer edge weights, where the weight of an edge e is called the capacity c(e) of e Two distinguished vertices, s and t of G, called the source and sink, respectively, such that s has no incoming edges and t has no outgoing edges. Example:,w,s,v,u,t,z,3,9,1,3,7,6,5,1,5,2,4/11/2019 10:12 AM,Network Flow,4,Flow,A flow f for a network N is is an assignment of an integer value f(e) to each edge e that satisfies the following properties: Capacity Rule: For each edge e, 0 f (e) c(e) Conservation Rule: For each vertex v s,t where E-(v) and E+(v) are the incoming and outgoing edges of v, resp. The value of a flow f , denoted |f|, is the total flow from the source, which is the same as the total flow into the sink Example:,w,s,v,u,t,z,3/3,2/9,1/1,1/3,3/7,2/6,4/5,1/1,3/5,2/2,4/11/2019 10:12 AM,Network Flow,5,Maximum Flow,A flow for a network N is said to be maximum if its value is the largest of all flows for N The maximum flow problem consists of finding a maximum flow for a given network N Applications Hydraulic systems Electrical circuits Traffic movements Freight transportation,w,s,v,u,t,z,3/3,2/9,1/1,1/3,3/7,2/6,4/5,1/1,3/5,2/2,w,s,v,u,t,z,3/3,2/9,1/1,3/3,3/7,4/6,4/5,1/1,3/5,2/2,Flow of value 8 = 2 + 3 + 3 = 1 + 3 + 4,Maximum flow of value 10 = 4 + 3 + 3 = 3 + 3 + 4,4/11/2019 10:12 AM,Network Flow,6,Cut,A cut of a network N with source s and sink t is a partition c = (Vs,Vt) of the vertices of N such that s Vs and t Vt Forward edge of cut c: origin in Vs and destination in Vt Backward edge of cut c: origin in Vt and destination in Vs Flow f(c) across a cut c: total flow of forward edges minus total flow of backward edges Capacity c(c) of a cut c: total capacity of forward edges Example: c(c) = 24 f(c) = 8,w,s,v,u,t,z,3,9,1,3,7,6,5,1,5,2,c,w,s,v,u,t,z,3/3,2/9,1/1,1/3,3/7,2/6,4/5,1/1,3/5,2/2,c,4/11/2019 10:12 AM,Network Flow,7,Flow and Cut,Lemma: The flow f(c) across any cut c is equal to the flow value |f| Lemma: The flow f(c) across a cut c is less than or equal to the capacity c(c) of the cut Theorem: The value of any flow is less than or equal to the capacity of any cut, i.e., for any flow f and any cut c, we have |f| c(c),w,s,v,u,t,z,3/3,2/9,1/1,1/3,3/7,2/6,4/5,1/1,3/5,2/2,c1,c2,c(c1) = 12 = 6 + 3 + 1 + 2 c(c2) = 21 = 3 + 7 + 9 + 2 |f| = 8,4/11/2019 10:12 AM,Network Flow,8,Augmenting Path,Consider a flow f for a network N Let e be an edge from u to v: Residual capacity of e from u to v: Df(u, v) = c(e) - f (e) Residual capacity of e from v to u: Df(v, u) = f (e) Let p be a path from s to t The residual capacity Df(p) of p is the smallest of the residual capacities of the edges of p in the direction from s to t A path p from s to t is an augmenting path if Df(p) 0,w,s,v,u,t,z,3/3,2/9,1/1,1/3,2/7,2/6,4/5,0/1,2/5,2/2,p,Df(s,u) = 3 Df(u,w) = 1 Df(w,v) = 1 Df(v,t) = 2 Df(p) = 1 |f| = 7,4/11/2019 10:12 AM,Network Flow,9,Flow Augmentation,Lemma: Let p be an augmenting path for flow f in network N. There exists a flow f for N of value | f | = |f | + Df(p) Proof: We compute flow f by modifying the flow on the edges of p Forward edge: f (e) = f(e) + Df(p) Backward edge: f (e) = f(e) - Df(p),Df(p) = 1,| f | = 7,| f | = 8,4/11/2019 10:12 AM,Network Flow,10,Ford-Fulkersons Algorithm,Initially, f(e) = 0 for each edge e Repeatedly Search for an augmenting path p Augment by Df(p) the flow along the edges of p A specialization of DFS (or BFS) searches for an augmenting path An edge e is traversed from u to v provided Df(u, v) 0,Algorithm FordFulkersonMaxFlow(N) for all e G.edges() setFlow(e, 0) while G has an augmenting path p compute residual capacity D of p D for all edges e p compute residual capacity d of e if e is a forward edge of p d getCapacity(e) - getFlow(e) else e is a backward edge d getFlow(e) if d D D d augment flow along p for all edges e p if e is a forward edge of p setFlow(e, getFlow(e) + D) else e is a backward edge setFlow(e, getFlow(e) - D),4/11/2019 10:12 AM,Network Flow,11,Max-Flow and Min-Cut,Termination of Ford-Fulkersons algorithm There is no augmenting path from s to t with respect to the current flow f Define Vs set of vertices reachable from s by augmenting paths Vt set of remaining vertices Cut c = (Vs,Vt) has capacity c(c) = |f| Forward edge: f(e) = c(e) Backward edge: f(e) = 0 Thus, flow f has maximum value and cut c has minimum capacity,w,s,v,u,t,z,3/3,1/9,1/1,3/3,4/7,4/6,3/5,1/1,3/5,2/2,c,Theorem: The value of a maximum flow is equal to the capacity of a minimum cut,c(c) = | f | = 10,4/11/2019 10:12 AM,Network Flow,12,Example (1),w,s,v,u,t,z,0/3,0/9,0/1,0/3,1/7,0/6,0/5,1/1,1/5,0/2,w,s,v,u,t,z,1/3,0/9,0/1,0/3,1/7,0/6,1/5,0/1,1/5,1/2,w,s,v,u,t,z,1/3,0/9,1/1,0/3,2/7,1/6,1/5,0/1,1/5,1/2,w,s,v,u,t,z,2/3,0/9,0/1,1/3,2/7,1/6,1/5,0/1,1/5,1/2,4/11/2019 10:12 AM,Network Flow,13,Example (2),w,s,v,u,t,z,2/3,0/9,0/1,3/3,2/7,3/6,1/5,0/1,1/5,1/2,w,s,v,u,t,z,3/3,1/9,0/1,3/3,2/7,3/6,2/5,0/1,1/5,1/2,w,s,v,u,t,z,3/3,1/9,1/1,3/3,3/7,4/6,2/5,0/1,1/5,1/2,w,s,v,u,t,z,3/3,1/9,1/1,3/3,4/7,4/6,3/5,1/1,3/5,2/2,two steps,4/11/2019 10:12 AM,Network Flow,14,Analysis,In the worst case, Ford-Fulkersons algorithm performs |f*| flow augmentations, where f* is a maximum flow Example The augmenting paths found alternate between p1 and p2 The algorithm performs 100 augmentations Finding an augmenting path and augmenting the flow takes O(n + m) time The running time of Ford-Fulkersons algorithm is O(|f*|(n + m),t,s,v,u,1/1,1/50,0/50,1/50,0/50,t,s,v,u,0/1,1/50,1/50,1/50,1/50,p1,p2,

    注意事项

    本文(第08章网络流和匹配NetworkFlows.ppt)为本站会员(本田雅阁)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开