示例#1
0
 def __eq__(self, other):
     """
     Return whether this graph is equal to another one.
     
     @type other: graph, digraph
     @param other: Other graph or digraph
     
     @rtype: boolean
     @return: Whether this graph and the other are equal.
     """
     return common.__eq__(self, other) and labeling.__eq__(self, other)
 def __eq__(self, other):
     """
     Return whether this hypergraph is equal to another one.
     
     @type other: hypergraph
     @param other: Other hypergraph
     
     @rtype: boolean
     @return: Whether this hypergraph and the other are equal.
     """
     def links_eq():
         for edge in self.edges():
             for link in self.links(edge):
                 if (link not in other.links(edge)): return False
         for edge in other.edges():
             for link in other.links(edge):
                 if (link not in self.links(edge)): return False
         return True
     
     return common.__eq__(self, other) and links_eq() and labeling.__eq__(self, other)