@@ -55,51 +55,6 @@ impl ReduceTo<MaximumIndependentSet<KingsSubgraph, One>>
5555 }
5656}
5757
58- /// Result of reducing MIS<SimpleGraph, One> to MIS<KingsSubgraph, i32>.
59- #[ derive( Debug , Clone ) ]
60- pub struct ReductionISSimpleOneToGridWeighted {
61- target : MaximumIndependentSet < KingsSubgraph , i32 > ,
62- mapping_result : ksg:: MappingResult < ksg:: KsgTapeEntry > ,
63- }
64-
65- impl ReductionResult for ReductionISSimpleOneToGridWeighted {
66- type Source = MaximumIndependentSet < SimpleGraph , One > ;
67- type Target = MaximumIndependentSet < KingsSubgraph , i32 > ;
68-
69- fn target_problem ( & self ) -> & Self :: Target {
70- & self . target
71- }
72-
73- fn extract_solution ( & self , target_solution : & [ usize ] ) -> Vec < usize > {
74- self . mapping_result . map_config_back ( target_solution)
75- }
76- }
77-
78- #[ reduction(
79- overhead = {
80- num_vertices = "num_vertices * num_vertices" ,
81- num_edges = "num_vertices * num_vertices" ,
82- }
83- ) ]
84- impl ReduceTo < MaximumIndependentSet < KingsSubgraph , i32 > >
85- for MaximumIndependentSet < SimpleGraph , One >
86- {
87- type Result = ReductionISSimpleOneToGridWeighted ;
88-
89- fn reduce_to ( & self ) -> Self :: Result {
90- let n = self . graph ( ) . num_vertices ( ) ;
91- let edges = self . graph ( ) . edges ( ) ;
92- let result = ksg:: map_unweighted ( n, & edges) ;
93- let weights = result. node_weights . clone ( ) ;
94- let grid = result. to_kings_subgraph ( ) ;
95- let target = MaximumIndependentSet :: new ( grid, weights) ;
96- ReductionISSimpleOneToGridWeighted {
97- target,
98- mapping_result : result,
99- }
100- }
101- }
102-
10358#[ cfg( test) ]
10459#[ path = "../unit_tests/rules/maximumindependentset_gridgraph.rs" ]
10560mod tests;
0 commit comments