| 查看: 1950 | 回复: 1 | |||
[交流]
graphmaxflow用法
|
|
下程序中为什么创建的是一个6节点和8个边有向图,而不是8个节点11个边? 另外,graphmaxflow这个函数是matlab2012版才有的吗,我的2010为啥help不到用法啊。。。。MATLAB 最大流最小割 利用graphmaxflow可以求最大流最小割,具体参考MATLAB帮助 S=[1 1 1 2 2 3 3 4 5 6 7]; %起始节点向量 E=[2 3 4 5 6 6 7 7 8 8 8]; %终止节点向量 W=[5 4 3 5 3 3 2 2 4 3 5]; %边权值向量 cm = sparse(S,E,W,8,8); % Create a directed graph with six nodes and eight edges. [M,F,K] = graphmaxflow(cm,1,8) %Calculate the maximum flow in the graph from node 1 to node 8. h = view(biograph(cm,[],'ShowWeights','on'));% View the graph with the original capacities. set(h.Nodes(K(1, ),'Color',[1 0 0]); %Show one solution to the minimum cut problem in the original graph.view(biograph(F,[],'ShowWeights','on')); % View the graph with the calculated maximum flows. % Notice that in the three edges that connect the source nodes (red) to the % destination nodes (yellow), the original capacities and the calculated maximum flows are the same. |
» 猜你喜欢
情人节自我反思:在爱情中有过遗憾吗?
已经有6人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有3人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有3人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有3人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有3人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有3人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有4人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有4人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有4人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有4人回复
2楼2013-03-30 20:55:37













),'Color',[1 0 0]); %Show one solution to the minimum cut problem in the original graph.
回复此楼
10