Skip to main content

chromatic_number_greedy

Function chromatic_number_greedy 

Source
pub fn chromatic_number_greedy(coloring: &[u32]) -> u32
Expand description

Count the number of colors used in a coloring.

ยงExamples

use rust_igraph::{Graph, greedy_coloring, chromatic_number_greedy};

let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let c = greedy_coloring(&g).unwrap();
assert_eq!(chromatic_number_greedy(&c), 3);