Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error in finding cliques

I have the following code

f = open("42-matrix-of-size-378.txt", "r")
g = f.read()
l = g.split('-------------------------------')
matrix_list = {}
for i in range(0, 1):
    s = l[i].split()
    s.remove(s[0])
    A = matrix_maker(s)-matrix.identity(378)
    G=Graph(A, format='adjacency_matrix',loops=False)
    d = {i: [G.clique_number()]}
    matrix_list.update(d)
print(matrix_list)

But I got the following error:

the adjacency matrix of a non-weighted graph must have zeroes on the diagonal