Notions of Flow Networks and Flows
这篇随笔是对算法导论(Introduction to Algorithms, 3rd. Ed.)第26章 Maximum Flow的摘录。
------------------------------------------------------------------------------------------------------
1. A flow network G = (V, E ) is a directed graph in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0.
2. We further require that if E contains an edge (u, v) then there is no edge (v, u) in the reverse direction.
3. We distinguish two vertices in a flow network: a source s and a sink t.
4. If (u, v) ∉ E, then for convenience we define c (u, v) = 0, and we disallow self-loops, hence, capacity can be viewed as a function c: V × V → R.
5. A flow in G is a real-valued function f : V×V → R that satisfies the following two properties:
#Capacity constraint: For all u, v ∈ V, we require 0 ≤ f (u, v) ≤ c (u, v)
#Flow conservation: For all u ∈ V - {s, t}, we require
∑ f (v, u) : v ∈ V = ∑ f (u, v) : v ∈ V
6. The value | f | of a flow f is defined as | f | = ∑ f (s, v) - ∑ f (v, s).
7. In the maximum-flow problem, we are given a flow network G with source s and sink t, and we wish to find a flow of maximum value.
8. A cut (S, T ) of flow network G = (V, E ) is a partion of V into S and T = V - S such that s ∈ S and t ∈ T.
9. If f is a flow, then the net flow f (S, T ) across the cut (S, T ) is defined to be
f (S, T ) = ∑u∈S ∑v∈T f (u, v) - ∑u∈S ∑v∈T f (v, u).
10. The capacity of the cut (S, T) is defined to be
c (S, T ) = ∑u∈S ∑v∈T c (u, v).
11. A minimum cut of a network is a cut whose capacity is minimum over all cuts of the network.
12. Given a flow network G = (V, E ) with source s and sink t. Let f be a flow in G, and consider a pair of vertices u, v ∈ V. We difine the residual capacity (induced by f ) cf (u, v) by
cf (u, v) =
c (u, v) - f (u, v), if (u, v) ∈ E
f (u, v), if (v, u) ∈ E
0, otherwise
13. Given a flow network G = (V, E ) and a flow f, the residual network of G induced by f is Gf = (V, Ef ) where
Ef = {(u, v) ∈ V × V : cf ( u, v) > 0}
14. If f is a flow in G and f ' is a flow in the corresponding residual network Gf, we define f ↑ f ', the augmentation of flow f by f ', to be a function from V × V to R, defined by
(f ↑ f ' ) (u, v) =
f (u, v) + f ' (u, v) - f ' (v, u) if (u, v) ∈ E ,
0 otherwise .
15.(Lemma 26.1, pp. 717)
Let G = (V, E) be a flow network with source s and sink t, and let f be a flow in G . Let Gf be the residual network of G induced by f , and let f ' be a flow in Gf . Then, the function f ↑ f ' defined above is a flow in G with value | f ↑ f ' | = | f | + | f | + | f ' |.
Proof We first verify that f ↑ f ' obeys the capacity constraint for each edge in E and flow conservation at each vertex in V - {s , t}.
For the capacity constraint, first observe that if (u, v) ∈ E, then cf (v, u) = f (u, v). Therefore, we have f ' (v, u) ≤ cf (v, u) = f (u, v), and hence
( f ↑ f ' ) (u, v ) = f (u, v) + f ' (u, v) - f ' (v, u)
≥ f (u, v) + f ' (u, v) - f (u, v)
= f ' (u, v)
≥ 0 .
In addition,
(f ↑ f ') (u, v)
= f (u, v) + f ' (u, v) - f ' (v, u)
≤ f (u, v) + f ' (u, v)
≤ f (u, v) + cf (u, v)
= f (u, v) + c (u, v) - f (u, v)
= c (u, v)
For flow conservation, because both f and f ' obey flow conservation, we have that for all u ∈ V - {s, t},
∑v∈V ( f ↑ f ' ) (u, v) = ∑v∈V ( f (u, v) + f ' (u, v) - f ' (v, u))
= ∑v∈V f (u, v) + ∑v∈V f ' (u, v) - ∑v∈V f ' (v, u)
= ∑v∈V f (v, u) + ∑v∈V f ' (v, u) - ∑v∈V f ' (u, v)
= ∑v∈V ( f (v, u) + f ' (v, u) - f ' (u, v) )
= ∑v∈V ( f ↑ f ' ) (v, u) ,
where the third line follows from the second line by flow conservation.
Finally, = { v : (s, v) ∈ E} to be the set of vertices with edges from s, and V2 = {v : (v, s) ∈ E} to be the set of vertices to s. We have V1 ∪ V2 ⊆ V and, because we disallow antiparallel edges, V1 ∩ V2 = ∅. We now compute
| f ↑ f ' | = ∑v∈V ( f ↑ f ' ) (s, v) - ∑v∈V ( f ↑ f ' ) (v, s)
= ∑v∈V1 ( f ↑ f ' ) (s, v) - ∑v∈V2 ( f ↑ f ' ) (v, s) ,
where the second line follows because ( f ↑ f ' ) (w, x) is 0 if (w, x) ∉ E. We now apply the definition of f ↑ f ' to the equation above, and then reorder and group terms to abtain
| f ↑ f ' |
= ∑v∈V1 ( f (s, v) + f ' (s, v) - f ' (v, s)) - ∑v∈V2 ( f (v, s) + f ' (v, s) - f ' (s, v))
= ∑v∈V1 f (s, v) + ∑v∈V1 f ' (s, v) - ∑v∈V1 f ' (v, s)
- ∑v∈V2 f (v, s) - ∑v∈V2 f ' (v, s) + ∑v∈V2 f ' (s, v)
= ∑v∈V1 f (s, v) - ∑v∈V2 f (v, s)
+ ∑v∈V1 f ' (s, v) + ∑v∈V2 f ' (s, v) - ∑v∈V1 f ' (v, s) - ∑v∈V2 f ' (v, s)
= ∑v∈V1 f (s, v) - ∑v∈V2 f (v, s) + ∑v∈V1∪V2 f ' (s, v) - ∑v∈V1∪V2 f ' (v, s) .
= ∑v∈V f (s, v) - ∑v∈V f (v, s) + ∑v∈V f ' (s, v) - ∑v∈V f ' (v, s)
= | f | + | f ' | .
Notions of Flow Networks and Flows的更多相关文章
- Openvswitch手册(9): Flow
这一节我们将flow table flow table主要由ovs-ofctl命令操作 ovs-ofctl可以走和openflow controller一样的协议: ssl:ip[:port]: Th ...
- Spring Web Flow 入门demo(三)嵌套流程与业务结合 附源代码
上篇博客我们说Spring web Flow与业务结合的方式主要有三种,以下我们主要介绍一下第三种的应用方式 3,运行到<action-state> 元素 SpringWeb Flow 中 ...
- 网络流 HDU 3549 Flow Problem
网络流 HDU 3549 Flow Problem 题目:pid=3549">http://acm.hdu.edu.cn/showproblem.php?pid=3549 用增广路算法 ...
- flow
Flow vs Stream https://wikidiff.com/flow/stream As nouns the difference between flow and stream is t ...
- [另开新坑] 算导v3 #26 最大流 翻译
26 最大流 就像我们可以对一个路网构建一个有向图求最短路一样,我们也可以将一个有向图看成是一个"流量网络(flow network)",用它来回答关于流的问题. Just as ...
- 基于Open vSwitch的OpenFlow实践
Open vSwitch(下面简称为 OVS)是由 Nicira Networks 主导的,运行在虚拟化平台(例如 KVM,Xen)上的虚拟交换机.在虚拟化平台上,OVS 可以为动态变化的端点提供 2 ...
- Open vSwitch FAQ (一)
Basic Configuration Q: How do I configure a port as an access port? A: Add "tag=VLAN" to y ...
- SDN学习
SDN & OpenFlow & Open vSwitch SDN SDN(软件定义网络)是一个概念.是一个思想.一个框架.是一种网络设计理念,它有三个特征 控制平面与转发平面分离 控 ...
- openvswith Frequently Asked Questions
Open vSwitch <http://openvswitch.org> 参考地址:http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=ope ...
随机推荐
- 谈谈redis主从复制的重点
Redis主从复制的配置十分简单,它可以使从服务器是主服务器的完全拷贝.下面是关于Redis主从复制的几点重要内容: Redis使用异步复制.但从Redis 2.8开始,从服务器会周期性的应答从复制流 ...
- css3d
立方体:http://sandbox.runjs.cn/show/1h6zvghj 原理分析:(左负右正) x:与屏幕水平:(在屏幕上) y:与屏幕水平方向垂直(在屏幕上) z:垂直于屏幕(在屏幕外) ...
- Linux第二次学习笔记
#Linux第二次实验(第三周) 学习目标 熟悉Linux系统下的开发环境 熟悉vi的基本操作 熟悉gcc编译器的基本原理 熟练使用gcc编译器的常用选项 熟练使用gdb调试技术 熟悉makefile ...
- log4j使用教程
日志是应用软件中不可缺少的部分,Apache的开源项目 Log4j 是一个功能强大的日志组件,提供方便的日志记录. 在官网:https://logging.apache.org/ ,点击 进入后,可以 ...
- textfield控制光标开始位置
// UIView *paddingView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.wi ...
- Jquery操作select,radio,input,p之类
select的操作 变化后触发操作 $("#txtaddprojecturl").change(function(){ $("#addprojectname") ...
- python实现简易数据库之一——存储和索引建立
最近没事做了一个数据库project,要求实现一个简单的数据库,能满足几个特定的查询,这里主要介绍一下我们的实现过程,代码放在过ithub,可参看这里.都说python的运行速度很慢,但因为时间比较急 ...
- Slider 滚动条 Pagination分页插件 JS Ajax 数据范围筛选 加载 翻页 笔记
入职以后的第二个任务 根据用户所选的价格范围 筛选数据 修复BUG - 筛选数据后 总数没有更新.列表显示错误.翻页加载错误 用到的一些知识点 jquery插件系列之 - Slider滑块 max ...
- Thrift搭建分布式微服务(三)
第一篇 <连接配置> 第二篇 <连接池> 第三篇 标准通信 一.TCP的连接是无状态的,怎样知道我的请求被服务端接受并且正确执行了呢? 我的解决方案是使用自己定义的标准输入输出 ...
- Linux 常用工具贴
1. nmon for Linux 用于监控Linux CPU.IO.网络等,可以生产excel格式的报表 http://nmon.sourceforge.net/pmwiki.php?n=Sit ...