分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

网络流(Flow Networks)

发布时间:2023-09-06 01:29责任编辑:郭大石关键词:暂无标签

一.基本术语 Basic Terminology

  A source node in a directed graph is a node with no incoming edges. 入度为0

  A sink node in a directed graph is a node with no outgoing edges. 出度为0

  A flow network is a directed graph (V,E,c,s,t) where (V,E,c) forms a weighted graph with positive edge weights, s ∈ V is a source node and t ∈ V is a sink node.

二.最大流算法的理解

  其实感觉这个跟数学建模里面的单目标优化问题类似,就是在源点一定的情况下,尽可能多的将物品传到终点,限制条件是每条路径上的最大值。

下面图是网上随便找的。

                                       

Flow Graph:实际上运输上传送的值。

Residual Graph:经过变化一次次传输,现在还剩余的图,即SG-FG,感觉作用就是是因为SG画的太乱了,分一个好判断一点。

具体的过程:

  1)在SG中找到一条S->T的路径,找到最小的限制,即流上的最小值(bottom neck)。

  2)在RG图中减去这次运输的值,得到RG;在FG中加上相应的值

  3)LOOP 1)2)直到无路可走。

这样会有错误,因为最大流存在先后顺序?先驱顺序??(待确定名称)这样得不到最大流。

引入返回路径

每当我们选择了一个运输路径后,都要在RG中新画一个反向的路径,即这条路径传递了3,反向传递3。

为什么这么做的完整解释,后补。

三.Cuts

  A cut in a graph is a set C of edges such that removing them would disconnect the graph into left(C) (nodes reachable from s) and the right part right(C) (nodes that may reach t).

  左边的不包括右到左方向的箭头

   The capacity of a cut C in a flow network is the sum of the capacity of edges that goes from left to right

  

  A minimal cut is a cut with minimal capacity.

网络流(Flow Networks)

原文地址:http://www.cnblogs.com/hahaccy/p/8001676.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved