Skip to content

Commit

Permalink
Generalised cliques never really worked and were purged from
Browse files Browse the repository at this point in the history
CglProbing in r970.  The logical follow-on is that CglTreeProbingInfo
is no longer needed. This commit separates CglTreeProbingInfo from
CglTreeInfo and then removes it.  There's a lot of collateral damage to
repair. CglGeneralisedClique.hpp is needed to repair the one remaining
use of generalised cliques in CglKnapsackCover. A lot of touchup editing
remains, but this version builds and runs the miplib set.
  • Loading branch information
LouHafer committed Feb 24, 2011
1 parent 1f40567 commit 15efc38
Show file tree
Hide file tree
Showing 21 changed files with 1,300 additions and 4,590 deletions.
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ inc/config_cgl.h.in -text
/install-sh -text
/ltmain.sh -text
/missing -text
src/CglGeneralisedClique.hpp -text
src/CglLandP/CglLandP.cpp -text
src/CglLandP/CglLandP.hpp -text
src/CglLandP/CglLandPMessages.cpp -text
Expand All @@ -60,16 +61,12 @@ src/CglLandP/CglLandPValidator.cpp -text
src/CglLandP/CglLandPValidator.hpp -text
src/CglLandP/Makefile.am -text
src/CglLandP/Makefile.in -text
src/CglProbing/CglImplication.cpp -text
src/CglProbing/CglImplication.hpp -text
src/CglProbing/CglProbingDebug.cpp -text
src/CglProbing/CglProbingDebug.hpp -text
src/CglProbing/CglProbingProbe.cpp -text
src/CglProbing/CglProbingRowCut.cpp -text
src/CglProbing/CglProbingRowCut.hpp -text
src/CglProbing/CglProbingTighten.cpp -text
src/CglTreeProbingInfo.cpp -text
src/CglTreeProbingInfo.hpp -text
test/CglTestData/capPlan1.mps -text
test/CglTestData/egout.mps -text
test/CglTestData/l152lav.mps -text
7 changes: 7 additions & 0 deletions src/CglClique/CglClique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,11 @@ CglClique::generateCpp( FILE * fp)
return "clique" ;
}
/*****************************************************************************/
#ifdef CGL_FAKE_CLIQUE

/*
This is used only by some disabled code in CbcModel::branchAndBound.
*/

#include "../CglProbing/CglProbing.hpp"
CglFakeClique::CglFakeClique(OsiSolverInterface * solver, bool setPacking) :
Expand Down Expand Up @@ -903,3 +908,5 @@ CglFakeClique::generateCuts(const OsiSolverInterface& si, OsiCuts & cs,
CglClique::generateCuts(si,cs,info) ;
}
}

#endif // CGL_FAKE_CLIQUE
10 changes: 9 additions & 1 deletion src/CglClique/CglClique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,22 @@ class CglClique : public CglCutGenerator {
void CglCliqueUnitTest(const OsiSolverInterface * siP,
const std::string mpdDir);


#ifdef CGL_FAKE_CLIQUE

class CglProbing;
/*! This works on a fake solver i.e. invented rows
In more words, you can load in an Osi (#fakeSolver_) of your choosing.
When the #generateCuts method is called, the loaded Osi is used, if
present. If it's not present, then the si supplied as a parameter to
#generatCuts will be used. If it, too, is absent, things will end badly.
#generateCuts will be used. If it, too, is absent, things will end badly.
CglFakeClique also conceals a CglProbing object, which is invoked iff the
loaded Osi is used.
Disabled as of 110224 as I try to clean out suspect / partially implemented
code related to generalised cliques. -- lh, 110224 --
*/
class CglFakeClique : public CglClique {

Expand Down Expand Up @@ -427,4 +433,6 @@ class CglFakeClique : public CglClique {
mutable CglProbing * probing_;
};

#endif // CGL_FAKE_CLIQUE

#endif
63 changes: 63 additions & 0 deletions src/CglGeneralisedClique.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

// $Id$
// Copyright (C) 2000, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).

#ifndef CglGeneralisedClique_H
#define CglGeneralisedClique_H

/*
The content of this file doesn't really justify its existence. It's more of
a placeholder. Eventually, generalised cliques need to be reimplemented
properly. When that happens, the associated structures should be defined
here.
At the time this file was created, only CglKnapsackCover has active code
that uses generalised cliques. All of the code in CglProbing associated
with generalised cliques has been removed. All of the code in CglPreProcess
associated with generalised cliques is disabled. In general, look for the
symbol CLIQUE_ANALYSIS to find related code in other projects.
-- lh, 110224 --
*/

/*! \brief Utility structure to encode clique information.
The only purpose is to hide the details of the encoding. The msb of #fixes
is set to 1 if setting the variable to 1 fixes all other variables in the
clique, 0 if setting the variable to 0 fixes all other variables in the
clique. The remaining 31 bits are the index of the variable.
*/
typedef struct {
//unsigned int oneFixed:1; // nonzero if variable to 1 fixes all
//unsigned int sequence:31; // variable (in matrix) (but also see cliqueRow_)
/// Encoded: msb indicates strong-0/strong-1, remaining bits are index.
unsigned int fixes;
} cliqueEntry;

/*! \brief Extract the index from the clique entry
\related cliqueEntry
*/
inline int sequenceInCliqueEntry(const cliqueEntry & cEntry)
{ return cEntry.fixes&0x7fffffff;}

/*! \brief Set the index in the clique entry
\related cliqueEntry
*/
inline void setSequenceInCliqueEntry(cliqueEntry & cEntry,int sequence)
{ cEntry.fixes = sequence|(cEntry.fixes&0x80000000);}

/*! \brief Mark the entry as strong-1
\related cliqueEntry
*/
inline bool oneFixesInCliqueEntry(const cliqueEntry & cEntry)
{ return (cEntry.fixes&0x80000000)!=0;}

/*! \brief Mark the entry as strong-0
\related cliqueEntry
*/
inline void setOneFixesInCliqueEntry(cliqueEntry & cEntry,bool oneFixes)
{ cEntry.fixes = (oneFixes ? 0x80000000 : 0)|(cEntry.fixes&0x7fffffff);}

#endif
1 change: 1 addition & 0 deletions src/CglKnapsackCover/CglKnapsackCover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "CglCutGenerator.hpp"
#include "CglTreeInfo.hpp"
#include "CglGeneralisedClique.hpp"

/** Knapsack Cover Cut Generator Class */
class CglKnapsackCover : public CglCutGenerator {
Expand Down

0 comments on commit 15efc38

Please sign in to comment.