有向图的强连通分量
EnjoyingAC
bugger,写bug爱好者。
展开
-
模板总结——强连通分量
基本概念对于有向图上的2个点a,b,若存在一条从a到b的路径,也存在一条从b到a的路径,那么称a,b是强连通的。 对于有向图上的一个子图,若子图内任意点对(a,b)都满足强连通,则称该子图为强连通子图。 非强连通图有向图的极大强连通子图,称为强连通分量。 特别地,和任何一个点都不强连通的单个点也是一个强连通分量。tarjan算法伪代码tarjan(u){ Dfn[u]=...原创 2018-04-24 10:35:22 · 983 阅读 · 0 评论 -
POJ1236 Network of Schools(选最少点使沿边可以访问所有点、加最少边使有向图强连通)
题目链接http://poj.org/problem?id=1236题目A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which ...原创 2018-05-28 20:55:15 · 188 阅读 · 0 评论 -
POJ2186 Popular Cows (求所有点直接或间接指向的点)
题目链接http://poj.org/problem?id=2186题目Every cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ...原创 2018-05-28 21:17:11 · 222 阅读 · 0 评论 -
POJ2553 The Bottom of a Graph(求被有指向关系的其他点指向的点)
题目链接http://poj.org/problem?id=2553题目We will use the following (standard) definitions from graph theory. Let V be a nonempty and finite set, its elements being called vertices (or nodes). Let E b...原创 2018-05-29 15:01:03 · 191 阅读 · 0 评论