5a53f60e5143ab6f416437dadddd2f1df133a247,pgmpy/models/JunctionTree.py,JunctionTree,add_edge,#JunctionTree#,100

Before Change


        ...                   (("a", "b", "c"), ("a", "c"))])
        
        set_u = set(u)
        set_v = set(v)
        if set_u.isdisjoint(set_v):
            raise ValueError("No sepset found between these two edges.")

        super().add_edge(u, v)

After Change


        
        import networkx as nx

        if u in self.nodes() and v in self.nodes() and nx.has_path(self, u, v):
            raise ValueError("Addition of edge between {u} and {v} forms a cycle breaking the "
                             "properties of Junction Tree".format(u=str(u), v=str(v)))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pgmpy/pgmpy
Commit Name: 5a53f60e5143ab6f416437dadddd2f1df133a247
Time: 2015-04-07
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/models/JunctionTree.py
Class Name: JunctionTree
Method Name: add_edge


Project Name: pgmpy/pgmpy
Commit Name: 6a5216e488b7f1cd388cb817581d7988ce0353b5
Time: 2014-08-20
Author: ankurankan@gmail.com
File Name: pgmpy/MarkovModel/MarkovModel.py
Class Name: MarkovModel
Method Name: __init__


Project Name: pgmpy/pgmpy
Commit Name: 4cbc6532d7fd2d1ffc1d7cd6fd71a9b60f1130c8
Time: 2014-11-30
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/models/FactorGraph.py
Class Name: FactorGraph
Method Name: to_markov_model