
图论算法
辉酱
这个作者很懒,什么都没留下…
展开
-
无向图着色问题
无向图染色问题 #include<iostream> using namespace std; int map[100][100]={0}; //邻接矩阵 int v=5; //顶点数 int color_s=4; //颜色数 int color[100]={0}; //颜色标记数组 int ok(int depth,int c){ ...原创 2019-01-31 11:36:32 · 2761 阅读 · 0 评论 -
图论最少着色问题
无向图最少着色问题 DFS+回溯 #include<iostream> using namespace std; int map[100][100]={0}; int v=4; int color[100]={0}; int result=10000; /*无向图至少染色问题*/ int ok(int depth,int c){ for(int i=1;i<=v;...原创 2019-01-31 12:09:55 · 3431 阅读 · 0 评论 -
图的层次遍历
图的层次遍历分层 #include<iostream> #include<queue> using namespace std; const int v=6; int map[][v]={ //邻接矩阵表示图 {0,1,1,0,0,0}, {0,0,0,1,1,0}, {0,0,0,0,0,1}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,...原创 2019-03-02 16:58:56 · 1530 阅读 · 0 评论