Skip to content

combin · GraphTraversal

5 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Use the fixed-precision Witt ring W(F_9) uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Use the fixed-precision Witt ring W(F_9)."""

from noether.numthy import FiniteField, QadicRing


def main() -> None:
    residue_field = FiniteField.extension(3, 2)
    witt_ring = QadicRing(residue_field, absolute_precision=4)
    residue = residue_field.generator() + residue_field.one()
    lift = witt_ring.teichmuller(residue)
    assert witt_ring.residue(lift) == residue
    assert lift**residue_field.order == lift
    print(f"Teichmuller({residue}) = {lift}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/11_qadic_witt_vectors.py.

combin.GraphTraversal

The result of Graph.bfs / Graph.dfs — visit order, predecessor tree, depths, and a path accessor.

Detailed contract

The result of Graph.bfs / Graph.dfs — visit order, predecessor tree, depths, and a path accessor.

class GraphTraversal

noether::combin::GraphTraversal · Direct Rust declaration

pub struct GraphTraversal { pub order: Vec<u32>, /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combin/test_graph_facade.py:11 · validation/unit/combin/test_graph_facade.py:28

combin.GraphTraversal.depth

Per-vertex depth as a list[int | None] — BFS layer (= unweighted distance) for [Graph.bfs], DFS-tree depth for [Graph.dfs].

Detailed contract

Per-vertex depth as a list[int | None] — BFS layer (= unweighted distance) for [Graph.bfs], DFS-tree depth for [Graph.dfs]. None for unreached vertices.

Distance from the source to v in edges (BFS level / DFS depth), or None if v was not reached.

(self) -> list[int | None]

noether::combin::GraphTraversal::depth · Direct Rust declaration

pub fn depth(&self, v: u32) -> Option<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/homalg/test_module_facade.py:505 · validation/parity/combinatorics/test_tree_core_parity.py:17 · validation/parity/combinatorics/test_tree_core_parity.py:189 · validation/parity/combinatorics/test_tree_core_parity.py:194 · validation/parity/combinatorics/test_tree_core_parity.py:210 · validation/parity/combinatorics/test_tree_core_parity.py:265

combin.GraphTraversal.order

The vertices in first-visit order, as a list[int].

Detailed contract

The vertices in first-visit order, as a list[int]. The source is order[0]; only reachable vertices appear.

(self) -> list[VertexId]

noether::combin::GraphTraversal · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: examples/11_qadic_witt_vectors.py:14 · examples/12_number_field_ideals.py:13 · examples/12_number_field_ideals.py:14 · examples/12_number_field_ideals.py:17 · examples/15_groebner_twisted_cubic.py:18 · examples/19_permutation_groups.py:13

combin.GraphTraversal.path_to

The path from the traversal source to target, as a list[int], or None if target was not reached.

Detailed contract

The path from the traversal source to target, as a list[int], or None if target was not reached.

The path from the traversal source to target, following the predecessor tree, or None if target was not reached. The returned path starts at the source and ends at target.

(self, target: VertexId) -> list[VertexId] | None

noether::combin::GraphTraversal::path_to · Direct Rust declaration

pub fn path_to(&self, target: u32) -> Option<Vec<u32>>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combin/test_graph_facade.py:30

combin.GraphTraversal.pred

The predecessor tree as a list[int | None] of length graph.order.

Detailed contract

The predecessor tree as a list[int | None] of length graph.order. pred[v] is the vertex v was discovered from, or None for the source and any unreached vertex.

(self) -> list[VertexId | None]

noether::combin::GraphTraversal · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/groups/test_acceptance_workload.py:57 · validation/parity/_noether_bsgs.py:119