AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
NEIGHBOURHOOD 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/neighbourhood-ontology.html
Status: Proposed mathematical formalisation; source page wording not independently verified.
1. DOMAIN AND PURPOSE
flow "GraphNeighbourhoodOntology" v1.0
namespace: kireth.entity_graph.mathematical.graph.neighbourhood
scope: graph-theoretic neighbourhoods (not geographical or topological neighbourhoods)
2. TYPED ENTITIES
Graph := (V: Set[Vertex], E: Set[Edge], directed: Boolean)
Vertex := uniquely identified graph node
Edge := adjacency relation between endpoints
OpenNeighbourhood := Set[Vertex]
ClosedNeighbourhood := Set[Vertex]
InNeighbourhood := Set[Vertex]
OutNeighbourhood := Set[Vertex]
DistanceNeighbourhood := Set[Vertex]
Degree := NonNegativeInteger
3. DEFINITIONS
For a simple undirected graph G=(V,E) and v in V:
N_G(v) = {u in V | {u,v} in E}.
N_G[v] = N_G(v) union {v}.
For S subseteq V:
N_G(S) = (union over v in S of N_G(v)) \ S.
N_G[S] = S union N_G(S).
For a directed graph D=(V,A):
N_D^+(v) = {u in V | (v,u) in A}.
N_D^-(v) = {u in V | (u,v) in A}.
For graph distance d_G and integer k >= 0:
N_G^{<=k}[v] = {u in V | d_G(u,v) <= k}.
For k >= 1, the exact-distance sphere is S_k(v) = {u in V | d_G(u,v) = k}.
4. AXIOMS AND INVARIANTS
A1: N_G(v) subseteq V.
A2: v in N_G[v].
A3: In a loopless graph, v notin N_G(v).
A4: In an undirected graph, u in N_G(v) iff v in N_G(u).
A5: In a simple undirected graph, degree(v) = |N_G(v)|.
A6: In a directed simple graph, outdegree(v) = |N_D^+(v)| and indegree(v) = |N_D^-(v)|, assuming no parallel arcs.
A7: N_G[v] = N_G(v) union {v}.
A8: For undirected graphs, N_G^{<=0}[v] = {v}.
A9: For S subseteq V, N_G(S) intersect S = empty set.
A10: Neighbourhood size alone does not imply connectivity of the induced neighbourhood subgraph.
5. RELATIONSHIP TYPES
HAS_VERTEX(Graph, Vertex)
HAS_EDGE(Graph, Edge)
ADJACENT_TO(Vertex, Vertex) [symmetric only if undirected]
HAS_OPEN_NEIGHBOURHOOD(Vertex, OpenNeighbourhood)
HAS_CLOSED_NEIGHBOURHOOD(Vertex, ClosedNeighbourhood)
HAS_IN_NEIGHBOURHOOD(Vertex, InNeighbourhood)
HAS_OUT_NEIGHBOURHOOD(Vertex, OutNeighbourhood)
HAS_DISTANCE_NEIGHBOURHOOD(Vertex, DistanceNeighbourhood)
HAS_DEGREE(Vertex, Degree)
IS_MEMBER_OF(Vertex, Neighbourhood)
6. EXECUTABLE INFERENCE FLOWS
flow "InferUndirectedNeighbourhood"(G: Graph, v: Vertex) -> Set[Vertex]:
require v in G.V and G.directed == false
return {u in G.V | edge_exists(G, u, v)}
flow "InferClosedNeighbourhood"(G: Graph, v: Vertex) -> Set[Vertex]:
require v in G.V
return open_neighbours(G,v) union {v}
flow "InferDirectedNeighbourhoods"(D: Graph, v: Vertex) -> Record:
require v in D.V and D.directed == true
return {out: {u | arc_exists(D,v,u)}, in: {u | arc_exists(D,u,v)}}
flow "InferRadiusNeighbourhood"(G: Graph, v: Vertex, k: Integer) -> Set[Vertex]:
require v in G.V and k >= 0
return {u in G.V | shortest_path_distance(G,v,u) <= k}
flow "ValidateNeighbourhood"(G: Graph, v: Vertex, N: Set[Vertex]) -> Boolean:
require v in G.V
return N == open_neighbours(G,v)
7. SEMANTIC DISTINCTIONS
Open neighbourhood excludes the centre in loopless graphs; closed neighbourhood includes it.
Graph neighbourhood is adjacency-based; topological neighbourhood is defined by containment of an open set.
Geographical neighbourhood is a spatial/social concept, not automatically a graph neighbourhood.
Directed in-neighbours and out-neighbours must not be conflated.
For multigraphs, neighbour sets collapse repeated edges; degree counts incidences and may differ from neighbourhood cardinality.
For graphs with loops, state explicitly whether the vertex is its own open neighbour.
8. CONFIDENCE AND VALIDATION
CONFIDENCE: 1.0 for definitions conditional on declared graph conventions; otherwise require convention check.
validate vertex_membership, endpoint_integrity, directedness, loop_policy, multiplicity_policy, distance_metric, finite_or_infinite_graph.
reject inference if vertex absent or graph conventions unresolved.
9. SEMANTIC_EQUIVALENCE
"adjacent vertices of v" ~= "open neighbours of v" for loopless undirected simple graphs.
"closed neighbours" = "open neighbours plus centre" under the stated convention.
Do not equate "neighbourhood" with "community", "connected component", or "clique".
10. FLOW_HASH AND UPDATE_MODEL
FLOW_HASH: SHA-256 of canonical UTF-8 serialisation of namespace, version, typed schema, axioms, inference rules and conventions; compute at deployment (not a fabricated hash).
UPDATE_MODEL: semantic-version revisions; recompute hash after any change; retain provenance and change log.
11. AI_CONSUMPTION
Expose typed entity IDs, source URL, definitions, relation predicates, assumptions, validation outcomes, confidence, version and computed FLOW_HASH.
AI reasoning must preserve directedness, loop policy and edge multiplicity.
Do not infer an edge from shared neighbourhood membership alone.
END FLOW ALGEBRA