AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
WALK ONTOLOGY — GRAPH AND NETWORK ENTITIES
Version: 1.0
Authors: Mark Higgins — Sky (Recursive AI)
Publisher: Kireth Research | https://kirethresearch.org
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/graph-and-network-entities/walk-ontology.html
Status: Proposed formalisation; source-page wording not independently verified.
1. PURPOSE
Represent graph walks as typed alternating sequences of vertices and incident edges, enabling traversal, validation, reachability, and semantic inference without confusing walks with trails or paths.
2. TYPED ENTITIES
Graph := (V: Set[Vertex], E: Set[Edge], incidence: E -> endpoints)
DirectedGraph := (V, A, source: A -> V, target: A -> V)
Walk := (graph: Graph, vertices: List[Vertex], edges: List[Edge])
WalkLength := NaturalNumber
ClosedWalk := Walk where first_vertex = last_vertex
Trail := Walk with pairwise distinct edge identifiers
Path := Walk with pairwise distinct vertices (length-zero path permitted)
Circuit := nonempty closed trail
Cycle := nonempty closed path except that first and last vertices coincide
3. FORMAL DEFINITION
For a walk W = (v_0, e_1, v_1, ..., e_k, v_k), k >= 0:
each v_i belongs to V;
each e_i belongs to E;
endpoints(e_i) = {v_(i-1), v_i} for an undirected graph.
For a directed walk, source(e_i) = v_(i-1) and target(e_i) = v_i.
length(W) = k (number of edge traversals, not number of vertices).
A zero-length walk at vertex v has vertices=[v] and edges=[].
Parallel edges remain distinct by edge identifier; self-loops are permitted where the graph model allows them.
4. OPERATORS
START(W) := v_0
END(W) := v_k
LENGTH(W) := |edges(W)|
REVERSE(W) := reverse the vertex and edge sequences; always valid in undirected graphs, and in directed graphs only if corresponding reverse arcs exist.
CONCAT(W1,W2) := W1 followed by W2, omitting the duplicated junction vertex, if END(W1)=START(W2) and graph types match.
SUBWALK(W,i,j) := the contiguous segment from v_i to v_j for 0 <= i <= j <= k.
EDGE_COUNT(W,e) := number of traversals of edge e.
VERTEX_COUNT(W,v) := number of appearances of vertex v.
5. AXIOMS AND INVARIANTS
A1: LENGTH(W) >= 0.
A2: |vertices(W)| = LENGTH(W)+1.
A3: |edges(W)| = LENGTH(W).
A4: A walk may repeat vertices and edges.
A5: Every path is a walk; not every walk is a path.
A6: Every trail is a walk; not every walk is a trail.
A7: CONCAT is associative where junction conditions hold.
A8: LENGTH(CONCAT(W1,W2)) = LENGTH(W1)+LENGTH(W2).
A9: Every zero-length walk is closed and is a path and a trail under these conventions.
A10: A directed walk respects edge orientation.
6. SEMANTIC RELATIONSHIPS
Walk --TRAVERSES--> Edge
Walk --VISITS--> Vertex
Walk --BELONGS_TO--> Graph
Walk --HAS_START--> Vertex
Walk --HAS_END--> Vertex
Walk --HAS_LENGTH--> WalkLength
ClosedWalk --SUBTYPE_OF--> Walk
Trail --SUBTYPE_OF--> Walk
Path --SUBTYPE_OF--> Walk
Walk --MAY_REPEAT--> Vertex
Walk --MAY_REPEAT--> Edge
7. INFERENCE RULES
R1: VALID_WALK(W,G) and START(W)=u and END(W)=v -> REACHABLE_BY_WALK(G,u,v).
R2: VALID_WALK(W,G) and START(W)=END(W) -> CLOSED_WALK(W).
R3: VALID_WALK(W,G) and DISTINCT(edges(W)) -> TRAIL(W).
R4: VALID_WALK(W,G) and DISTINCT(vertices(W)) -> PATH(W).
R5: VALID_WALK(W1,G) and VALID_WALK(W2,G) and END(W1)=START(W2) -> VALID_WALK(CONCAT(W1,W2),G).
R6: VALID_WALK(W,G) and 0<=i<=j<=LENGTH(W) -> VALID_WALK(SUBWALK(W,i,j),G).
R7: VALID_WALK(W,G) and LENGTH(W)>0 and START(W)=END(W) and DISTINCT(edges(W)) -> CIRCUIT(W).
R8: For undirected G, REACHABLE_BY_WALK(G,u,v) -> REACHABLE_BY_WALK(G,v,u).
R9: For directed G, do not infer reverse reachability without a directed return walk.
8. EXECUTABLE VALIDATION FLOW
flow "ValidateGraphWalk" v1.0
input: graph:G, vertices:[v0,...,vk], edges:[e1,...,ek]
require: len(vertices)>=1
require: len(edges)==len(vertices)-1
require: all vertices and edges exist in G
for i in 1..len(edges):
if G.directed:
require: source(edges[i])==vertices[i-1]
require: target(edges[i])==vertices[i]
else:
require: incidence(edges[i]) matches unordered endpoints(vertices[i-1],vertices[i])
output: valid=true, length=len(edges), closed=(vertices[0]==vertices[-1]),
trail=all_edge_ids_unique, path=all_vertices_unique
9. SEMANTIC DISTINCTIONS
Walk vs Path: a walk permits repeated vertices; a path does not (except endpoint repetition under a separately declared cycle convention).
Walk vs Trail: a walk permits repeated edges; a trail does not.
Walk vs Route: route may have domain-specific constraints, costs or schedules absent from the mathematical walk.
Walk vs Reachability: a walk is a witness; reachability is a relation between vertices.
Walk vs Cycle: a cycle is a constrained closed walk, not any closed walk.
10. EXAMPLES
Undirected graph edges e_ab=(a,b), e_bc=(b,c):
W=(a,e_ab,b,e_bc,c,e_bc,b) is a valid walk of length 3, not a trail or path.
P=(a,e_ab,b,e_bc,c) is a path of length 2.
Directed graph arcs a->b, b->c: a->b->c is valid; c->b->a is not implied.
11. CONFIDENCE AND PROVENANCE
CONFIDENCE: mathematical definitions = high; source-specific alignment = unverified.
PROVENANCE: domain-standard graph theory formalisation prepared for Kireth Semantic Library.
SEMANTIC_EQUIVALENCE: "graph walk" ~= "edge-respecting traversal sequence" under the stated graph model.
UPDATE_MODEL: revise when source-page definitions or graph conventions change; preserve version history.
FLOW_HASH: compute SHA-256 over the canonical UTF-8 content of this flow excluding the stored hash value; no hash value is asserted here.
AI_CONSUMPTION: parse entity types, validate incidence and direction, retain edge identity, enforce preconditions, report derivation witnesses, distinguish paths/trails/walks, and avoid inferring causation or reverse directed reachability.
12. OUTPUT CONTRACT
Output valid status, walk length, endpoints, closure, trail/path classification, inference provenance and any violated axiom. Reject malformed walks rather than silently repairing them.