Skip to content

Commit

Permalink
fix: failing endtoend test on empty graph
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSeemaier committed May 31, 2024
1 parent 0a5d307 commit 2628781
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 4 additions & 1 deletion kaminpar-shm/initial_partitioning/bipartitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class Bipartitioner {
PartitionedCSRGraph
bipartition(StaticArray<BlockID> partition, StaticArray<BlockWeight> block_weights) {
if (_graph->n() == 0) {
return {};
block_weights[0] = 0;
block_weights[1] = 0;

return {*_graph, 2, std::move(partition), std::move(block_weights)};
}

_partition = std::move(partition);
Expand Down
10 changes: 0 additions & 10 deletions kaminpar-shm/initial_partitioning/pool_bipartitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ class PoolBipartitioner {
_best_feasible = false;
_best_cut = std::numeric_limits<EdgeWeight>::max();
_best_imbalance = 0.0;

// @todo this should not be necessary:
//
// std::fill(_current_partition.begin(), _current_partition.end(), 0);
// std::fill(_best_partition.begin(), _best_partition.end(), 0);
//
// _best_block_weights[0] = 0;
// _best_block_weights[1] = 0;
// _current_block_weights[0] = 0;
// _current_block_weights[1] = 0;
}

PartitionedCSRGraph bipartition() {
Expand Down

0 comments on commit 2628781

Please sign in to comment.