Overview
The K-hop neighbors of a node are the set of nodes whose shortest path distance from the starting node is exactly K.
RageDB provides a native MATCH KHOP statement. It is designed for high-performance reachability queries (e.g. "Who is reachable within K hops?") and neighbor counts. Rather than materializing all possible paths, MATCH KHOP tracks only unique reachable target nodes, providing substantial performance improvements over regular path matching.
-- Syntax
MATCH KHOP start_node -[ edge_pattern ]->{ quantifier } target_node