test_hierarchy.py 文件源码

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

项目:ReGraph 作者: eugeniashurko 项目源码 文件源码
def test_find_matching(self):
        pattern = nx.DiGraph()
        prim.add_nodes_from(pattern, [
            1,
            (2, {"a": 1}),
            3
        ])
        prim.add_edges_from(pattern, [
            (1, 2),
            (2, 3)
        ])
        pattern_typing = {1: "circle", 2: "square", 3: "triangle"}

        instances = self.hierarchy.find_matching(
            graph_id="g1",
            pattern=pattern,
            pattern_typing={
                "g0": pattern_typing,
                "g00": {1: "white", 2: "white", 3: "black"}
            }
        )
        assert(len(instances) == 1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号