Example #1
0
 def remove_edge(self,eid):
     if not self.has_edge(eid) :
         raise InvalidEdge(eid)
     sid,tid=self._edges[eid]
     self._vertices[sid][1].remove(eid)
     self._vertices[tid][0].remove(eid)
     del self._edges[eid]
Example #2
0
 def remove_edge(self, eid):
     if not self.has_edge(eid):
         raise InvalidEdge(eid)
     vs, vt = self._edges[eid]
     self._vertices[vs][1].remove(eid)
     self._vertices[vt][0].remove(eid)
     del self._edges[eid]
     self._eid_generator.release_id(eid)
Example #3
0
 def target(self, eid):
     try:
         return self._edges[eid][1]
     except KeyError:
         raise InvalidEdge(eid)
Example #4
0
 def source(self, eid):
     try:
         return self._edges[eid][0]
     except KeyError:
         raise InvalidEdge(eid)
Example #5
0
 def edge_vertices(self, eid):
     try :
         return self._edges[eid]
     except KeyError :
         raise InvalidEdge(eid)