Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert broken ggg fix, check whether there are any more nodes to #38

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void InitialGGGBipartitioner::fill_bipartition() {
Random &rand = Random::instance();

do {
// find random unmarked node -- if too many attempts fail, take the first
// Find random unmarked node -- if too many attempts fail, take the first
// unmarked node in sequence
NodeID start_node = 0;
std::size_t counter = 0;
Expand All @@ -51,7 +51,9 @@ void InitialGGGBipartitioner::fill_bipartition() {
if (_marker.get(start_node)) {
start_node = _marker.first_unmarked_element();
}
KASSERT(start_node < _graph->n(), "no unmarked node found");
if (start_node >= _graph->n()) {
break;
}

_queue.push(start_node, compute_gain(start_node));
_marker.set<true>(start_node);
Expand Down Expand Up @@ -87,7 +89,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