yog/generators
Graph generators for creating various types of graphs.
This module provides convenient re-exports of graph generation functions from specialized sub-modules:
yog/generators/classic- Deterministic graph patterns (complete, cycle, path, star, etc.)yog/generators/random- Stochastic graph models (Erdős-Rényi, Barabási-Albert, Watts-Strogatz, etc.)
Quick Start
import yog/generators
pub fn main() {
// Generate classic patterns
let complete = generators.complete(5)
let cycle = generators.cycle(6)
let tree = generators.binary_tree(3)
// Generate random graphs
let random = generators.erdos_renyi_gnp(100, 0.05)
let scale_free = generators.barabasi_albert(100, 3)
let small_world = generators.watts_strogatz(100, 4, 0.1)
}
For more specialized generators, import the specific module:
import yog/generators/classic
import yog/generators/random
let petersen = classic.petersen()
let er_graph = random.erdos_renyi_gnm(50, 100)
Values
pub const barabasi_albert: fn(Int, Int) -> model.Graph(Nil, Int)
pub const barabasi_albert_with_type: fn(Int, Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const binary_tree: fn(Int) -> model.Graph(Nil, Int)
pub const binary_tree_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const complete: fn(Int) -> model.Graph(Nil, Int)
pub const complete_bipartite: fn(Int, Int) -> model.Graph(
Nil,
Int,
)
pub const complete_bipartite_with_type: fn(
Int,
Int,
model.GraphType,
) -> model.Graph(Nil, Int)
pub const complete_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const cycle: fn(Int) -> model.Graph(Nil, Int)
pub const cycle_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const empty: fn(Int) -> model.Graph(Nil, Int)
pub const empty_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const erdos_renyi_gnm: fn(Int, Int) -> model.Graph(Nil, Int)
pub const erdos_renyi_gnm_with_type: fn(Int, Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const erdos_renyi_gnp: fn(Int, Float) -> model.Graph(Nil, Int)
pub const erdos_renyi_gnp_with_type: fn(
Int,
Float,
model.GraphType,
) -> model.Graph(Nil, Int)
pub const grid_2d: fn(Int, Int) -> model.Graph(Nil, Int)
pub const grid_2d_with_type: fn(Int, Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const path: fn(Int) -> model.Graph(Nil, Int)
pub const path_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const petersen: fn() -> model.Graph(Nil, Int)
pub const petersen_with_type: fn(model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const random_tree: fn(Int) -> model.Graph(Nil, Int)
pub const random_tree_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const star: fn(Int) -> model.Graph(Nil, Int)
pub const star_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)
pub const watts_strogatz: fn(Int, Int, Float) -> model.Graph(
Nil,
Int,
)
pub const watts_strogatz_with_type: fn(
Int,
Int,
Float,
model.GraphType,
) -> model.Graph(Nil, Int)
pub const wheel: fn(Int) -> model.Graph(Nil, Int)
pub const wheel_with_type: fn(Int, model.GraphType) -> model.Graph(
Nil,
Int,
)