pub fn greedy_coloring_largest_first(graph: &Graph) -> IgraphResult<Vec<u32>>Expand description
Greedy coloring with largest-first (LF) ordering.
Processes vertices in decreasing degree order (ties broken by vertex id). Often produces better colourings than natural order.
ยงExamples
use rust_igraph::{Graph, greedy_coloring_largest_first};
// Cycle C_5: chromatic number is 3
let g = Graph::from_edges(
&[(0,1),(1,2),(2,3),(3,4),(4,0)], false, Some(5)
).unwrap();
let c = greedy_coloring_largest_first(&g).unwrap();
let num_colors = *c.iter().max().unwrap() + 1;
assert!(num_colors <= 3);