Skip to main content

random_grid

Function random_grid 

Source
pub fn random_grid<const N: usize>(
    width: u32,
    height: u32,
    seed: u64,
) -> (BenchmarkGraph<N>, Query)
Expand description

A random-cost grid Grid_N (Section 4.3): a four-connected width × height grid, every directed edge with N independent costs uniform in 1..=10, plus a source joined to every cell of the leftmost column and a target joined from every cell of the rightmost one, with costs from the same distribution. Cell (x, y) is state y · width + x; the source and target are the last two states, and the query is theirs. The paper uses widths and heights in {300, 350, ..., 600}.

§Panics

Panics if width or height is zero, or the grid does not fit u32 states.