internal/bench/bench_utils

Types

Graph density configurations

pub type GraphDensity {
  Sparse
  MediumDensity
  Dense
}

Constructors

  • Sparse
  • MediumDensity
  • Dense

Graph size configurations for benchmarking

pub type GraphSize {
  Small
  Medium
  Large
  XLarge
}

Constructors

  • Small
  • Medium
  • Large
  • XLarge

Values

pub fn bipartite_graph(
  left_nodes: Int,
  right_nodes: Int,
) -> model.Graph(Nil, Int)

Generate a bipartite graph for matching benchmarks

pub fn complete_graph(nodes: Int) -> model.Graph(Nil, Int)

Generate a complete graph for worst-case testing

pub fn density_to_probability(density: GraphDensity) -> Float
pub fn format_time(microseconds: Float) -> String

Format benchmark results for display

pub fn graph_stats(graph: model.Graph(a, b)) -> #(Int, Int)

Extract graph statistics for reporting

pub fn grid_graph(
  width: Int,
  height: Int,
) -> model.Graph(Nil, Int)

Generate a grid graph (useful for pathfinding benchmarks)

pub fn random_dag(nodes: Int, seed: Int) -> model.Graph(Nil, Int)

Generate a DAG for topological sort benchmarks

pub fn random_graph(
  size: GraphSize,
  density: GraphDensity,
  seed: Int,
) -> model.Graph(Nil, Int)

Generate a random graph for benchmarking

pub fn size_to_nodes(size: GraphSize) -> Int
Search Document