drepr/old_code/prototype/drepr/query/selection_interface.py
def optimize(self):
        """Optimize the selection graph by removing redundant edges"""
        removing_edges = []
        for u, v in self.graph.edges:
            if self.graph.nodes[v]['is_class_node'] and self.graph.out_degree(v) == 0:
                removing_edges.append((u, v))

        for u, v in removing_edges:
            self.graph.remove_edge(u, v)
Optimize the selection graph by removing redundant edges
Optimize the selection graph by removing redundant edges
Optimize the selection graph by removing redundant edges
def optimize(self):
        removing_edges = []
        for u, v in self.graph.edges:
            if self.graph.nodes[v]['is_class_node'] and self.graph.out_degree(v) == 0:
                removing_edges.append((u, v))
        for u, v in removing_edges:
            self.graph.remove_edge(u, v)
def optimize ( self ) : removing_edges = [ ] for u , v in self . graph . edges : if self . graph . nodes [ v ] [ 'is_class_node' ] and self . graph . out_degree ( v ) == 0 : removing_edges . append ( ( u , v ) ) for u , v in removing_edges : self . graph . remove_edge ( u , v )
Optimize the selection graph by removing redundant edges
Optimize the selection graph by removing redundant edges
"""Optimize the selection graph by removing redundant edges"""
self