Skip to main content

problemreductions/rules/
kcoloring_casts.rs

1//! Variant reductions for KColoring.
2
3use crate::impl_variant_reduction;
4use crate::models::graph::KColoring;
5use crate::topology::SimpleGraph;
6use crate::variant::{K3, KN};
7
8impl_variant_reduction!(
9    KColoring,
10    <K3, SimpleGraph> => <KN, SimpleGraph>,
11    fields: [num_vertices, num_edges, num_colors],
12    |src| KColoring::with_k(src.graph().clone(), src.num_colors())
13);
14
15crate::register_aggregate_reduction!(
16    crate::rules::VariantReductionResult<KColoring<K3, SimpleGraph>, KColoring<KN, SimpleGraph>>
17);