Skip to Content
算法技术手册(原书第2 版)
book

算法技术手册(原书第2 版)

by George T.Heineman, Gary Pollice, Stanley Selkow
August 2017
Intermediate to advanced
360 pages
8h 35m
Chinese
China Machine Press
Content preview from 算法技术手册(原书第2 版)
222
8
//
从原始的边集中取出边进行处理,忽略连接添加的“源点”和“汇点”的边。
//
当且仅当流等于
1
时,这条边属于解的一部分。
ArrayList<Pair> pairs = new ArrayList<Pair>();
for (EdgeInfo ei : edges) {
if (ei.start != srcIndex && ei.end != tgtIndex) {
if (ei.getFlow() == 1) {
pairs.add(new Pair(reverse.get(ei.start),
reverse.get(ei.end)));
}
}
}
return pairs.iterator(); //
使用迭代器生成
解决方案。
}
}
8.3.3 算法分析
想要更高效地规约问题,就必须将问题实例和计算方案进行高效映射。
二分图问题
M
=
S
,
T
,
P
可以在
n
+
m
+
k
步内转换成为一个图
G
= (
V
,
E
)
。转换后的图
G
拥有
n
+
m
+ 2
个顶点以及
n
+
m
+
k
)条边,因此图
G
的规模只比原始二分图问题的规模大一个常数。
这个重要特性保证我们能够高效地求解二分图问题。在
Ford-Fulkerson
算法计算出最大
流之后,网络中流量为
1
的边就对应了二分图中选择的匹配。要“读取”二分图问题的
解决方案,就需要从流网络中读取边,而读取这些边需要 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

Aurélien Géron
Go语言编程

Go语言编程

威廉·肯尼迪

Publisher Resources

ISBN: 9787111562221