Skip to content

Commit

Permalink
Use CoinBronKerbosch::PivotingStrategy enum
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre authored and tkralphs committed Aug 13, 2024
1 parent c94b0e8 commit a39161a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
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

0 comments on commit a39161a

Please sign in to comment.