python/data_mining/graph.py
def pop_edge(self, edge, remove_disconnected_nodes=False):
        """Removes the edge from the graph.

        Args:
            edge ((int, int)): edge between nodes edge[0] and edge[1].
        """

        if edge not in self.edges:
            raise ValueError('edge {} does not exist'.format(edge))
        u, v = edge
        self._node_neighbors[u].remove(v)
        self._node_neighbors[v].remove(u)
        self.edges.remove(edge)
        if remove_disconnected_nodes:
            if len(self._node_neighbors[u]) == 0:
                del self._node_neighbors[u]
            if len(self._node_neighbors[v]) == 0:
                del self._node_neighbors[v]
Removes the edge from the graph.

        Args:
            edge ((int, int)): edge between nodes edge[0] and edge[1].
        
Removes the edge from the graph.
Removes the edge from the graph .
def pop_edge(self, edge, remove_disconnected_nodes=False):
        if edge not in self.edges:
            raise ValueError('edge {} does not exist'.format(edge))
        u, v = edge
        self._node_neighbors[u].remove(v)
        self._node_neighbors[v].remove(u)
        self.edges.remove(edge)
        if remove_disconnected_nodes:
            if len(self._node_neighbors[u]) == 0:
                del self._node_neighbors[u]
            if len(self._node_neighbors[v]) == 0:
                del self._node_neighbors[v]
def pop_edge ( self , edge , remove_disconnected_nodes = False ) : if edge not in self . edges : raise ValueError ( 'edge {} does not exist' . format ( edge ) ) u , v = edge self . _node_neighbors [ u ] . remove ( v ) self . _node_neighbors [ v ] . remove ( u ) self . edges . remove ( edge ) if remove_disconnected_nodes : if len ( self . _node_neighbors [ u ] ) == 0 : del self . _node_neighbors [ u ] if len ( self . _node_neighbors [ v ] ) == 0 : del self . _node_neighbors [ v ]
Removes the edge from the graph.
Removes the edge from the graph .
"""Removes the edge from the graph.

        Args:
            edge ((int, int)): edge between nodes edge[0] and edge[1].
        """
self
edge
None
remove_disconnected_nodes