Skip to content

Commit 64ed090

Browse files
committed
update OrbitGraphProcessor
1 parent 46d3205 commit 64ed090

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

include/osp/dag_divider/isomorphism_divider/EftSubgraphScheduler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class EftSubgraphScheduler {
5050

5151
private:
5252

53-
static constexpr bool verbose = true;
53+
static constexpr bool verbose = false;
5454

5555
using job_id_t = vertex_idx_t<Graph_t>;
5656

include/osp/dag_divider/isomorphism_divider/IsomorphicSubgraphScheduler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class IsomorphicSubgraphScheduler {
3636

3737
private:
3838

39-
static constexpr bool verbose = true;
39+
static constexpr bool verbose = false;
4040

4141
size_t symmetry_ = 2;
4242
Scheduler<Constr_Graph_t> * bsp_scheduler_;

include/osp/dag_divider/isomorphism_divider/OrbitGraphProcessor.hpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,31 @@ class OrbitGraphProcessor {
293293
for (VertexType i = 0; i < induced_subgraph.num_vertices(); ++i) {
294294
out_new_subgraphs[components[i]].push_back(all_nodes[i]);
295295
}
296-
return num_components >= symmetry_threshold_;
296+
297+
if (num_components < symmetry_threshold_) {
298+
return false;
299+
}
300+
301+
// 3. Verify that all new components are isomorphic and have the same size.
302+
if (num_components > 1) {
303+
const size_t first_sg_size = out_new_subgraphs[0].size();
304+
Constr_Graph_t rep_sg;
305+
create_induced_subgraph(original_dag, rep_sg, out_new_subgraphs[0]);
306+
307+
for (size_t i = 1; i < num_components; ++i) {
308+
if (out_new_subgraphs[i].size() != first_sg_size) {
309+
return false;
310+
}
311+
312+
Constr_Graph_t current_sg;
313+
create_induced_subgraph(original_dag, current_sg, out_new_subgraphs[i]);
314+
if (!are_isomorphic_by_merkle_hash(rep_sg, current_sg)) {
315+
return false;
316+
}
317+
}
318+
}
319+
320+
return true;
297321
}
298322

299323
public:

0 commit comments

Comments
 (0)