pub fn full_citation(n: u32, directed: bool) -> IgraphResult<Graph>Expand description
Build the full citation graph on n vertices.
See the module documentation for the precise semantics of the
directed flag.
§Errors
IgraphError::InvalidArgument— then·(n−1)/2edge count cannot be sized inusize(computed viausize::checked_mulso the failure mode is deterministic).
§Examples
use rust_igraph::full_citation;
// Directed complete DAG on 4 vertices: 6 arcs forming a transitive
// closure where vertex i cites every j < i.
let dag = full_citation(4, true).unwrap();
assert_eq!(dag.vcount(), 4);
assert_eq!(dag.ecount(), 6);
assert!(dag.is_directed());
// Undirected → K_n (same edge multiset as full_graph(4, false, false)).
let k4 = full_citation(4, false).unwrap();
assert_eq!(k4.vcount(), 4);
assert_eq!(k4.ecount(), 6);
assert!(!k4.is_directed());