def test_add_supernode_similar_output_to_naive_mat_3(self):
mat = scipy.io.loadmat('bcspwr01.mat')
A = mat['Problem'][0][0][1].todense()
G = nx.from_numpy_matrix(A)
G3 = graphpca.reduce_graph_efficiently(G, 3, add_supernode=True)
G3n = graphpca.reduce_graph_naively(G, 3)
self.assertTrue(np.allclose(G3, G3n, rtol=1e-02, atol=1e-06),
'Regular result:\n{}\nNaive result:\n{}\n'.format(G3, G3n))
评论列表
文章目录