Matlab中graphmaxflow函数的用法

本文详细介绍了Matlab中graphmaxflow函数的使用,包括计算有向图的最大流,如何处理无向图,函数语法,参数说明,以及算法复杂度。示例展示了创建有向图并计算最大流的过程,同时探讨了最小割问题的解决方案和不同算法的选择,如Edmonds和Goldberg算法。
摘要由CSDN通过智能技术生成

Matlab中graphmaxflow函数的用法

Purposes用途

Calculate maximum flow in directed graph
用于计算有向图中的最大流

如果大家遇到求无向图中最大流的时候可以先将有向图转换成无向图再进行求解。

Syntax 用法

[MaxFlow, FlowMatrix, Cut] = graphmaxflow(G, SNode, TNode)

[...] = graphmaxflow(G, SNode, TNode, ...'Capacity', CapacityValue, ...)

[...] = graphmaxflow(G, SNode, TNode, ...'Method', MethodValue, ...)

Arguments

GN-by-N sparse matrix that represents a directed graph. Nonzeroentries in matrix G represent the capacities ofthe edges.
SNode Node in G.
TNode Node in G.
Capacity ValueColumn vector that specifies custom capacities for the edgesin matrix G. It must have one entry forevery nonzero value (edge) in matrix G.The order of the custom capacities in the vector must match the orderof the nonzero values in matrix G whenit is traversed column-wise. By default, graphmaxflow getscapacity information from the nonzero entries in matrix G.
MethodValue String that specifies the algorithm used to find the minimalspanning tree (MST). Choices are:
‘Edmonds’ — Uses the Edmondsand Karp algorithm, the implementation of which is based on a variationcalled the labeling algorith
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值