Traversal
Traversal helpers from annnet.algorithms.traversal.
annnet.algorithms.traversal.Traversal
Local neighborhood traversal helpers over the incidence-backed graph.
Functions
neighbors
Return adjacent entities for a vertex or edge-entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_id
|
str
|
Entity identifier. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Neighbor identifiers reachable through incident edges. |
out_neighbors
Return outward neighbors of a vertex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertex_id
|
str
|
Vertex identifier. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Neighbor identifiers reachable via outgoing or undirected edges. |
successors
Alias for :meth:out_neighbors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertex_id
|
str
|
Vertex identifier. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Successor identifiers. |
in_neighbors
Return inward neighbors of a vertex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertex_id
|
str
|
Vertex identifier. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Neighbor identifiers reachable via incoming or undirected edges. |