dimacs9

package
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: 8 Imported by: 0

Documentation

Overview

Package dimacs9 implements the harness that drives GoGraph against the DIMACS 9th Implementation Challenge shortest-paths workload.

The official DIMACS datasets (.gr/.co files) are external; the harness in v1 ingests a synthetic road-network-shaped graph generated by Synthetic for reproducible CI runs. The query loop runs Dijkstra from a sequence of seed vertices and records per-call latency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Synthetic

func Synthetic(ctx context.Context, v, e uint64) (*adjlist.AdjList[uint32, int64], error)

Synthetic builds a directed weighted adjacency list approximating a road network: every vertex points to its two next-numbered neighbours and one random shortcut, with int64 edge weights derived deterministically from the endpoint indices. Returns the partially-built adjlist on any adjlist.AdjList error so callers can observe how far ingestion progressed before failure.

Types

type Report

type Report struct {
	IngestTime time.Duration
	BuildTime  time.Duration
	Latencies  []time.Duration
}

Report is the result of a benchmark run.

func Run

func Run(ctx context.Context, spec Spec) Report

Run executes the benchmark and returns a Report. Errors surfaced by Synthetic cause the run to abort with an empty Report; the caller is expected to surface them through its own logging.

func (Report) Percentile

func (r Report) Percentile(p float64) time.Duration

Percentile returns the latency at the given fractional rank (0.5 = median, 0.95 = p95). r.Latencies must be sorted.

type Spec

type Spec struct {
	Vertices uint64
	Edges    uint64
	Queries  int
}

Spec parameterises a benchmark run.

func Default

func Default() Spec

Default returns the SF1-like preset (24K vertices, 60K edges, 100 queries) — small enough to run quickly in CI but representative of the road-network structure.

Jump to

Keyboard shortcuts

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