def del_big_nodes(self, grater_than=215):
        """Delete big nodes with many connections from the graph."""
        G = self._graph
        it = G.nodes_iter()
        node_paths = []
        node_names = []
        del_nodes = []
        summe = 1
        count = 1
        for node in it:
            l = len(G[node])
            if l > grater_than:
                del_nodes.append(node)
                continue
            summe += l
            node_names.append(node)
            node_paths.append(l)
            count += 1
        for node in del_nodes:
            G.remove_node(node)
            if node > 1000000000:
                self.valid_user.pop(node)

        print("Nodes deleted: {}".format(len(del_nodes)))
def del_big_nodes ( self , grater_than = 215 ) : G = self . _graph it = G . nodes_iter ( ) node_paths = [ ] node_names = [ ] del_nodes = [ ] summe = 1 count = 1 for node in it : l = len ( G [ node ] ) if l > grater_than : del_nodes . append ( node ) continue summe += l node_names . append ( node ) node_paths . append ( l ) count += 1 for node in del_nodes : G . remove_node ( node ) if node > 1000000000 : self . valid_user . pop ( node ) print ( "Nodes deleted: {}" . format ( len ( del_nodes ) ) )
Delete big nodes with many connections from the graph.