pub fn wheel_graph(n: u32, mode: WheelMode, center: u32) -> IgraphResult<Graph>Expand description
Build a wheel graph on n vertices with the given center and arc
policy mode.
See the module-level docs for the precise role of each mode and the degenerate two/three-vertex shapes.
§Errors
IgraphError::InvalidArgument—center >= nforn > 0(the spoke layer rejects it viastar_graph).IgraphError::Internal— implied rim edge count would overflowusize(only reachable on 32-bit targets with absurdly largen).
§Examples
use rust_igraph::{wheel_graph, WheelMode};
// Undirected wheel W6 (5 rim vertices around centre 0).
let w = wheel_graph(6, WheelMode::Undirected, 0).unwrap();
assert_eq!(w.vcount(), 6);
assert_eq!(w.ecount(), 2 * (6 - 1)); // 5 spokes + 5 rim edges
assert!(!w.is_directed());