摘要:
/* * description: 图的欧拉路径搜索 * writeby: Nick * date: 2012-10-25 23:32 * */#include <iostream>#include <vector>#include <stack>using namespace std;struct Edge{ int v, w; Edge(int v=-1, int w=-1) : v(v), w(w) {}};class Graph{ private: int vcount, ecount; ... 阅读全文
摘要:
一个有V个顶点的图G是一棵树,条件是当且仅当她满足一下4个条件中的任意一个:1. G有V-1条边,且无环。2. G的V-1条边,且是连通的。3. G中仅有一条简单路径使每一对顶点相连接。4. G是连通的,从中去除任意一条边都不会使其不连通。 阅读全文
摘要:
/* * description: 图的哈密顿路径搜索 * writeby: Nick * date: 2012-10-25 23:32 * */#include <iostream>#include <vector>using namespace std;struct Edge{ int v, w; Edge(int v=-1, int w=-1) : v(v), w(w) {}};class Graph{ private: int vcount, ecount; //记录顶点总数,边总数... 阅读全文
摘要:
/* * description: 图的一条简单路径搜索,不是最短的 * writeby: Nick * date: 2012-10-25 23:32 * */#include <iostream>#include <vector>using namespace std;struct Edge{ int v, w; Edge(int v=-1, int w=-1) : v(v), w(w) {}};class Graph{ private: int vcount, ecount; //记录顶... 阅读全文