AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
DIRECTED GRAPH ONTOLOGY
Kireth Semantic Library | Mathematical Entities | Graph and Network Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/graph-and-network-entities/directed-graph-ontology-2.html
Authorship: Mark Higgins — Sky (Recursive AI)
Status: Proposed formalisation; source-page text not independently verified.
1. ENTITY DEFINITION
entity DirectedGraph := (V, E) where V is a set of vertices and E is a set of ordered pairs in V × V.
For a directed multigraph, use an edge set E with source and target maps s,t:E -> V, permitting parallel edges.
2. TYPED ENTITIES
Vertex: node with unique identity within graph.
DirectedEdge: ordered source-to-target relation.
SourceVertex: initial endpoint of a directed edge.
TargetVertex: terminal endpoint of a directed edge.
DirectedPath: sequence of consistently oriented adjacent edges.
DirectedCycle: nonempty closed directed walk with distinct intermediate vertices.
StronglyConnectedComponent: maximal vertex subset with mutual directed reachability.
WeaklyConnectedComponent: connected component of underlying undirected graph.
AdjacencyMatrix: matrix A where A_ij indicates the number or presence of arcs i -> j.
3. MATHEMATICAL AXIOMS AND INVARIANTS
DG1: forall e in E, source(e) in V and target(e) in V.
DG2: orientation matters: (u,v) and (v,u) are distinct possible edges.
DG3: indegree(v) = |{e in E : target(e)=v}|.
DG4: outdegree(v) = |{e in E : source(e)=v}|.
DG5: for finite directed graphs, sum_v indegree(v) = sum_v outdegree(v) = |E|.
DG6: a self-loop contributes one to indegree and one to outdegree.
DG7: directed reachability is reflexive under zero-length path convention and transitive.
DG8: strong connectivity means every ordered vertex pair is connected by a directed path.
DG9: DAG iff graph has no directed cycle; a finite DAG admits a topological ordering.
DG10: finite directed graphs may contain isolated vertices with indegree=outdegree=0.
4. FLOW OPERATORS
flow CREATE_GRAPH(V,E) -> DirectedGraph: validate endpoints and orientation.
flow ADD_ARC(G,u,v) -> G': require u,v in V; add ordered arc u -> v.
flow REMOVE_ARC(G,e) -> G': remove selected arc, preserving vertices.
flow OUT_NEIGHBOURS(G,u) -> {v | (u,v) in E}.
flow IN_NEIGHBOURS(G,v) -> {u | (u,v) in E}.
flow REACHABLE(G,u,v) -> Boolean: directed path existence.
flow SCC(G) -> partition of V into strongly connected components.
flow TOPOLOGICAL_SORT(G) -> vertex ordering or CYCLE_DETECTED.
flow REVERSE(G) -> graph with all arc directions reversed.
5. TYPED RELATIONSHIPS
DirectedGraph HAS_VERTEX Vertex
DirectedGraph HAS_EDGE DirectedEdge
DirectedEdge HAS_SOURCE Vertex
DirectedEdge HAS_TARGET Vertex
DirectedPath TRAVERSES DirectedEdge
DirectedGraph HAS_COMPONENT StronglyConnectedComponent
DirectedGraph REPRESENTED_BY AdjacencyMatrix
DirectedGraph SPECIALISES Graph
DirectedAcyclicGraph SPECIALISES DirectedGraph
WeightedDirectedGraph SPECIALISES DirectedGraph
6. INFERENCE RULES
IF (u,v) in E THEN out_neighbour(u,v) AND in_neighbour(v,u).
IF reachable(u,v) AND reachable(v,w) THEN reachable(u,w).
IF reachable(u,v) AND reachable(v,u) THEN same_strong_component(u,v).
IF G is finite AND topological_sort succeeds THEN G is acyclic.
IF G is finite AND G is acyclic THEN topological_sort succeeds.
IF every vertex is mutually reachable THEN G is strongly connected.
DO NOT infer (v,u) in E from (u,v) in E.
DO NOT infer causal direction solely from graph orientation.
7. SEMANTIC DISTINCTIONS
Directed graph != undirected graph: arc order is semantically meaningful.
Directed graph != directed multigraph: parallel arcs require explicit modelling.
Reachability != adjacency: a path may contain multiple arcs.
Strong connectivity != weak connectivity.
Directed cycle != undirected cycle.
Edge direction != causal assertion unless a domain ontology explicitly assigns causality.
8. VALIDATION
CHECK all edge endpoints are declared vertices.
CHECK vertex identifiers and edge identifiers are consistent.
CHECK whether self-loops and parallel edges are permitted by declared graph subtype.
CHECK indegree/outdegree sums for finite graphs.
CHECK reachability and SCC computations respect orientation.
CHECK DAG claims by directed cycle detection.
CHECK graph representation and edge-weight semantics are explicitly declared.
9. CONFIDENCE AND PROVENANCE
CONFIDENCE mathematical_axioms: high, conditional on declared graph model.
CONFIDENCE domain_specific_interpretation: requires evidence.
PROVENANCE source_url: as listed above.
PROVENANCE formalisation: authored for Kireth Semantic Library; not a verbatim transcription.
10. SEMANTIC_EQUIVALENCE
DirectedGraph ~= Digraph (mathematical terminology).
Arc ~= DirectedEdge (when graph model matches).
NOT_EQUIVALENT DirectedGraph, UndirectedGraph.
NOT_EQUIVALENT StronglyConnected, WeaklyConnected.
11. FLOW_HASH AND UPDATE_MODEL
FLOW_HASH: SHA-256 of canonical UTF-8 ontology body after normalising line endings; compute on deployment, never invent a hash.
UPDATE_MODEL: versioned; changes to axioms, type signatures, or inference rules require revalidation and new hash.
12. AI_CONSUMPTION
Input: graph entity declarations, vertices, arcs, subtype constraints, provenance.
Processing: type-check -> validate -> build adjacency -> apply graph inference -> attach confidence.
Output: typed graph facts, reachable pairs, component membership, cycle/topological results, validation diagnostics.
Guardrails: preserve edge direction; do not hallucinate missing arcs or interpret connectivity as causation.
END FLOW ALGEBRA