#[reduction]Expand description
Attribute macro for automatic reduction registration.
This macro parses a ReduceTo impl block and automatically generates
the corresponding inventory::submit! call with the correct metadata.
§Type Parameter Convention
The macro extracts graph and weight type information from type parameters:
Problem<G>whereGis a graph type - extracts graph type nameProblem<G, W>whereWis a weight type - weighted if W != Unweighted
§Example
ⓘ
#[reduction(
source_graph = "SimpleGraph",
target_graph = "GridGraph",
source_weighted = false,
target_weighted = true,
)]
impl ReduceTo<IndependentSet<i32, GridGraph>> for IndependentSet<Unweighted, SimpleGraph> {
type Result = ReductionISToGridIS;
fn reduce_to(&self) -> Self::Result { ... }
}The macro also supports inferring from type names when explicit attributes aren’t provided.