上一页 1 ··· 6 7 8 9 10 11 下一页

2012年7月13日

最大团问题

摘要: 最大团问题:团(clique)是图论中的用语。对于给定图G=(V,E)。其中,V={1,…,n}是图G的顶点集,E是图G的边集。图G的团就是一个两两之间有边的顶点集合。如果一个团不被其他任一团所包含,即它不是其他任一团的真子集,则称该团为图G的极大团(maximal clique)。顶点最多的极大团,称之为图G的最大团(maximum clique)。最大团问题的目标就是要找到给定图的最大团。http://zh.wikipedia.org/wiki/%E5%9C%98_(%E5%9C%96%E8%AB%96) 1 /*====================================== 阅读全文

posted @ 2012-07-13 20:39 kakamilan 阅读(3624) 评论(0) 推荐(0) 编辑

2012年7月11日

无向图连通度

摘要: 1 //vis[i] 0--尚未访问 1--正在访问 2--已经访问结束 2 //anc[i] 该点能到达的最小序号 3 //pre[i] 该点的序号 4 /*==================================================*\ 5 | 无向图连通度( 割) 6 | INIT: edge[][]邻接矩阵;vis[],pre[],anc[],deg[]置为0; 7 | CALL: dfs(0, -1, 1, n); 8 | k=deg[0], deg[i]+1(i=1…n-1) 为删除该节点后得到的连通图个数 9 | 注意:... 阅读全文

posted @ 2012-07-11 00:36 kakamilan 阅读(610) 评论(0) 推荐(0) 编辑

2012年7月10日

无向图中寻找桥

摘要: 1 /*==================================================*\ 2 | 无向图找桥 3 | INIT: edge[][]邻接矩阵;vis[],pre[],anc[],bridge 置0; 4 | CALL: dfs(0, -1, 1, n); 5 \*==================================================*/ 6 int bridge, edge[V][V], anc[V], pre[V], vis[V]; 7 //vis[i] 0--尚未访问 1--正在访问 2--已经访问... 阅读全文

posted @ 2012-07-10 00:42 kakamilan 阅读(778) 评论(0) 推荐(0) 编辑

2012年7月9日

SRM 549 DIV2

摘要: 哎,水平依旧很烂,只能做出第一道很水的题。第一道题很简单,分析最初的位置,分成三种情况,仔细一点就没问题了,也算比较快的就提交了。http://community.topcoder.com/stat?c=problem_solution&rm=313696&rd=15171&pm=11964&cr=23038076第二道题比赛的时候没想清楚,比完赛之后发现了方法,其实就是二分图匹配问题,想清楚之后代码也就好写了,可惜一个小时竟然都没有想出来,要不然就是涨积分的大好时机了啊。 1 #include <iostream> 2 #include <s 阅读全文

posted @ 2012-07-09 23:47 kakamilan 阅读(239) 评论(0) 推荐(0) 编辑

dag的深度优先搜索

摘要: 1 int edge[V][V], pre[V], post[V], tag; 2 void dfstag(int cur, int n) { // vertex: 0 ~ n-1 3 pre[cur] = ++tag; 4 for (int i = 0; i < n; ++i) 5 if (edge[cur][i]) { 6 if (0 == pre[i]) { 7 cout<<"cur: "<<cur<<"i: "<<i; 8 printf("Tree Edge!\n"... 阅读全文

posted @ 2012-07-09 00:05 kakamilan 阅读(476) 评论(0) 推荐(0) 编辑

2012年7月8日

DocIndex

摘要: 1 #include <iostream> 2 #include <fstream> 3 #include <cstring> 4 #include "Md5.h" 5 #include "Url.h" 6 #include "Document.h" 7 8 using namespace std; 9 10 int main(int argc, char* argv[]) {/* 11 * DocIndex.cpp 12 * Created on: 2011-11-9 13 * function: 阅读全文

posted @ 2012-07-08 10:56 kakamilan 阅读(219) 评论(0) 推荐(0) 编辑

2012年7月7日

CTianwangFile

摘要: 1 #ifndef _TIANWANG_FILE_H_031104_ 2 #define _TIANWANG_FILE_H_031104_ 3 4 #include "Tse.h" 5 #include "Url.h" 6 #include "Page.h" 7 #include "FileEngine.h" 8 9 class CTianwangFile : public CFileEngine10 {11 public:12 CTianwangFile(string str);13 CTianwangFile( 阅读全文

posted @ 2012-07-07 16:54 kakamilan 阅读(219) 评论(0) 推荐(0) 编辑

CLink4SEFile

摘要: 1 #ifndef _LINK4SE_FILE_H_031208_ 2 #define _LINK4SE_FILE_H_031208_ 3 4 #include "Tse.h" 5 #include "Url.h" 6 #include "Page.h" 7 #include "FileEngine.h" 8 9 class CLink4SEFile : public CFileEngine10 {11 public:12 CLink4SEFile(string str);13 CLink4SEFile();14 阅读全文

posted @ 2012-07-07 16:47 kakamilan 阅读(242) 评论(0) 推荐(0) 编辑

CIsamFile

摘要: 1 #ifndef _ISAM_FILE_H_031105_ 2 #define _ISAM_FILE_H_031105_ 3 4 #include "FileEngine.h" 5 6 class CIsamFile : public CFileEngine 7 { 8 public: 9 string m_sIndexFileName;10 FILE *fpDataFile;11 FILE *fpIdxFile;12 13 public:14 CIsamFile();15 CIsamFile(string str);16 CIsamFi... 阅读全文

posted @ 2012-07-07 16:37 kakamilan 阅读(190) 评论(0) 推荐(0) 编辑

CDatabaseEngine

摘要: 1 #ifndef _DATABASE_ENGINE_H_031104_ 2 #define _DATABASE_ENGINE_H_031104_ 3 4 #include "DataEngine.h" 5 6 class CDatabaseEngine : public CDataEngine 7 { 8 public: 9 CDatabaseEngine(string str);10 virtual ~CDatabaseEngine();11 12 int GetEngineType() { return DATABASE_ENGINE; }13 14 };1... 阅读全文

posted @ 2012-07-07 16:32 kakamilan 阅读(168) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 下一页

导航