Add predecessors and successors properties to Vertex class
This commit is contained in:
parent
deb3ee8c74
commit
d35a3d7b87
1 changed files with 8 additions and 0 deletions
|
|
@ -113,6 +113,14 @@ class Vertex:
|
|||
def edges(self) -> List["ContractEdge"]:
|
||||
return self.graph.get_vertex_edges(self.id)
|
||||
|
||||
@property
|
||||
def predecessors(self) -> List["Vertex"]:
|
||||
return self.graph.get_predecessors(self)
|
||||
|
||||
@property
|
||||
def successors(self) -> List["Vertex"]:
|
||||
return self.graph.get_successors(self)
|
||||
|
||||
def __getstate__(self):
|
||||
return {
|
||||
"_data": self._data,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue