def add_edge(self, u, v, **kwargs):
        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)))

        super(JunctionTree, self).add_edge(u, v, **kwargs)
Add an edge between two clique nodes.
dataset/ETHPy150Open pgmpy/pgmpy/pgmpy/models/JunctionTree.py/JunctionTree.add_edge