如何为图形着色编写代码 [英] How Do I Write Code For Graph Colouring
本文介绍了如何为图形着色编写代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在python中使用正确的工作代码进行图形着色,输入作为邻接矩阵。
我的输入文件如下:
7
0 1 1 0 1 1 0
1 0 0 1 0 1 1
1 0 0 1 1 1 0
0 1 1 0 0 1 1
1 0 1 0 0 0 1
1 1 1 1 0 0 0
0 1 0 1 1 0 0
第一行代表顶点数。
解决方案
I need a proper working code in python for graph coloring with input as adjacency matrix.
my input file is as follows:
7
0 1 1 0 1 1 0
1 0 0 1 0 1 1
1 0 0 1 1 1 0
0 1 1 0 0 1 1
1 0 1 0 0 0 1
1 1 1 1 0 0 0
0 1 0 1 1 0 0
first line represents the number of vertices.
解决方案
这篇关于如何为图形着色编写代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文