test_graphpca.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:graphpca 作者: brandones 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号