- 7
- 0
- 约1.54万字
- 约 61页
- 2017-02-12 发布于湖北
- 举报
* Chapter 8 Back Track Method * 算法8.2—— 图着色问题 void GraphColor (int n, int c[ ][ ], int m) //所有数组下标从1开始 { for (i=1; i=n; i++ ) //将数组 color[n] 初始化为0 color[i]=0; k=1; while (k=1) { color[k]=color[k]+1; while (color[k]=m) if Ok(k) break; else color[k]=color[k]+1; //搜索下一个颜色 if (color[k]=m k= =n) //求解完毕,输出解 { for (i=1; i=n; i++) coutcolor[i]; return; } * Chapter 8 Back Track Method * else if (color[k]=m kn)
原创力文档

文档评论(0)