摘要: [有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3,4两两可达。{5},{6}也分别是两个强连通分量。大体来说有3中算法Kosaraju,Trajan,Gabow这三种!后续文章中将相继介绍,首先介绍Tarjan算法[Tarjan算法]Tarjan算法是基于对图深度优先搜索的算法,每个强连通分 阅读全文
posted @ 2012-05-06 21:25 索少 阅读(2023) 评论(0) 推荐(1) 编辑
摘要: 堆优化 dijkstra#include <iostream>#include <cstring>#include <cstdio>#include <algorithm>#include <cmath>using namespace std;#define MAXE 400005#define MAXV 400005typedef long long int64;static const int64 INF = (int64) (1) << 60;struct Edge{ Edge *next; int to; int6 阅读全文
posted @ 2012-05-06 19:26 索少 阅读(1389) 评论(0) 推荐(0) 编辑