OriginChain
04 · graph

Fourteen graph methods, shipped.

Not a graph database that stored your edges and stopped there. PageRank, betweenness, eigenvector centrality, label-propagation communities, plus Node2Vec and GraphSAGE node embeddings — all on the same direction-tagged relation keys. Cypher v3 covers CALL subqueries, nested FOREACH, list comprehensions, MERGE, DELETE, and multi-hop undirected. Per-hop EXPLAIN ANALYZE shows you what every step cost.

01 Multi-hop traversal

Friends-of-friends, transitive closure to depth N.

02 Filtered traversal

Per-hop WHERE predicate narrows the frontier.

03 Variable-length paths *1..N

MATCH (a)-[:KNOWS*1..3]->(b) - bounded recursion.

04 Shortest-path BFS

Source-to-target with explicit hop count.

05 Connected components

Union-Find. Community detection without an extra library.

06 Triangle enumeration

Clustering coefficient. Motif counting.

07 All simple paths (forward)

Bounded by (depth, max_paths). Discrete option enumeration.

08 All simple paths (bidirectional)

Same answer, 5–20× faster on real graphs.

09 PageRank

Power-method iteration. Influence ranking that converges.

10 Betweenness centrality

Brandes' algorithm. Who sits on every shortest path?

11 Eigenvector centrality

Power iteration with bipartite-safe (A+I) shift. Influence by company kept.

12 Label propagation (LPA)

Seedable, reproducible community labels. Converges in ~10-20 iterations.

13 Node2Vec embeddings

Biased random-walk embeddings with disk persistence. p/q tunable for breadth-first vs depth-first emphasis.

14 GraphSAGE embeddings

Attribute-aware node embeddings with three aggregator choices — Mean, MaxPool, and LSTM. Deterministic per-(node, layer) shuffle.

explain analyze · per-hop

Every relation step, every row count, every millisecond.

Graph queries fan out fast - one wrong predicate at depth 4 multiplies your work by orders of magnitude. EXPLAIN ANALYZE reports the frontier size, edges considered, and time per hop in a single response so you can see where the cost actually went.

{
  "hops": [
    { "depth": 1, "frontier": 12,    "edges": 38,    "ms": 0.4 },
    { "depth": 2, "frontier": 184,   "edges": 612,   "ms": 1.1 },
    { "depth": 3, "frontier": 1942,  "edges": 6204,  "ms": 4.8 },
    { "depth": 4, "frontier": 8773,  "edges": 28891, "ms": 19.7 }
  ],
  "total_ms": 26.0
}
14
algorithms + embedding methods shipped
< 5 ms
per-hop traversal (small frontier)
5–20×
bidirectional vs forward all-paths
3
GraphSAGE aggregators: Mean / MaxPool / LSTM
roadmap
  • under evalGremlin dialect shim. Cypher v3 is GA on REST + JSON; Gremlin parity is a parser-only effort.
  • post-1.0OLAP-style PageRank at >10B edges. Single-region today; multi-region is a 1.x conversation.

Read the graph docs, then try it.