Traversal
Traversal helpers from annnet.algorithms.traversal.
annnet.algorithms.traversal.Traversal
Local neighborhood traversal over the incidence-backed graph.
Every method here delegates to the structural query facade of the core, which owns the traversal itself. The facade answers a binary edge from the adjacency index in time proportional to the degree, and it answers a hyperedge from a list it caches against the structural clock. A graph with no hyperedge therefore never pays a full edge scan.
Functions
neighbors
Return adjacent entities for a node or an 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. |