Skip to content

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
neighbors(entity_id)

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
out_neighbors(vertex_id)

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
successors(vertex_id)

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
in_neighbors(vertex_id)

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.

predecessors
predecessors(vertex_id)

Alias for :meth:in_neighbors.

Parameters:

Name Type Description Default
vertex_id str

Vertex identifier.

required

Returns:

Type Description
list[str]

Predecessor identifiers.