Skip to content

Commit

Permalink
CoinDynamicConflictGraph: processing large cliques first
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbrito committed Apr 6, 2020
1 parent fa68b22 commit 9acb3b2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/CoinDynamicConflictGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,11 @@ CoinDynamicConflictGraph::CoinDynamicConflictGraph (
} // not explicit clique
} // all rows

// at this point large cliques will already be include
this->largeClqs->computeNodeOccurrences( size_ );

size_t iniRowSize = 32;
conflicts = new CoinAdjacencyVector(numCols*2, iniRowSize);

/* inserting trivial conflicts: variable-complement */
for (size_t i = 0; i < (size_t)numCols; i++) {
/* inserting trivial conflicts: variable-complement */
const bool isBinary = ((colType[i] != 0) && (colLB[i] == 1.0 || colLB[i] == 0.0)
&& (colUB[i] == 0.0 || colUB[i] == 1.0));
if (isBinary) { //consider only binary variables
Expand All @@ -281,6 +278,14 @@ CoinDynamicConflictGraph::CoinDynamicConflictGraph (
}
}

//detecting cliques in less-structured constraints
for ( size_t idxTR =0 ; (idxTR<tnRows ) ; ++idxTR ) {
cliqueDetection( &tRowElements[tRowStart[idxTR]], tRowStart[idxTR+1]-tRowStart[idxTR], tRowRHS[idxTR] );
}

// at this point large cliques will already be include
this->largeClqs->computeNodeOccurrences( size_ );

// processing small cliques
if (smallCliques->nCliques())
{
Expand All @@ -303,12 +308,8 @@ CoinDynamicConflictGraph::CoinDynamicConflictGraph (
} // small cliques
delete smallCliques;
smallCliques = NULL;

for ( size_t idxTR =0 ; (idxTR<tnRows ) ; ++idxTR )
cliqueDetection( &tRowElements[tRowStart[idxTR]], tRowStart[idxTR+1]-tRowStart[idxTR], tRowRHS[idxTR] );

conflicts->flush();

recomputeDegree();

delete[] columns;
Expand Down

0 comments on commit 9acb3b2

Please sign in to comment.