Skip to content

Commit

Permalink
fix: endless loop in initial ggg bipartitioner (#37)
Browse files Browse the repository at this point in the history
The initial greedy graph growing bipartitioner could get stuck in an
endless loop if the perfectly balanced block weight of one block is set
to 0. To fix this, change < to <=.
  • Loading branch information
DanielSeemaier authored Nov 28, 2024
1 parent 57d66c8 commit c2bd9af
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void InitialGGGBipartitioner::fill_bipartition() {
if (_marker.get(start_node)) {
start_node = _marker.first_unmarked_element();
}
KASSERT(start_node < _graph->n(), "no unmarked node found");

_queue.push(start_node, compute_gain(start_node));
_marker.set<true>(start_node);
Expand Down Expand Up @@ -86,7 +87,7 @@ void InitialGGGBipartitioner::fill_bipartition() {
}
});
}
} while (_block_weights[V2] < _p_ctx->block_weights.perfectly_balanced(V2));
} while (_block_weights[V2] <= _p_ctx->block_weights.perfectly_balanced(V2));
}

[[nodiscard]] EdgeWeight InitialGGGBipartitioner::compute_gain(const NodeID u) const {
Expand Down

0 comments on commit c2bd9af

Please sign in to comment.