pub fn star_graph(n: u32, mode: StarMode, center: u32) -> IgraphResult<Graph>Expand description
Build a star graph on n vertices with the given center and arc
policy mode.
See the module-level docs for the precise role of each mode.
§Errors
IgraphError::InvalidArgument—center >= nforn > 0.IgraphError::Internal— implied edge count would overflowusize(only reachable on 32-bit targets with absurdly largen).
§Examples
use rust_igraph::{star_graph, StarMode};
// Undirected star with 5 leaves around vertex 0.
let s = star_graph(6, StarMode::Undirected, 0).unwrap();
assert_eq!(s.vcount(), 6);
assert_eq!(s.ecount(), 5);
assert!(!s.is_directed());