文件名称:二分图判定算法(邻接矩阵广度遍历)
文件大小:34KB
文件格式:RAR
更新时间:2011-11-01 05:58:54
二分图
for (j = 1; j <= Pub.Vertexnum; j++) { if (Pub.color[j] == -1) Pub.color[j] = 0; for (i = 1; i <= Pub.Vertexnum; i++) { if (Pub.graphs[j, i] == 1) { if (Pub.color[i] == -1) { Pub.color[i] = 1 - Pub.color[j]; } else if (Pub.color[j] == Pub.color[i]) { return false; } } } } if (Pub.Vertexnum != 0 &&j==Pub.Vertexnum + 1) { return true; } else return false;
【文件预览】:
二分图判定
----ReadeMe.txt(234B)
----Bipartite Graph()
--------Bipartite Graph.suo(21KB)
--------Bipartite Graph.sln(938B)
--------Bipartite Graph.cpp()