网络流






在圖論中,網絡流英语:Network flow)是指在一個每條邊都有容量(Capacity)的有向圖分配,使一條邊的流量不會超過它的容量。通常在運籌學中,有向图称为网络。顶点称为节点(Node)而边称为(Arc)。一道流必須符合一個結點的進出的流量相同的限制,除非這是一個源點(Source)──有較多向外的流,或是一個匯點(Sink)──有較多向內的流。一個網絡可以用來模擬道路系統的交通量、管中的液體、電路中的電流或類似一些東西在一個結點的網絡中遊動的任何事物。




目录





  • 1 定义

    • 1.1 网络流图


    • 1.2 净流


    • 1.3


    • 1.4 网络流


    • 1.5 可行流


    • 1.6 伪流


    • 1.7 剩馀容量


    • 1.8 残量网络


    • 1.9 最大流


    • 1.10 增广路



  • 2 性质

    • 2.1 容量限制


    • 2.2 反对称性


    • 2.3 流守恒



  • 3 例子


  • 4 應用

    • 4.1 普遍化及專門化



  • 5 参见


  • 6 延伸阅读


  • 7 外部链接


  • 8 参考资料




定义



网络流图


如果带权有限的有向图G=(V,E)displaystyle G=(V,,E)displaystyle G=(V,,E)满足如下条件,则称之为网络流图(或容量网络):


  • 有且仅有一个结点 s∈Vdisplaystyle sin Vdisplaystyle sin V 入度为0.称为源点

  • 有且仅有一个结点 t∈Vdisplaystyle tin Vdisplaystyle tin V 出度为0.称为汇点


  • ∀(u,v)∈E∃c(u,v)∈R+displaystyle forall (u,v)in Equad exists c(u,v)in R^+displaystyle forall (u,v)in Equad exists c(u,v)in R^+, 称为这条弧的容量。特别地,如果 (u,v)∉Edisplaystyle (u,v)not in Edisplaystyle (u,v)not in E,可以假定 c(u,v)=0displaystyle c(u,v)=0displaystyle c(u,v)=0.


净流


通过容量网络中的一条弧 (u,v)displaystyle (u,v)(u,v)流量(或净流)记为 f(u,v)displaystyle f(u,v)f(u,v).





是网络流图中的一条带权边 (u,v)∈Edisplaystyle (u,v)in Edisplaystyle (u,v)in E.


特殊的弧有:



  • 零流弧满足 f(u,v)=0displaystyle f(u,v)=0displaystyle f(u,v)=0.


  • 非零流弧满足 f(u,v)≠0displaystyle f(u,v)not =0displaystyle f(u,v)not =0.


  • 饱和弧满足 f(u,v)=c(u,v)displaystyle f(u,v)=c(u,v)displaystyle f(u,v)=c(u,v).


  • 非饱和弧满足 f(u,v)<c(u,v)displaystyle f(u,v)<c(u,v)displaystyle f(u,v)<c(u,v).


网络流


一个流量的集合 F=f(u,v)displaystyle F=f(u,v)displaystyle F=f(u,v) 包含所有弧上的流,则称为这个容量网络的一个网络流



可行流


在容量网络中满足以下条件的网络流称为可行流:



  • 容量限制(Capacity Constraints): f(u,v)≤c(u,v)displaystyle f(u,v)leq c(u,v)displaystyle f(u,v)leq c(u,v).


  • 流守恒(Flow Conservation): 除非 u=sdisplaystyle u=su = su=tdisplaystyle u=tu = t,否则 ∑w∈Vf(u,w)=0displaystyle sum _win Vf(u,w)=0displaystyle sum _win Vf(u,w)=0 一结点的净流是零,除了“制造”流的源点和“消耗”流的汇点。


伪流


伪流是一种与可行流相对的概念,如果一个网络流只满足容量限制条件,不满足流守恒条件,那么这个网络流就是一个伪流。



剩馀容量


边的剩馀容量(Residual Capacity)简称为残量,是 cf(u,v)=c(u,v)−f(u,v)displaystyle c_f(u,v)=c(u,v)-f(u,v)displaystyle c_f(u,v)=c(u,v)-f(u,v).



残量网络


由所有边均为其残量的 Gf(V,Ef)displaystyle G_f(V,E_f)displaystyle G_f(V,E_f) 称为残量网络(Residual Network)剩馀网络.它显示可用的容量的多少。留意就算在原网络中由 udisplaystyle uuvdisplaystyle vv 没有边,在剩馀网络仍可能有由 udisplaystyle uuvdisplaystyle vv 的边。因为相反方向的流抵消,减少由 vdisplaystyle vvudisplaystyle uu 的流等于增加由 udisplaystyle uuvdisplaystyle vv 的流。



最大流


对于一个网络流图,它最大的可行流即为它的最大流



增广路


增广路(Augmenting Path)是一条路径 (u1,u2,⋯,uk)displaystyle (u_1,u_2,cdots ,u_k)displaystyle (u_1,u_2,cdots ,u_k),而 u1=sdisplaystyle u_1=su_1 = suk=tdisplaystyle u_k=tu_k = tcf(ui,ui+1)>0displaystyle c_f(u_i,u_i+1)>0c_f(u_i, u_i+1) > 0,这表示沿这条路径传送更多流是可能的。当且仅当剩余网络 Gfdisplaystyle G_fdisplaystyle G_f 没有增广路时处于最大流。



性质


在任意时刻,Gdisplaystyle GG 的网络流都满足如下性质。



容量限制


通过一条弧的流量不能超过这条弧的容量上限。


∀u,v∈V,f(u,v)≤c(u,v)displaystyle forall u,vin V,;f(u,v)leq c(u,v)displaystyle forall u,vin V,;f(u,v)leq c(u,v)



反对称性


从一个结点 sdisplaystyle ss 到另一个结点 tdisplaystyle tt 的净流量一定是从 tdisplaystyle ttsdisplaystyle ss 净流量的相反数。


∀u,v∈V,f(u,v)=−f(v,u)displaystyle forall u,vin V,;f(u,v)=-f(v,u)displaystyle forall u,vin V,;f(u,v)=-f(v,u)



流守恒


对于 Gdisplaystyle GG 中任意一个结点 udisplaystyle uu,如果它既不是源点也不是汇点,那么它到相邻结点的所有流量之和为0.


∀u∈V−s,t,∑w∈Vf(u,w)=0displaystyle forall uin V-s,t,;sum _win Vf(u,w),=0displaystyle forall uin V-s,t,;sum _win Vf(u,w),=0





例子



一個顯示了流及容量的流網絡。


在右邊可以看到一個有以sdisplaystyle ss標示的源點、以tdisplaystyle tt標示的匯點及4個額外結點的流網絡。流及容量以f/cdisplaystyle f/cf/c顯示。注意網絡怎樣保證斜對稱、容量限制及流守恆。由sdisplaystyle sstdisplaystyle tt的總流量為5,由此可簡單地觀察到源於sdisplaystyle ss的所有向外流是5,也就是匯於tdisplaystyle tt的向內流。我們知道在其它結點中沒有任何流出現或消失。



上面的流網絡的剩餘網絡,顯示了剩餘容量。


在下面你可以看到對既定的流的剩餘網絡。注意某些邊的剩餘容量是正數而原來的容量是零,如邊(d,c)displaystyle (d,c)(d, c)。這道流不是一道最大流。沿路徑(s,a,c,t)displaystyle (s,a,c,t)(s, a, c, t)(s,a,b,d,t)displaystyle (s,a,b,d,t)(s, a, b, d, t)(s,a,b,d,c,t)displaystyle (s,a,b,d,c,t)(s, a, b, d, c, t)還有可用的容量,也就是擴張路徑。第一條路徑的剩餘容量是min(c(s,a)−f(s,a),c(a,c)−f(a,c),c(c,t)−f(c,t))=min(5−3,3−2,2−1)=min(2,1,1)=1displaystyle min(c(s,a)-f(s,a),c(a,c)-f(a,c),c(c,t)-f(c,t))=min(5-3,3-2,2-1)=min(2,1,1)=1min(c(s, a) - f(s, a), c(a, c) - f(a, c), c(c, t) - f(c, t)) = min(5 - 3, 3 - 2, 2 - 1) = min(2, 1, 1) = 1。注意擴張路徑(s,a,b,d,c,t)displaystyle (s,a,b,d,c,t)(s, a, b, d, c, t)在原來的網絡中並不存在,但你可以沿它傳送流,因此仍是一道正當的流。


假如這是一個真實的網絡,由adisplaystyle aabdisplaystyle bb的2單位的流及由bdisplaystyle bbadisplaystyle aa的1單位的流事實上可能存在,但我們只維持流。



應用


將一連串的水管繪畫成一個網絡。每條水管有一特定的闊度,因此只可以保持一特定的水流量。當任何水管匯合,流入匯流點的總水量必須等於流出的水量,否則我們會很快地缺水,或者我們會團積水。我們有一個作為源點的入水口,和一個作為匯點的出水口。一道流便是一條由源點到匯點而使從出水口流出的總水量一致的可能路徑。直觀地,一個網絡的總流量是水從出口流出的速率。


流可以适用于交通網絡上的人或材料,或配电系统上的電力。對於任何這樣的實物網絡,進入任何中途結點的流需要等於離開那个結點的流。这个守恒限制相当于基爾霍夫電流定律。


在生態學中也可找到网络流的應用:當考慮在食物網中不同組織之間養料及能量的流,网络流便自然地產生。與這些網絡有聯繫的數學問題和那些液體流或交通流網絡中所產生的難題有很大分別。由Robert Ulanowicz及其他人發展的生態系統網絡分析領域包含使用資訊理論及熱力學的概念去研究這些網絡隨時間的演變。



普遍化及專門化


利用網絡流去找出最大流是最簡單及最普通的問題,它提供了在一指定的圖中由源點到匯點的最大可能總流量。還有很多其它問題可以利用最大流演算法去解決,假設它們可以適當地塑造成流網絡的模樣,例如二部圖匹配(Bipartite Matching)、任務分配問題(Assignment Problem)和運輸問題(Transportation Problem)。


在多物網絡流問題(Multi-commodity Flow Problem)中,可以有多個源點和匯點,和各種各樣的由指定源點傳送到指定匯點的「物品(Commodities)」。例如這可能是不同的工廠生產的各種各樣的貨物經由「同一」運輸網絡運送到不同的消費者手上。


在最小费用最大流问题(Minimum Cost Flow Problem)中,每條邊u,vdisplaystyle u,vu,v都有特定費用k(u,v)displaystyle k(u,v)k(u,v)。沿這條邊傳送f(u,v)displaystyle f(u,v)f(u,v)的費用是f(u,v)⋅k(u,v)displaystyle f(u,v)cdot k(u,v)f(u,v) cdot k(u,v)。目標是要用最低的成本由源點傳送一特定數量的流到匯點。


在環流問題(Circulation Problem)中,每條邊除了有上限c(u,v)displaystyle c(u,v)c(u,v)外,還有下限l(u,v)displaystyle l(u,v)l(u,v)。每條邊亦有一個費用。很多時,流守恆適用於環流問題中所有結點,由匯點到源點亦有一條連結。這樣便能利用l(t,s)displaystyle l(t,s)l(t,s)c(t,s)displaystyle c(t,s)c(t,s)支配總流量。這問題因流環繞網絡流動而得名。


有增益網絡普遍化網絡中,每條邊都有增益,一個實數(非零)使如果這條邊有一增益g而有一流量x的流在尾部流入,便有一流量gx的流從頭部流出。



参见


  • 布雷斯悖论

  • 中心性英语Centrality

  • 构形理论英语Constructal theory

  • Ford–Fulkerson算法

  • Dinic算法

  • 流量 (计算机联网)英语Flow (computer networking)

  • 有根图英语Rooted graph

  • 最大流最小割定理

  • 定向拟阵英语Oriented matroid

  • 最短路问题


延伸阅读



  • George T. Heineman, Gary Pollice, and Stanley Selkow. Chapter 8:Network Flow Algorithms. Algorithms in a Nutshell. Oreilly Media. 2008: 226–250. ISBN 978-0-596-51624-6. 


  • Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin. Network Flows: Theory, Algorithms and Applications. Prentice Hall. 1993. ISBN 0-13-617549-X. 


  • Bollobás, Béla. Graph Theory: An Introductory Course. Heidelberg: Springer-Verlag. 1979. ISBN 3-540-90399-2. 


  • Chartrand, Gary & Oellermann, Ortrud R. Applied and Algorithmic Graph Theory. New York: McGraw-Hill. 1993. ISBN 0-07-557101-3. 


  • Even, Shimon. Graph Algorithms. Rockville, Maryland: Computer Science Press. 1979. ISBN 0-914894-21-8. 


  • Gibbons, Alan. Algorithmic Graph Theory. Cambridge: Cambridge University Press. 1985. ISBN 0-521-28881-9. 


  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 26. Introduction to Algorithms 2nd. MIT Press and McGraw-Hill. 2001: 696–697 [1990]. ISBN 0-262-03293-7. 


外部链接


  • Maximum Flow Problem

  • Real graph instances

  • Lemon C++ library with several maximum flow and minimum cost circulation algorithms


  • QuickGraph, graph data structures and algorithms for .Net


参考资料










Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党