Skip to content

Commit

Permalink
remove another effectless parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Maas committed Sep 12, 2024
1 parent e888028 commit 6dda387
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
6 changes: 1 addition & 5 deletions mt-kahypar/io/command_line_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,9 @@ namespace mt_kahypar {
"<size_t>")->default_value(16),
"Number of sub-rounds used for deterministic coarsening.")
("c-two-hop-required-similarity",
po::value<double>(&context.coarsening.twin_required_similarity)->value_name(
po::value<double>(&context.coarsening.two_hop_required_similarity)->value_name(
"<double>")->default_value(0.75),
"Required neighborhood similarity for two-hop coarsening.")
("c-two-hop-reduced-similarity",
po::value<double>(&context.coarsening.twin_reduced_required_similarity)->value_name(
"<double>")->default_value(0.4),
"Required neighborhood similarity for two-hop coarsening if no other contractions are possible.")
("c-degree-one-node-cluster-size",
po::value<HypernodeID>(&context.coarsening.degree_one_node_cluster_size)->value_name(
"<int>")->default_value(4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ class TwoHopClustering {
};

// insert degree one nodes and candidates for twins into buckets
const double required_similarity = cc.contract_aggressively ?
_context.coarsening.twin_reduced_required_similarity : _context.coarsening.twin_required_similarity;
const double required_similarity = cc.contract_aggressively ? 0.0 : _context.coarsening.two_hop_required_similarity;
tbb::parallel_for(ID(0), hg.initialNumNodes(), [&](const HypernodeID id) {
ASSERT(id < node_mapping.size());
const HypernodeID hn = node_mapping[id];
Expand Down Expand Up @@ -147,10 +146,9 @@ class TwoHopClustering {
};
auto accept_contraction = [&](const HypernodeID u, const HypernodeID v) { // TODO: lazy evalution
bool accept_community = cc.may_ignore_communities || (hg.communityID(u) == hg.communityID(v));
bool weight_allowed = cc.clusterWeight(u) + hg.nodeWeight(v) <= _context.coarsening.max_allowed_node_weight;
bool accept_similarity = similarity_policy.acceptContraction(hg, _context, u, v);
// TODO fixed vertices
return accept_community && weight_allowed && accept_similarity;
// Note: cluster weight and fixed vertices are checked by `matchVertices`
return accept_community && accept_similarity;
};

tbb::enumerable_thread_specific<HypernodeID> matched_d1_nodes(0);
Expand Down
3 changes: 1 addition & 2 deletions mt-kahypar/partition/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ struct CoarseningParameters {
size_t num_sub_rounds_deterministic = 16;

// Two-Hop Coarsening
double twin_required_similarity = 0.75;
double twin_reduced_required_similarity = 0.4;
double two_hop_required_similarity = 0.5;
HypernodeID degree_one_node_cluster_size = 4;
size_t two_hop_degree_threshold = 100;

Expand Down

0 comments on commit 6dda387

Please sign in to comment.