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

Use CoinBronKerbosch::PivotingStrategy enum #108

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions src/CglBKClique/CglBKClique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "CglBKClique.hpp"
#include "CoinConflictGraph.hpp"
#include "CoinStaticConflictGraph.hpp"
#include "CoinBronKerbosch.hpp"
#include "CoinCliqueList.hpp"
#include "CoinCliqueExtender.hpp"
#include "CoinCutPool.hpp"
Expand All @@ -38,8 +37,8 @@ double CglBKClique::sepTime_ = 0.0;

static void *xmalloc( const size_t size );

CglBKClique::CglBKClique() : cap_(0), maxCallsBK_(1000),
extMethod_(4), minFrac_(0.001), minViol_(0.02), pivotingStrategy_(3)
CglBKClique::CglBKClique() : cap_(0), minFrac_(0.001), minViol_(0.02),
pivotingStrategy_(CoinBronKerbosch::PivotingStrategy::Weight), extMethod_(4), maxCallsBK_(1000)
{
minWeight_ = floor(BKCLQ_MULTIPLIER + (minViol_ * BKCLQ_MULTIPLIER));
vertexWeight_ = NULL;
Expand Down Expand Up @@ -394,7 +393,7 @@ void CglBKClique::setMinViol(const double minViol){
minWeight_ = BKCLQ_MULTIPLIER + (minViol_ * BKCLQ_MULTIPLIER);
}

void CglBKClique::setPivotingStrategy(const size_t pivotingStrategy) {
void CglBKClique::setPivotingStrategy(const CoinBronKerbosch::PivotingStrategy pivotingStrategy) {
pivotingStrategy_ = pivotingStrategy;
}

Expand Down
9 changes: 4 additions & 5 deletions src/CglBKClique/CglBKClique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define _CglBKClique_h_

#include <CglCutGenerator.hpp>
#include "CoinBronKerbosch.hpp"

class CoinCliqueList;
class CoinConflictGraph;
Expand Down Expand Up @@ -119,11 +120,9 @@ class CGLLIB_EXPORT CglBKClique : public CglCutGenerator {
void setMinViol(const double minViol);

/**
* Set the pivoting strategy used in BK algorithm:
* 0 = off; 1 = random; 2 = degree; 3 = weight; 4 = modified degree;
* 5 = modified weight; 6 = modified degree + modified weight.
* Set the pivoting strategy used in BK algorithm
**/
void setPivotingStrategy(const size_t pivotingStrategy);
void setPivotingStrategy(const CoinBronKerbosch::PivotingStrategy pivotingStrategy);

/**
* Number of cuts separated.
Expand Down Expand Up @@ -221,7 +220,7 @@ class CGLLIB_EXPORT CglBKClique : public CglCutGenerator {
/**
* Pivoting strategy employed in the BK algorithm.
**/
size_t pivotingStrategy_;
CoinBronKerbosch::PivotingStrategy pivotingStrategy_;

/**
* Strategy used to extend cliques.
Expand Down
Loading