Loading...
Searching...
No Matches
clscons_consnamelevenshtein.cpp
Go to the documentation of this file.
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
51#define CLSCONS_DESC "constraint names (according to levenshtein distance graph)" /**< short description of classification*/
152 gcg::ConsPartition* classifier = new gcg::ConsPartition(gcg, classifierName.str().c_str(), 0, detprobdata->getNConss());
158 SCIPverbMessage(origprob, SCIP_VERBLEVEL_HIGH, NULL, " skipped levenshtein distance based constraint classes calculating since number of constraints %d exceeds limit %d \n", detprobdata->getNConss(), nmaxconss );
163 std::vector<std::vector<int>> levenshteindistances(detprobdata->getNConss(), std::vector<int>( detprobdata->getNConss(), - 1 ));
176 levenshteindistances[i][j] = calcLevenshteinDistance(consnamesToCompare[i], consnamesToCompare[j]);
201 /* consider all constraints which are connected to the current constraint by means of levenshtein distance */
227 text << "This class contains all constraints with a name similar to \"" << consnamesToCompare[firstUnreached] << "\".";
228 classifier->addClass(consnamesToCompare[firstUnreached].c_str(), text.str().c_str(), gcg::BOTH);
237 SCIPverbMessage(origprob, SCIP_VERBLEVEL_HIGH, NULL, " Consclassifier levenshtein: connectivity of %d yields a classification with %d different constraint classes. \n", connectivity, currentClass + 1);
254 GCGincludeConsClassifier(gcg, CLSCONS_NAME, CLSCONS_DESC, CLSCONS_PRIORITY, CLSCONS_ENABLED, classifierdata,
class representing a partition of a set of constraints
class storing partialdecs and the problem matrix
Definition class_conspartition.h:60
GCG_EXPORT void assignConsToClass(int consindex, int classindex)
Definition class_conspartition.cpp:81
GCG_EXPORT int addClass(const char *name, const char *desc, CONS_DECOMPINFO decompInfo)
Definition class_conspartition.cpp:72
Definition class_detprobdata.h:110
GCG_EXPORT int getNConss()
returns the number of variables considered in the detprobdata
Definition class_detprobdata.cpp:850
GCG_EXPORT void addConsPartition(ConsPartition *partition)
adds a constraint partition if it is no duplicate of an existing constraint partition
Definition class_detprobdata.cpp:553
GCG_EXPORT SCIP_CONS * getCons(int consIndex)
returns the SCIP constraint related to a constraint index
Definition class_detprobdata.cpp:746
SCIP_RETCODE GCGincludeConsClassifierConsnameLevenshtein(GCG *gcg)
Definition clscons_consnamelevenshtein.cpp:247
int calcLevenshteinDistance(std::string s, std::string t)
Definition clscons_consnamelevenshtein.cpp:82
classifies constraints according to levenshtein distance graph of their names
DETPROBDATA * GCGconshdlrDecompGetDetprobdataPresolved(GCG *gcg)
help method to access detprobdata for transformed problem
Definition cons_decomp.cpp:3976
DETPROBDATA * GCGconshdlrDecompGetDetprobdataOrig(GCG *gcg)
help method to access detprobdata for unpresolved problem
Definition cons_decomp.cpp:3962
SCIP_RETCODE GCGincludeConsClassifier(GCG *gcg, const char *name, const char *description, int priority, SCIP_Bool enabled, GCG_CLASSIFIERDATA *classifierdata, GCG_DECL_FREECONSCLASSIFIER((*freeClassifier)),)
includes one constraint classifier
Definition cons_decomp.cpp:2494
constraint handler for structure detection
C++ interface of cons_decomp.
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
const char * SCIPconsGetName(SCIP_CONS *cons)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
#define NULL
Definition class_conspartition.cpp:44
various SCIP helper methods
SCIP_VERBLEVEL_HIGH
SCIP_ERROR
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP