gograph

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 0 Imported by: 0

README

GoGraph

A Go module for graph persistence, manipulation, and fast search, designed to scale from in-memory graphs to graphs that exceed RAM.

Status

Current release: v0.1.0. This is the project's first release, published at a pre-1.0 baseline: under Semantic Versioning a 0.y.z version signals that the public API is not yet stable and may change without a major bump while the module matures toward 1.0.0. The five major subsystems below are functional and tested under race, lint, and soak gates. The two compliance invariants are already in force at this version: the module is 100 % openCypher TCK-compliant at the execution level (3 897/3 897 scenarios, 16 006/16 006 steps) and 100 % ACID-compliant; CI is green (build, test, race, lint, vet, TCK, govulncheck). The module uses the conventional Go path github.com/FlavioCFOliveira/GoGraph and is fetchable with go get github.com/FlavioCFOliveira/GoGraph@v0.1.0. See CHANGELOG.md and release-notes/v0.1.0.md for the full release narrative.

Core graph (graph/)
  • github.com/FlavioCFOliveira/GoGraph/graph — generic node identifiers and the Graph[N, W] contract.
  • github.com/FlavioCFOliveira/GoGraph/graph/adjlist — mutable, sharded adjacency-list backend with copy-on-write snapshots and lock-free reads.
  • github.com/FlavioCFOliveira/GoGraph/graph/csr — immutable Compressed Sparse Row view for read-mostly analytics.
  • github.com/FlavioCFOliveira/GoGraph/graph/generation — atomic pointer swap for snapshot rotation across readers/writers.
  • github.com/FlavioCFOliveira/GoGraph/graph/lpg — Labelled Property Graph model (vertex and edge labels, typed properties; PropertyValue covers string, int64, float64, bool, time.Time, []byte).
  • github.com/FlavioCFOliveira/GoGraph/graph/lpg/schema — optional type schema with Validate.
  • github.com/FlavioCFOliveira/GoGraph/graph/indexManager coordinating named indexes and fanning out Change events to subscribers.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/label — Roaring-bitmap inverted label index.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/hash — sharded hash exact-match property index.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/btree — order-preserving range property index.
  • github.com/FlavioCFOliveira/GoGraph/graph/query — fluent MATCH-style pattern engine.
  • github.com/FlavioCFOliveira/GoGraph/graph/io/csv · graph/io/graphml · graph/io/dot · graph/io/jsonl — interchange formats for CSV, GraphML, DOT, and JSON Lines.
  • github.com/FlavioCFOliveira/GoGraph/ds — disjoint-set (union-find) primitive.
  • github.com/FlavioCFOliveira/GoGraph/search — traversal and path-finding algorithms (BFS, iterative DFS, Dijkstra, Bellman-Ford, A*, bidirectional BFS, Yen k-shortest, topological sort (Kahn), Tarjan SCC, biconnected components, Eulerian path, APSP).
  • github.com/FlavioCFOliveira/GoGraph/search/centrality — Brandes betweenness, PageRank, personalised PageRank.
  • github.com/FlavioCFOliveira/GoGraph/search/community — Leiden, label propagation.
  • github.com/FlavioCFOliveira/GoGraph/search/flow — Dinic, Edmonds-Karp, push-relabel, Stoer-Wagner, min-cost max-flow.
  • github.com/FlavioCFOliveira/GoGraph/search/extern — semi-external BFS and PageRank over Tier 2 csrfile readers.
Storage and persistence (store/)
  • github.com/FlavioCFOliveira/GoGraph/store/wal — Write-Ahead Log with CRC32C framing.
  • github.com/FlavioCFOliveira/GoGraph/store/snapshot — atomic on-disk snapshot directories.
  • github.com/FlavioCFOliveira/GoGraph/store/txn — single-writer transactional API (Begin/Commit/Rollback).
  • github.com/FlavioCFOliveira/GoGraph/store/checkpoint — background WAL → snapshot folder.
  • github.com/FlavioCFOliveira/GoGraph/store/recovery — snapshot + WAL replay on open.
  • github.com/FlavioCFOliveira/GoGraph/store/csrfile — mmap-backed Tier 2 CSR file format, writer, reader, Reinterpret zero-copy helper, deterministic fixture generator.
  • github.com/FlavioCFOliveira/GoGraph/store/bulk — high-throughput bulk loader bypassing the WAL.
Cypher engine (cypher/)
  • github.com/FlavioCFOliveira/GoGraph/cypher — openCypher-compatible parser, planner, and execution engine; WAL-durable writes via NewEngineWithStore.
  • github.com/FlavioCFOliveira/GoGraph/cypher/parser · cypher/ast · cypher/sema · cypher/ir · cypher/plan · cypher/exec — parser-to-execution pipeline with plan-cache, EXPLAIN/PROFILE, and dbhits accounting.
  • github.com/FlavioCFOliveira/GoGraph/cypher/funcs · cypher/procs — built-in functions and procedures.
  • github.com/FlavioCFOliveira/GoGraph/cypher/tck — openCypher TCK harness (parser 100 %, execution 100 % — 3 897/3 897 scenarios; see docs/tck/DIVERGENCES.md).
Bolt server (bolt/)
  • github.com/FlavioCFOliveira/GoGraph/bolt/proto · bolt/packstream — Bolt v5 protocol and PackStream encoding (v5.0–v5.6 preferred; v4.4 fallback).
  • github.com/FlavioCFOliveira/GoGraph/bolt/server — TCP server compatible with neo4j-go-driver v5 and cypher-shell, with TLS certificate hot-reload and graceful shutdown.

Subsystem references: docs/persistence.md (WAL, snapshots, recovery) · docs/tier2.md (csrfile) · docs/io.md (interchange formats) · docs/algorithms.md (algorithms catalogue) · docs/cypher.md (Cypher engine) · docs/bolt.md (Bolt server).

Examples

The examples/ directory contains 25 runnable demonstrations. See examples/README.md for the full categorized index with per-example links and run commands.

Basics
  • 01_basic — Dijkstra on a small European routing graph.
  • 02_property_graph — labels + typed properties + indexed query.
  • 03_advanced_algorithms — BFS, Dijkstra, Brandes betweenness, and PageRank composed over one CSR snapshot.
Persistence and out-of-core
  • 04_persistence — WAL transactions + recovery.
  • 05_out_of_core — Tier 2 csrfile + mmap + semi-external PageRank.
  • 17_transactional_log — WAL + background checkpointer + crash-recovery walk-through.
  • 18_oocore_pipeline — CSV → CSR → csrfile → mmap → semi-external BFS + PageRank.
  • 21_typed_recovery — generic recovery.Open[N, W] over an (int64, float64) graph with typed properties; round-trips through a v2 snapshot.
Cypher and Bolt
  • 22_cypher — Cypher execution engine social-graph demo: label scan with ORDER BY, WHERE filter, relationship pattern, and CREATE — values printed in human-readable form.
  • 23_bolt_server — Bolt v5 server round-trip: a real neo4j-go-driver v5 client runs a Cypher query over the wire, then the server shuts down cleanly with no goroutine leak.
  • 24_social_network_cli — interactive CLI over a persistent LPG social network (WAL + recovery + Cypher queries).
  • 25_software_house_api — multi-layer LPG REST API over a software-house domain (Code/Work/People entities).
Interchange
  • 06_csv_import — CSV read / write + JSON Lines.
  • 07_graphml_roundtrip — GraphML read / write + DOT.
Algorithms
  • 08_pagerank — PageRank on a directed authority web, ranking pages from most to least important with distinct ranks.
  • 09_leiden — community detection on two cliques + bridge.
  • 10_dimacs9_routing — DIMACS 9 synthetic road network + a concrete Dijkstra SSSP query with a reconstructed shortest path.
  • 14_routing_alternatives — Dijkstra, Yen k-shortest, and A* with a coordinate-based Euclidean heuristic that expands fewer nodes for the same optimal cost.
  • 15_task_assignment — Hungarian (cost-minimising) + Hopcroft-Karp (cardinality).
  • 16_centrality_analytics — Brandes betweenness + label propagation.
Real-world recipes
  • 11_social_network — labels + PageRank + Leiden + friend-of-friend recommendations.
  • 12_build_dependency — topological sort + Tarjan SCC for circular-dependency detection.
  • 13_network_reliability — Hopcroft-Tarjan SPOF analysis + max-flow with the limiting min-cut bottleneck, both over the same network.
  • 19_pattern_query — multi-hop MATCH-style queries combining labels and property predicates.
  • 20_concurrent_reads — multiple algorithms run concurrently over a shared immutable CSR.

Run any example with go run ./examples/<NAME>/.

Getting Started

package main

import (
	"fmt"

	"github.com/FlavioCFOliveira/GoGraph/graph/adjlist"
	"github.com/FlavioCFOliveira/GoGraph/graph/csr"
	"github.com/FlavioCFOliveira/GoGraph/search"
)

func main() {
	a := adjlist.New[string, int64](adjlist.Config{Directed: true})
	a.AddEdge("Lisbon", "Madrid", 624)
	a.AddEdge("Lisbon", "Paris", 1737)
	a.AddEdge("Madrid", "Paris", 1274)
	a.AddEdge("Madrid", "Rome", 1969)
	a.AddEdge("Paris", "Rome", 1422)

	c := csr.BuildFromAdjList(a)
	src, _ := a.Mapper().Lookup("Lisbon")

	d, err := search.Dijkstra(c, src)
	if err != nil {
		panic(err)
	}
	for _, city := range []string{"Madrid", "Paris", "Rome"} {
		id, _ := a.Mapper().Lookup(city)
		dist, _ := d.Distance(id)
		fmt.Printf("Lisbon -> %s : %d km\n", city, dist)
	}
}

Workflow

The project follows a strict Specify -> Implement -> Test -> Document workflow. Sprint planning lives in the local rmp CLI roadmap. The Makefile ci target runs the full validation pipeline:

make ci

The pipeline includes go mod tidy, gofmt, go vet, go build, go test, go test -race, and golangci-lint run. Every change must pass it before being committed.

Performance

Benchmarks (Apple M4, Go 1.26.3):

Operation Throughput
Mapper.Intern (hot key) 17 ns/op, 0 allocs
adjlist.HasEdge (hot cache) 49 ns/op, 0 allocs
csr.NeighboursByID 10.6 ns/op, 0 allocs
csr.BuildFromAdjList of 10^7 edges 51 ms
search.BFS on 10^7-node chain 38 ms, 1.25 MB peak, 0 allocs/call after warmup
search.Dijkstra on 1M-node / 4M-edge random graph 320 ms
search.BellmanFord on 16K-vertex / 64K-edge 1.8 ms

Measured on: 2026-05-22 against commit 1a2f00e, Apple M4 (10-core), Go 1.26.3, macOS 25.4.0 (darwin/arm64). Reproduce: make bench BENCH_PATTERN=. BENCH_COUNT=5 (see docs/profiling.md for the sample workflow). Per-run variance is captured by benchstat and the headline numbers above are the median of five runs at -count=5. Hardware deltas should be reported in CHANGELOG.md alongside any number that changes by more than the 5 % CI gate (benchstat regression gate in .github/workflows/ci.yml).

Module Layout

graph/                    — core types: NodeID, Graph[N,W] contract, sharded Mapper
graph/adjlist             — mutable copy-on-write adjacency list (writer-side)
graph/csr                 — immutable Compressed Sparse Row snapshot (reader-side)
graph/generation          — refcount-protected Publisher for atomic snapshot rotation
graph/lpg                 — labelled property graph (labels + typed properties)
graph/lpg/schema          — declarative type schema with Validate
graph/index               — Manager fanning out Change events to subscribers
graph/index/label         — Roaring-bitmap inverted label index
graph/index/hash          — sharded hash exact-match property index
graph/index/btree         — order-preserving range property index
graph/query               — fluent MATCH-style pattern engine
graph/io/csv              — edge-list CSV reader and writer
graph/io/graphml          — GraphML XML reader and writer
graph/io/dot              — Graphviz DOT writer
graph/io/jsonl            — JSON Lines reader and writer

search/                   — traversal and path-finding over CSR (BFS, DFS, Dijkstra,
                            Bellman-Ford, A*, BiBFS, Yen, APSP, BCC, Eulerian, ...)
search/centrality         — Brandes betweenness, PageRank, personalised PageRank
search/community          — Leiden, label propagation
search/extern             — semi-external BFS/PageRank over a Tier 2 reader
search/flow               — Dinic, Edmonds-Karp, push-relabel, Stoer-Wagner, MCMF

store/wal                 — versioned, CRC32C-checksummed Write-Ahead Log
store/snapshot            — atomic snapshot directories with manifest and per-file CRC
store/txn                 — single-writer transactions (Begin/Commit/Rollback)
store/checkpoint          — background WAL → snapshot folder goroutine
store/recovery            — snapshot + WAL replay on open
store/csrfile             — mmap'd Tier 2 CSR file format (versioned, 64-byte aligned)
store/bulk                — high-throughput bulk ingestion bypassing the WAL

ds/                       — supporting data structures (Union-Find, ...)

bench/ldbc                — LDBC SNB SF1 / SF10 benchmark harness
bench/dimacs9             — DIMACS 9 USA-road SSSP benchmark
bench/rmat                — RMAT power-law graph generator
bench/soak                — 4-hour mixed-workload reliability soak harness
bench/comparison          — cross-library performance comparison vs NetworkX

internal/metrics          — observability API hook (Backend, IncCounter, ObserveLatency, Time)
internal/stress           — concurrency stress test suite (CI under -race)
internal/shapegen         — graph shape generators (trivial, classic, random models, adversarial)
internal/invariants       — graph invariant checkers (connected, DAG, bipartite, distance bound)
internal/testfs           — FS fault-injection wrapper (ENOSPC, partial write, fsync delay)
internal/crashinject      — subprocess crash-injection harness (SIGKILL breakpoints)
internal/subproc          — cross-process test helper (re-exec, mode dispatch)
internal/goldens          — golden-file assertion helper with -update and atomic write

See [docs/test-battery.md](docs/test-battery.md) for the production-readiness
test battery guide and the add-new-shape recipe.

examples/                 — 25 runnable example programs (see "Examples" section)

Labelled Property Graph + Query Example

g := lpg.New[string, int64](adjlist.Config{Directed: true})
g.SetNodeLabel("alice", "Person")
g.SetNodeLabel("alice", "Admin")
g.SetNodeProperty("alice", "age", lpg.Int64Value(30))
g.AddEdge("alice", "bob", 1)

c := csr.BuildFromAdjList(g.AdjList())
e := query.New(g, c)

for _, n := range e.Match().Vertex(
    query.WithLabel[string, int64]("Admin"),
    query.WithProperty[string, int64]("age", lpg.Int64Value(30)),
).Collect() {
    fmt.Println(n)
}

Security

Vulnerability reports follow the process documented in SECURITY.md. Use GitHub Security Advisories or the private email listed there — please do not open a public issue for a suspected vulnerability.

License

GoGraph is distributed under the MIT License.

Documentation

Overview

Package gograph is a Go module for graph persistence, manipulation, and fast search.

The library scales from small in-memory graphs to graphs too large to fit in RAM, while remaining idiomatic, allocation-conscious, and safe under high load and high concurrency.

Subpackages provide the building blocks:

  • graph — core types, generic node identifiers, and graph interfaces.
  • graph/adjlist — mutable adjacency-list backend.
  • graph/csr — immutable compressed sparse row view for analytics.
  • graph/lpg — labelled property graph model (labels, typed properties).
  • graph/index — secondary indexes (label bitmap, hash, B+ tree).
  • graph/io — importers and exporters (CSV, GraphML, DOT, JSON Lines).
  • search — traversal and path-finding algorithms.
  • search/centrality, search/community, search/flow — analytics suites.
  • store — durable persistence (WAL, snapshots, mmap'd CSR).

Subpackages are added incrementally per the project roadmap; the present package documents the top-level module only.

Common tasks and their entrypoints

The following map points each common task at the function or type that starts it. Every link resolves to an exported symbol; follow it for the full signature and contract.

Build a labelled property graph:

  • [lpg.New] constructs a Graph[N, W]; add nodes, labels, typed properties, and edges through its methods.

Run a Cypher query:

  • [cypher.NewEngine] wraps an in-memory lpg.Graph[string, float64].
  • [cypher.Engine.Run] executes a query string with typed parameters.

Run durable, WAL-backed Cypher queries:

  • [cypher.NewEngineWithStore] binds the engine to a [txn.Store], so writes are journalled and survive a crash.

Pass parameters to a query:

  • [cypher.Engine.RunAny] accepts plain Go values as parameters.
  • [cypher.BindParams] converts a map of Go values into the typed parameter map that [cypher.Engine.Run] expects.

Find a shortest path (weighted):

  • [search.Dijkstra] for non-negative edge weights.
  • [search.AStar] when an admissible heuristic is available.

Traverse without weights:

  • [search.BFS] for breadth-first order and unweighted distances.
  • [search.DFS] for depth-first order.

Compute analytics:

  • [centrality.PageRank] for influence ranking.
  • [community.Leiden] (or [community.LabelPropagation]) for community detection; pair with [community.DefaultLeidenOptions].
  • [flow.MaxFlow] / [flow.MinCostMaxFlow] for network-flow problems.

Import and export graphs:

  • CSV: [csv.ReadInto] and [csv.Write].
  • GraphML: [graphml.ReadInto] / [graphml.ReadWithProps] and [graphml.Write] / [graphml.WriteWithProps].
  • JSON Lines: [jsonl.ReadInto] / [jsonl.ReadWithProps] and [jsonl.Write] / [jsonl.WriteWithProps].
  • DOT (export only): [dot.Write].

Persist and recover:

  • [wal.Open] opens a write-ahead log for appending frames.
  • [snapshot.WriteSnapshotFull] writes a full CSR-plus-labels snapshot to a directory.
  • [recovery.Open] reconstructs a graph from a snapshot and its WAL.

Serve the Bolt protocol:

  • [server.NewServer] starts a Bolt v5 server backed by a [cypher.Engine].

NodeID space, MaxNodeID, and live nodes

The graph.Mapper interns user keys into compact NodeIDs using a 256-way sharded layout; the shard index occupies the top byte of each NodeID. As a result MaxNodeID() typically rounds up well above the number of distinct keys, and analytical algorithms that allocate per-NodeID buffers (rank vectors, community-ID slices) produce slices of length MaxNodeID() with sentinel values in the "ghost" slots. Use graph/csr.CSR.LiveMask, LiveNodes, or LiveCount to iterate only the meaningful results.

See docs/maxnodeid.md for a worked example and recipes for translating live NodeIDs back to user keys via Mapper.Resolve.

Directories

Path Synopsis
bench
dimacs9
Package dimacs9 implements the harness that drives GoGraph against the DIMACS 9th Implementation Challenge shortest-paths workload.
Package dimacs9 implements the harness that drives GoGraph against the DIMACS 9th Implementation Challenge shortest-paths workload.
ldbc
Package ldbc implements the harness GoGraph uses against the LDBC Social Network Benchmark workloads.
Package ldbc implements the harness GoGraph uses against the LDBC Social Network Benchmark workloads.
rmat
Package rmat implements the RMAT (Recursive MATrix) generator of Chakrabarti, Zhan & Faloutsos (SDM 2004), used to produce power-law-shaped synthetic graphs that match the degree distributions observed in real-world social / web networks.
Package rmat implements the RMAT (Recursive MATrix) generator of Chakrabarti, Zhan & Faloutsos (SDM 2004), used to produce power-law-shaped synthetic graphs that match the degree distributions observed in real-world social / web networks.
soak command
cypher_rw.go — Cypher RW mixed-workload harness for the soak binary.
cypher_rw.go — Cypher RW mixed-workload harness for the soak binary.
bolt
packstream
Package packstream implements the PackStream binary serialisation format used by the Bolt protocol.
Package packstream implements the PackStream binary serialisation format used by the Bolt protocol.
proto
Package proto implements the Bolt v5 wire protocol message types, handshake negotiation, and chunked framing.
Package proto implements the Bolt v5 wire protocol message types, handshake negotiation, and chunked framing.
server
Package server implements the Bolt v5 TCP server for the GoGraph Cypher engine.
Package server implements the Bolt v5 TCP server for the GoGraph Cypher engine.
cmd
crashinject-helper command
Command crashinject-helper is the child process spawned by the crashinject harness during crash-injection tests.
Command crashinject-helper is the child process spawned by the crashinject harness during crash-injection tests.
fmtfixture command
Command fmtfixture regenerates the frozen on-disk fixtures used by the rolling-upgrade compatibility tests in store/wal, store/snapshot, and store/csrfile.
Command fmtfixture regenerates the frozen on-disk fixtures used by the rolling-upgrade compatibility tests in store/wal, store/snapshot, and store/csrfile.
Package cypher provides the public query engine API for the GoGraph Cypher executor.
Package cypher provides the public query engine API for the GoGraph Cypher executor.
ast
Package ast defines the Abstract Syntax Tree (AST) for openCypher 9.
Package ast defines the Abstract Syntax Tree (AST) for openCypher 9.
exec
Package exec implements the Volcano-style executor for the Cypher query engine.
Package exec implements the Volcano-style executor for the Cypher query engine.
explain
Package explain renders Cypher execution plans as human-readable text (EXPLAIN mode) and instruments them with per-operator execution statistics (PROFILE mode).
Package explain renders Cypher execution plans as human-readable text (EXPLAIN mode) and instruments them with per-operator execution statistics (PROFILE mode).
expr
Package expr defines the runtime value model for the Cypher executor.
Package expr defines the runtime value model for the Cypher executor.
funcs
Package funcs implements the built-in Cypher function registry.
Package funcs implements the built-in Cypher function registry.
ir
Package ir defines the logical plan intermediate representation (IR) for the Cypher query compiler.
Package ir defines the logical plan intermediate representation (IR) for the Cypher query compiler.
ir/rewrite
Package rewrite provides a rule-based logical-plan rewrite/optimisation framework for the Cypher IR.
Package rewrite provides a rule-based logical-plan rewrite/optimisation framework for the Cypher IR.
parser
Package parser translates the ANTLR4-generated Cypher parse tree into the typed AST defined in github.com/FlavioCFOliveira/GoGraph/cypher/ast.
Package parser translates the ANTLR4-generated Cypher parse tree into the typed AST defined in github.com/FlavioCFOliveira/GoGraph/cypher/ast.
parser/gen
Package gen contains the ANTLR4-generated lexer and parser for openCypher 9.
Package gen contains the ANTLR4-generated lexer and parser for openCypher 9.
plan
Package plan provides the cost-based planner for the Cypher executor.
Package plan provides the cost-based planner for the Cypher executor.
procs
Package procs defines the procedure registry for the Cypher executor.
Package procs defines the procedure registry for the Cypher executor.
sema
Package sema implements the scope-analysis pass for openCypher queries.
Package sema implements the scope-analysis pass for openCypher queries.
tck
Package tck records the conformance evolution of the GoGraph Cypher engine against the openCypher Technology Compatibility Kit.
Package tck records the conformance evolution of the GoGraph Cypher engine against the openCypher Technology Compatibility Kit.
Package ds provides small generic data-structure primitives that support gograph's algorithms but do not themselves model a graph.
Package ds provides small generic data-structure primitives that support gograph's algorithms but do not themselves model a graph.
examples
01_basic command
Example 01_basic — build a small weighted directed graph, snapshot it to a CSR view, and run a single-source shortest-paths query.
Example 01_basic — build a small weighted directed graph, snapshot it to a CSR view, and run a single-source shortest-paths query.
02_property_graph command
Example 02_property_graph — build a small labelled property graph, declare a schema, attach labels and typed properties, then run a MATCH-style indexed query and read the typed properties back.
Example 02_property_graph — build a small labelled property graph, declare a schema, attach labels and typed properties, then run a MATCH-style indexed query and read the typed properties back.
03_advanced_algorithms command
Example 03_advanced_algorithms — exercises BFS, Dijkstra, Brandes betweenness centrality, and PageRank on one small undirected graph.
Example 03_advanced_algorithms — exercises BFS, Dijkstra, Brandes betweenness centrality, and PageRank on one small undirected graph.
04_persistence command
Example 04_persistence — opens a WAL, performs a few transactions that include both node and edge labels, attaches typed properties directly on the in-memory graph, then takes a v2 snapshot (CSR + labels.bin + properties.bin) and demonstrates that labels and typed properties survive a restart.
Example 04_persistence — opens a WAL, performs a few transactions that include both node and edge labels, attaches typed properties directly on the in-memory graph, then takes a v2 snapshot (CSR + labels.bin + properties.bin) and demonstrates that labels and typed properties survive a restart.
05_out_of_core command
Example 05_out_of_core — writes a Tier 2 csrfile, opens it via mmap, applies a SEQUENTIAL access hint, and runs PageRank directly over the mapped region, then verifies the result against the graph's symmetry.
Example 05_out_of_core — writes a Tier 2 csrfile, opens it via mmap, applies a SEQUENTIAL access hint, and runs PageRank directly over the mapped region, then verifies the result against the graph's symmetry.
06_csv_import command
Example 06_csv_import — reads an edge-list CSV, builds the adjacency list, then writes it out as both CSV and JSON Lines.
Example 06_csv_import — reads an edge-list CSV, builds the adjacency list, then writes it out as both CSV and JSON Lines.
07_graphml_roundtrip command
Example 07_graphml_roundtrip — reads a GraphML document, prints the number of ingested edges, then writes the graph back out to both GraphML and DOT.
Example 07_graphml_roundtrip — reads a GraphML document, prints the number of ingested edges, then writes the graph back out to both GraphML and DOT.
08_pagerank command
Example 08_pagerank — runs PageRank on a small directed "authority" graph and prints each page's rank, sorted from most to least important.
Example 08_pagerank — runs PageRank on a small directed "authority" graph and prints each page's rank, sorted from most to least important.
09_leiden command
Example 09_leiden — runs Leiden community detection on two K4 cliques joined by a single bridge edge and prints the discovered communities.
Example 09_leiden — runs Leiden community detection on two K4 cliques joined by a single bridge edge and prints the discovered communities.
10_dimacs9_routing command
Example 10_dimacs9_routing — build a small synthetic road-network graph with the DIMACS 9 harness, run a concrete single-source shortest-paths query over it, and print an environment-dependent latency summary from the harness for flavour.
Example 10_dimacs9_routing — build a small synthetic road-network graph with the DIMACS 9 harness, run a concrete single-source shortest-paths query over it, and print an environment-dependent latency summary from the harness for flavour.
11_social_network command
Example 11_social_network — a small social-network application showing how to:
Example 11_social_network — a small social-network application showing how to:
12_build_dependency command
Example 12_build_dependency — model a software build dependency graph, derive the build order via topological sort, and detect circular dependencies with Tarjan SCC.
Example 12_build_dependency — model a software build dependency graph, derive the build order via topological sort, and detect circular dependencies with Tarjan SCC.
13_network_reliability command
Example 13_network_reliability — analyse the resilience of a single communication backbone two ways over ONE coherent network:
Example 13_network_reliability — analyse the resilience of a single communication backbone two ways over ONE coherent network:
14_routing_alternatives command
Example 14_routing_alternatives — compare three flavours of shortest-path computation on the same routing graph: classical Dijkstra, Yen's k-shortest for alternatives, and A* with a coordinate-based Euclidean heuristic.
Example 14_routing_alternatives — compare three flavours of shortest-path computation on the same routing graph: classical Dijkstra, Yen's k-shortest for alternatives, and A* with a coordinate-based Euclidean heuristic.
15_task_assignment command
Example 15_task_assignment — staff four workers onto four tasks two ways and compare the results: the Hungarian algorithm computes the globally cheapest one-to-one assignment, while Hopcroft-Karp computes the largest matching that respects a "willing to take" business rule.
Example 15_task_assignment — staff four workers onto four tasks two ways and compare the results: the Hungarian algorithm computes the globally cheapest one-to-one assignment, while Hopcroft-Karp computes the largest matching that respects a "willing to take" business rule.
16_centrality_analytics command
Example 16_centrality_analytics — analyse a small undirected network with two centrality metrics: Brandes betweenness (structural importance via shortest paths) and label propagation (cluster membership).
Example 16_centrality_analytics — analyse a small undirected network with two centrality metrics: Brandes betweenness (structural importance via shortest paths) and label propagation (cluster membership).
17_transactional_log command
Example 17_transactional_log — end-to-end durability walk-through with an ACID-safe background checkpointer.
Example 17_transactional_log — end-to-end durability walk-through with an ACID-safe background checkpointer.
18_oocore_pipeline command
Example 18_oocore_pipeline — out-of-core ingestion pipeline.
Example 18_oocore_pipeline — out-of-core ingestion pipeline.
19_pattern_query command
Example 19_pattern_query — build a labelled property graph with a declared schema, populate it, then run several MATCH-style queries combining label and property predicates plus a one-hop expansion.
Example 19_pattern_query — build a labelled property graph with a declared schema, populate it, then run several MATCH-style queries combining label and property predicates plus a one-hop expansion.
20_concurrent_reads command
Example 20_concurrent_reads — run three different read-only graph algorithms concurrently over one shared, immutable CSR snapshot.
Example 20_concurrent_reads — run three different read-only graph algorithms concurrently over one shared, immutable CSR snapshot.
21_typed_recovery command
Example 21_typed_recovery — demonstrates the canonical typed recovery API `recovery.Open[N, W]` against a non-string graph.
Example 21_typed_recovery — demonstrates the canonical typed recovery API `recovery.Open[N, W]` against a non-string graph.
22_cypher command
Example 22_cypher — the GoGraph Cypher engine, the module's flagship (100% openCypher TCK compliant at the execution level).
Example 22_cypher — the GoGraph Cypher engine, the module's flagship (100% openCypher TCK compliant at the execution level).
23_bolt_server command
Example 23_bolt_server starts a GoGraph Bolt v5 server backed by an in-memory labelled property graph, then drives a full client round-trip against it with the official neo4j-go-driver/v5.
Example 23_bolt_server starts a GoGraph Bolt v5 server backed by an in-memory labelled property graph, then drives a full client round-trip against it with the official neo4j-go-driver/v5.
24_social_network_cli command
Package main implements `24_social_network_cli`, an example one-shot CLI that demonstrates how to build, persist and query a labelled property graph for a social-network domain using GoGraph.
Package main implements `24_social_network_cli`, an example one-shot CLI that demonstrates how to build, persist and query a labelled property graph for a social-network domain using GoGraph.
25_software_house_api command
Command 25_software_house_api is a persistent REST WebAPI that demonstrates how to build, query and mutate a multi-layer Labeled Property Graph (LPG) with GoGraph in a production-shaped service.
Command 25_software_house_api is a persistent REST WebAPI that demonstrates how to build, query and mutate a multi-layer Labeled Property Graph (LPG) with GoGraph in a production-shaped service.
Package graph defines the core types and interfaces shared by every backend in the gograph module.
Package graph defines the core types and interfaces shared by every backend in the gograph module.
adjlist
Package adjlist provides a mutable, sharded adjacency-list backend for the gograph module.
Package adjlist provides a mutable, sharded adjacency-list backend for the gograph module.
csr
Package csr provides an immutable Compressed Sparse Row (CSR) view of a graph for read-mostly analytical workloads.
Package csr provides an immutable Compressed Sparse Row (CSR) view of a graph for read-mostly analytical workloads.
generation
Package generation publishes immutable graph snapshots (typically csr.CSR views) under a refcount-protected pointer so readers can observe a consistent generation while a new one is being prepared in the background.
Package generation publishes immutable graph snapshots (typically csr.CSR views) under a refcount-protected pointer so readers can observe a consistent generation while a new one is being prepared in the background.
index
Package index coordinates the secondary indexes attached to a labelled property graph.
Package index coordinates the secondary indexes attached to a labelled property graph.
index/btree
Package btree provides an order-preserving property index over a constraints.Ordered value type, answering range predicates against the NodeIDs that carry each value.
Package btree provides an order-preserving property index over a constraints.Ordered value type, answering range predicates against the NodeIDs that carry each value.
index/hash
Package hash provides a sharded hash index from arbitrary comparable property values to the set of NodeIDs that carry them, represented as a 64-bit Roaring bitmap.
Package hash provides a sharded hash index from arbitrary comparable property values to the set of NodeIDs that carry them, represented as a 64-bit Roaring bitmap.
index/label
Package label provides a Roaring-bitmap-backed inverted index from label identifiers to the NodeIDs that carry them.
Package label provides a Roaring-bitmap-backed inverted index from label identifiers to the NodeIDs that carry them.
io/csv
Package csv reads and writes graphs as edge lists in CSV format.
Package csv reads and writes graphs as edge lists in CSV format.
io/dot
Package dot writes graphs in the Graphviz DOT format (https://graphviz.org/doc/info/lang.html).
Package dot writes graphs in the Graphviz DOT format (https://graphviz.org/doc/info/lang.html).
io/graphml
Package graphml reads and writes graphs in the GraphML XML dialect (http://graphml.graphdrawing.org/).
Package graphml reads and writes graphs in the GraphML XML dialect (http://graphml.graphdrawing.org/).
io/jsonl
Package jsonl reads and writes graphs in newline-delimited JSON (NDJSON / JSON Lines) format.
Package jsonl reads and writes graphs in newline-delimited JSON (NDJSON / JSON Lines) format.
lpg
Package lpg implements the Labelled Property Graph model on top of the github.com/FlavioCFOliveira/GoGraph/graph/adjlist mutable adjacency-list backend.
Package lpg implements the Labelled Property Graph model on top of the github.com/FlavioCFOliveira/GoGraph/graph/adjlist mutable adjacency-list backend.
lpg/schema
Package schema declares the optional type schema for a labelled property graph: which labels exist, which property keys exist, and which [PropertyKind] each property carries.
Package schema declares the optional type schema for a labelled property graph: which labels exist, which property keys exist, and which [PropertyKind] each property carries.
query
Package query provides a fluent, type-safe programmatic API for expressing MATCH-style pattern queries against a labelled property graph snapshot.
Package query provides a fluent, type-safe programmatic API for expressing MATCH-style pattern queries against a labelled property graph snapshot.
internal
crashinject
Package crashinject provides a subprocess-based crash-injection harness for deterministic crash-safety testing of WAL, snapshot, and checkpoint write paths.
Package crashinject provides a subprocess-based crash-injection harness for deterministic crash-safety testing of WAL, snapshot, and checkpoint write paths.
crashpoint
Package crashpoint holds the production-callable half of the crash-injection machinery: the Breakpoint hook and the environment variables that drive it.
Package crashpoint holds the production-callable half of the crash-injection machinery: the Breakpoint hook and the environment variables that drive it.
goldens
Package goldens provides a uniform golden-file assertion helper for tests that compare byte-for-byte output against stored fixtures.
Package goldens provides a uniform golden-file assertion helper for tests that compare byte-for-byte output against stored fixtures.
invariants
Package invariants provides hardened assertion helpers for graph property-based tests.
Package invariants provides hardened assertion helpers for graph property-based tests.
metrics
Package metrics is GoGraph's optional observability surface.
Package metrics is GoGraph's optional observability surface.
metrics/prometheus
Package prometheus provides a [metrics.Backend] implementation that produces Prometheus-compatible text exposition output — with no dependency on github.com/prometheus/client_golang.
Package prometheus provides a [metrics.Backend] implementation that produces Prometheus-compatible text exposition output — with no dependency on github.com/prometheus/client_golang.
shapegen
Package shapegen defines a uniform contract for graph-shape generators used across property-based tests, golden corpora, and benchmarks in GoGraph.
Package shapegen defines a uniform contract for graph-shape generators used across property-based tests, golden corpora, and benchmarks in GoGraph.
subproc
Package subproc provides a deterministic subprocess helper for cross-process tests.
Package subproc provides a deterministic subprocess helper for cross-process tests.
testfs
Package testfs provides a fault-injection wrapper around *os.File for use in crash-safety and durability tests of WAL, snapshot, and checkpoint paths.
Package testfs provides a fault-injection wrapper around *os.File for use in crash-safety and durability tests of WAL, snapshot, and checkpoint paths.
testlayers
Package testlayers gates tests by execution layer.
Package testlayers gates tests by execution layer.
Package search provides graph traversal and path-finding algorithms over the immutable github.com/FlavioCFOliveira/GoGraph/graph/csr.CSR read-only view.
Package search provides graph traversal and path-finding algorithms over the immutable github.com/FlavioCFOliveira/GoGraph/graph/csr.CSR read-only view.
centrality
Package centrality implements vertex importance metrics.
Package centrality implements vertex importance metrics.
community
Package community implements community detection algorithms for undirected graphs.
Package community implements community detection algorithms for undirected graphs.
extern
Package extern provides graph algorithms that operate directly on a Tier 2 (mmap-backed) csrfile.Reader without first materialising the CSR in memory.
Package extern provides graph algorithms that operate directly on a Tier 2 (mmap-backed) csrfile.Reader without first materialising the CSR in memory.
flow
Package flow implements network-flow algorithms over directed capacitated graphs.
Package flow implements network-flow algorithms over directed capacitated graphs.
store
bulk
Package bulk implements the bulk-loading path that bypasses the transactional WAL stack and writes a Tier 2 csrfile directly from a stream of edges.
Package bulk implements the bulk-loading path that bypasses the transactional WAL stack and writes a Tier 2 csrfile directly from a stream of edges.
checkpoint
Package checkpoint runs a background goroutine that periodically folds the WAL tail into a fresh snapshot and truncates the WAL.
Package checkpoint runs a background goroutine that periodically folds the WAL tail into a fresh snapshot and truncates the WAL.
csrfile
Package csrfile defines the on-disk binary format used by GoGraph's Tier 2 (out-of-core, mmap-backed) CSR storage.
Package csrfile defines the on-disk binary format used by GoGraph's Tier 2 (out-of-core, mmap-backed) CSR storage.
recovery
Package recovery rebuilds the in-memory graph state from a snapshot (when present) plus the WAL tail, and exposes the harness used to fuzz crash semantics in tests.
Package recovery rebuilds the in-memory graph state from a snapshot (when present) plus the WAL tail, and exposes the harness used to fuzz crash semantics in tests.
snapshot
Package snapshot serialises the durable on-disk representation of a gograph snapshot (CSR + LPG + schema) and reads it back into a fresh process.
Package snapshot serialises the durable on-disk representation of a gograph snapshot (CSR + LPG + schema) and reads it back into a fresh process.
txn
Package txn provides the transactional surface (Begin / Commit / Rollback) layered over an lpg.Graph and a wal.Writer.
Package txn provides the transactional surface (Begin / Commit / Rollback) layered over an lpg.Graph and a wal.Writer.
wal
Package wal implements a versioned, length-prefixed, CRC32C-checksummed Write-Ahead Log for the gograph durability stack.
Package wal implements a versioned, length-prefixed, CRC32C-checksummed Write-Ahead Log for the gograph durability stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL