Scippy

GCG

Branch-and-Price & Column Generation for Everyone

dec_hrgpartition.cpp
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* GCG --- Generic Column Generation */
5/* a Dantzig-Wolfe decomposition based extension */
6/* of the branch-cut-and-price framework */
7/* SCIP --- Solving Constraint Integer Programs */
8/* */
9/* Copyright (C) 2010-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file dec_hrgpartition.cpp
30 *
31 * @brief arrowhead and bordered detector via graph partitioning (uses hmetis)
32 * @author Martin Bergner
33 *
34 * Detects arrowhead (double bordered) decompositions as well as decompositions
35 * with only linking variables or linking constraints.
36 *
37 * This detector needs hmetis and works only under Linux/MacOS, it further needs the Z-shell (zsh)
38 * to enforce memory and time limits on hmetis as this is the only shell reliably doing that.
39 */
40
41/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
42/* #define SCIP_DEBUG */
43
45
46#if !defined(_WIN32) && !defined(_WIN64)
47#include <cassert>
48#include <cstring>
49#include <cerrno>
50#include <unistd.h>
51#include <iostream>
52#include <vector>
53#include <algorithm>
54#include <queue>
55
56#ifdef HMETIS_HEADER
57#include "gcg/hmetis.h"
58#else
59#define HMETIS_EXECUTABLE "hmetis"
60#endif
61
62#include "gcg/cons_decomp.h"
63#include "gcg/struct_decomp.h"
64#include "gcg/pub_decomp.h"
65#include "gcg/scip_misc.h"
66#include "scip/pub_misc.h"
67#include "scip/cons_linear.h"
68#include "scip/cons_setppc.h"
69#include "graph/matrixgraph.h"
70#include "graph/hyperrowgraph.h"
71#include "graph/graph_tclique.h"
72#include "graph/weights.h"
75#include "scip/clock.h"
76
77
78#include <set>
79
82using gcg::Weights;
83
84#define DEC_NAME "hrgpartition" /**< name of the detector */
85#define DEC_DESC "enforces arrowhead structures using graph partitioning" /**< description of detector */
86#define DEC_FREQCALLROUND 1 /**< frequency the detector gets called in detection loop ,ie it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0 */
87#define DEC_MAXCALLROUND 0 /**< last round the detector gets called */
88#define DEC_MINCALLROUND 0 /**< first round the detector gets called */
89#define DEC_FREQCALLROUNDORIGINAL 1 /**< frequency the detector gets called in detection loop while detecting the original problem */
90#define DEC_MAXCALLROUNDORIGINAL 0 /**< last round the detector gets called while detecting the original problem */
91#define DEC_MINCALLROUNDORIGINAL 0 /**< first round the detector gets called while detecting the original problem */
92#define DEC_PRIORITY 1000 /**< priority of the detector */
93#define DEC_DECCHAR 'r' /**< display character of detector */
94#define DEC_ENABLED FALSE /**< should detector be called by default */
95#define DEC_ENABLEDFINISHING FALSE /**< should the finishing be enabled */
96#define DEC_ENABLEDPOSTPROCESSING FALSE /**< should the postprocessing be enabled */
97#define DEC_SKIP FALSE /**< should detector be skipped if others found detections */
98#define DEC_USEFULRECALL TRUE /**< is it useful to call this detector on a descendant of the propagated partialdec */
99
100
101/* Default parameter settings */
102#define DEFAULT_VARWEIGHT 1 /**< weight for variable nodes */
103#define DEFAULT_VARWEIGHTBIN 2 /**< weight for binary variable nodes */
104#define DEFAULT_VARWEIGHTINT 2 /**< weight for integer variable nodes */
105#define DEFAULT_VARWEIGHTIMPL 2 /**< weight for implicit integer variable nodes */
106#define DEFAULT_VARWEIGHTCONT 1 /**< weight for continous variable nodes */
107#define DEFAULT_CONSWEIGHT 5 /**< weight for constraint hyperedges */
108#define DEFAULT_RANDSEED 1 /**< random seed for the hmetis call */
109#define DEFAULT_TIDY TRUE /**< whether to clean up afterwards */
110#define DEFAULT_DUMMYNODES 0.2 /**< percentage of dummy vertices*/
111#define DEFAULT_CONSWEIGHT_SETPPC 5 /**< weight for constraint hyperedges that are setpartitioning or covering
112 constraints */
113
114#define DEFAULT_LIMITNCONSSNVARSDEFAULT 10000 /**< limit for sum of nvars and nconss for enabling this detector in default */
115#define DEFAULT_ENABLEDFORLARGEPROBLEMS FALSE /** should this detector be enabled even the limit nconssnvars is exceeded */
116
117#define DEFAULT_MAXNBLOCKCANDIDATES 3 /**< number of block number candidates to be considered */
118#define DEFAULT_ALPHA 0.0 /**< factor for standard deviation of constraint weights */
119#define DEFAULT_BETA 0.5 /**< factor of how the weight for equality and inequality constraints is
120 distributed (keep 1/2 for the same on both) */
121#define DEFAULT_METIS_UBFACTOR 5.0 /**< default unbalance factor given to metis on the commandline */
122#define DEFAULT_METIS_VERBOSE FALSE /**< should metis be verbose */
123#define DEFAULT_METISUSEPTYPE_RB TRUE /**< Should metis use the rb or kway partitioning algorithm */
124#define DEFAULT_REALNAME FALSE /**< whether the metis name should be real or temporary */
125#define DEFAULT_TYPE 'r' /**< type of the decomposition 'c' column hypergraph (single bordered, no
126 linking constraints), 'r' row hypergraph (single bordered, no linking
127 variables) and 'a' column-row hypergraph (arrowhead) */
128#define DEFAULT_FALLBACK_NBLOCKS 8
129#define SET_MULTIPLEFORSIZETRANSF 12500
130
131/*
132 * Data structures
133 */
134
135/** private detector data */
136struct GCG_DetectorData
137{
138
139 /* weight parameters */
140 int varWeight; /**< weight of a variable hyperedge */
141 int varWeightBinary; /**< weight of a binary variable hyperedge */
142 int varWeightContinous; /**< weight of a continuous variable hyperedge */
143 int varWeightInteger; /**< weight of an integer variable hyperedge */
144 int varWeightImplint; /**< weight of an implicit integer variable hyperedge */
145 int consWeight; /**< weight of a constraint hyperedge */
146 int consWeightSetppc; /**< weight of a setppc constraint hyperedge */
147 SCIP_Real alpha; /**< factor for constraint coefficient value standard deviation */
148 SCIP_Real beta; /**< factor for equality od inequality constraints */
149
150 /* general parameters */
151 SCIP_Real dummynodes; /**< percent of dummy nodes */
152 SCIP_Bool tidy; /**< whether tempory metis files should be cleaned up */
153 int limitnconssnvarsdefault; /**< limit for sum of nvars and nconss for enabling this detector in default*/
155
156 int maxnblockcandidates; /**< maximal number of block canddidates to test */
157
158 /* metis parameters */
159 int randomseed; /**< metis random seed */
160 SCIP_Real metisubfactor; /**< metis unbalance factor */
161 SCIP_Bool metisverbose; /**< should metis ouput be displayed */
162 SCIP_Bool metisuseptyperb; /**< flag to indicate whether metis uses kway or rb partitioning */
163 SCIP_Bool realname; /**< flag to indicate real problem name or temporary filename for metis files */
164
165 /* various data */
166 SCIP_Bool found; /**< indicates whethere a decomposition has been found */
167 char type; /**< type of the decomposition 'c' column hypergraph (single bordered, no linking
168 constraints), 'r' row hypergraph (single bordered, no linking variables) and
169 'a' column-row hypergraph (arrowhead) */
170};
171
172
173
174
175/*
176 * Local methods
177 */
178
179/* put your local methods here, and declare them static */
180
181
182
183/** destructor of detector to free user data (called when GCG is exiting) */
184static
185GCG_DECL_FREEDETECTOR(freeHrgpartition)
186{
187 GCG_DETECTORDATA* detectordata;
188
189 assert(gcg != NULL);
190
191 detectordata = GCGdetectorGetData(detector);
192 assert(detectordata != NULL);
193 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
194
195 SCIPfreeMemory(GCGgetOrigprob(gcg), &detectordata);
196
197 return SCIP_OKAY;
198}
199
200
201
202/** detector initialization method */
203static
204GCG_DECL_INITDETECTOR(initHrgpartition)
205{
206 assert(gcg != NULL);
207
208 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
209
210 return SCIP_OKAY;
211}
212
213/** presolving deinitialization method of presolver (called after presolving has been finished) */
214static
215GCG_DECL_EXITDETECTOR(exitHrgpartition)
216{
217
218 assert(gcg != NULL);
219
220 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
221
222
223 return SCIP_OKAY;
224}
225
226/** will call hmetis via a system call */
227static
229 GCG* gcg, /**< GCG data struture */
230 GCG_DETECTORDATA* detectordata, /**< presolver data data structure */
231 MatrixGraph<gcg::GraphTclique>* graph, /**< the graph of the matrix */
232 char tempfile[SCIP_MAXSTRLEN], /**< filename for the metis input file */
233 int nblocks, /**< number of blocks */
234 SCIP_RESULT* result /**< result indicating whether the detection was successful */
235 )
236{
237 char metiscall[SCIP_MAXSTRLEN];
238 char metisout[SCIP_MAXSTRLEN];
239 SCIP_CLOCK* metisclock;
240 SCIP* scip;
241
242 int status;
243
244 SCIP_Real remainingtime;
245
246 assert(scip != NULL);
247 assert(detectordata != NULL);
248
249 *result = SCIP_DIDNOTRUN;
250
252 remainingtime = GCGgetRemainingTime(gcg);
253 SCIP_CALL( SCIPcreateWallClock(scip, &metisclock) );
254
255 if( remainingtime <= 0 )
256 {
257 return SCIP_OKAY;
258 }
259
260 /* call metis via syscall as there is no library usable ... */
262 {
263 (void) SCIPsnprintf(metiscall, SCIP_MAXSTRLEN, "zsh -c \"ulimit -t %.0f;" HMETIS_EXECUTABLE " %s %d -seed %d -ptype %s -ufactor %f %s\"",
264 remainingtime,
265 tempfile,
266 nblocks,
267 detectordata->randomseed,
268 detectordata->metisuseptyperb ? "rb" : "kway",
269 detectordata->metisubfactor,
270 detectordata->metisverbose ? "" : "> /dev/null" );
271 }
272 else
273 {
274 (void) SCIPsnprintf(metiscall, SCIP_MAXSTRLEN, "zsh -c \"" HMETIS_EXECUTABLE " %s %d -seed %d -ptype %s -ufactor %f %s\"",
275 tempfile,
276 nblocks,
277 detectordata->randomseed,
278 detectordata->metisuseptyperb ? "rb" : "kway",
279 detectordata->metisubfactor,
280 detectordata->metisverbose ? "" : "> /dev/null" );
281 }
282
283 SCIP_CALL( SCIPstartClock(scip, metisclock) );
284 SCIPdebugMessage("Calling metis with: %s\n", metiscall);
286 status = system(metiscall);
287
288 SCIP_CALL( SCIPstopClock(scip, metisclock) );
289 SCIPdebugMessage("time left before metis started: %f, time metis spend %f, remainingtime: %f\n", remainingtime, SCIPgetClockTime(scip, metisclock), remainingtime-SCIPgetClockTime(scip, metisclock) );
290
291 SCIP_CALL( SCIPfreeClock(scip, &metisclock) );
292
293 /* check error codes */
294 if( status == -1 )
295 {
296 SCIPerrorMessage("System call did not succed: %s\n", strerror( errno ));
297 SCIPerrorMessage("Call was %s\n", metiscall);
298 }
299 else if( status != 0 )
300 {
301
302 SCIPerrorMessage("Calling hmetis unsuccessful! See the above error message for more details.\n");
303 SCIPerrorMessage("Call was %s\n", metiscall);
304 }
305
306 /* exit gracefully in case of errors */
307 if( status != 0 )
308 {
309 return SCIP_ERROR;
310 }
311
312 (void) SCIPsnprintf(metisout, SCIP_MAXSTRLEN, "%s.part.%d", tempfile, nblocks);
313 SCIP_CALL( graph->readPartition(metisout) );
314
315 /* if desired delete the temoprary metis file */
316 if( detectordata->tidy )
317 {
318 status = remove( metisout );
319 if( status == -1 )
320 {
321 SCIPerrorMessage("Could not remove metis output file: %s\n", strerror( errno ));
322 return SCIP_WRITEERROR;
323 }
324 }
325 else
326 {
327 SCIPinfoMessage(scip, NULL, "Temporary file is in: %s\n", tempfile);
328 }
329 *result = SCIP_SUCCESS;
330 return SCIP_OKAY;
331}
332
333/** creates the temporary metis input file */
334static
336 GCG* gcg, /**< GCG data struture */
337 GCG_DETECTORDATA* detectordata, /**< detector data structure */
338 int partialdecID, /**< ID of partial decomposition to be used */
339 MatrixGraph<gcg::GraphTclique>* graph, /**< the graph of the matrix */
340 char tempfile[SCIP_MAXSTRLEN] /**< filename for the metis input file */
341
342 )
343{
344 int nvertices;
345 int ndummyvertices;
346 int fd;
348 nvertices = graph->getNNonzeroes();
349 /*lint --e{524}*/
350 ndummyvertices = SCIPceil(scip, detectordata->dummynodes*nvertices);
351 graph->setDummynodes(ndummyvertices);
352
353 if( !detectordata->realname )
354 {
355 (void) SCIPsnprintf(tempfile, SCIP_MAXSTRLEN, "gcg-%c-%d.metis.XXXXXX", DEC_DECCHAR, partialdecID );
356 }
357 else
358 {
359 (void) SCIPsnprintf(tempfile, SCIP_MAXSTRLEN, "gcg-%s-%s-%c.metis.XXXXXX", SCIPgetProbName(scip), DEC_DECCHAR, partialdecID);
360 }
361
362 fd = mkstemp(tempfile);
363
364 SCIP_CALL( graph->writeToFile(fd, TRUE) );
365 close(fd);
366 return SCIP_OKAY;
367}
368
369/** @returns whether the hyperrolgraph is connected */
370static
372 gcg::DETPROBDATA* detprobdata,
373 gcg::PARTIALDECOMP* partialdec
374 )
375{
376 std::vector<int> queue;
377 std::vector<int> visited;
378 std::vector<bool> inqueue(detprobdata->getNVars(), false);
379 std::vector<bool> isvisited(detprobdata->getNVars(), false);
380 int start = -1;
381
382 if(partialdec->getNOpenvars() < 2)
383 return false;
384
385 start = partialdec->getOpenvars()[0];
386 queue.push_back(start);
387 inqueue[start] = true;
388 do
389 {
390 int node = queue[0];
391 queue.erase(queue.begin());
392 inqueue[node] = false;
393 visited.push_back(node);
394 isvisited[node] = true;
395 for( int c = 0; c < detprobdata->getNConssForVar(node); ++c )
396 {
397 int cons = detprobdata->getConssForVar(node)[c];
398 if(!partialdec->isConsOpencons(cons))
399 continue;
400 for( int v = 0; v < detprobdata->getNVarsForCons(cons); ++v )
401 {
402 int var = detprobdata->getVarsForCons(cons)[v];
403 if( !partialdec->isVarOpenvar(var) )
404 continue;
405 if( isvisited[var] )
406 continue;
407 if( inqueue[var] )
408 continue;
409 queue.push_back(var);
410 inqueue[var] = true;
411 }
412 }
413 } while( !queue.empty() );
414
415 if((int)visited.size() != partialdec->getNOpenvars())
416 return false;
417 else
418 return true;
419}
420
421/** detection function for partialdecs */
422static
424 GCG* gcg, /**< GCG data structure */
425 GCG_DETECTORDATA* detectordata, /**< detectordata of the detector */
426 Partialdec_Detection_Data* partialdecdetectiondata, /**< partialdecdetectiondata (including the detprobdata) where to store the new Partialdecs */
427 gcg::PARTIALDECOMP* partialdec, /**< partialdec to propagate */
428 bool allowopenpartialdecs, /**< whether new partialdecs should be stored in which this detector only assignes conss to master */
429 SCIP_RESULT* result /**< pointer where to store the result */
430)
431{
432 /* add hrgpartition presolver parameters */
433 char decinfo[SCIP_MAXSTRLEN];
434 int maxnblockcandidates;
435 int k;
436 int j;
437 int s;
438 gcg::PARTIALDECOMP** newpartialdecs;
439 SCIP_CLOCK* clock;
440 SCIP_CLOCK* temporaryClock;
441 std::vector<SCIP_Real> clockTimes; /* vector containing times in seconds */
442
443 /* Graph stuff for hmetis */
444 MatrixGraph<gcg::GraphTclique>* graph; /* the graph of the matrix */
445 char tempfile[SCIP_MAXSTRLEN]; /**< filename for the metis input file */
447
450
451 *result = SCIP_DIDNOTFIND;
452
453 std::vector<int> numberOfBlocks;
454 partialdecdetectiondata->detprobdata->getSortedCandidatesNBlocks(numberOfBlocks);
455 if( numberOfBlocks.empty() )
456 numberOfBlocks.push_back(DEFAULT_FALLBACK_NBLOCKS);
457
458 SCIP_CALL( SCIPgetIntParam(scip, "detection/detectors/hrgpartition/maxnblockcandidates", &maxnblockcandidates) );
459
460 maxnblockcandidates = MIN(maxnblockcandidates, (int) numberOfBlocks.size() );
461
462 SCIPdebugMessage("number of block numbers to test: %d\n", maxnblockcandidates);
463
464 assert(scip != NULL);
465 assert(detectordata != NULL);
466
467 SCIPdebugMessage("Detecting structure from %s\n", DEC_NAME);
468
469 /* allocate space for output data */
470 SCIP_CALL( SCIPallocMemoryArray(scip, &(newpartialdecs), 2 * maxnblockcandidates));
471
472 /* build the hypergraph structure from the original problem */
473
474 Weights w(detectordata->varWeight, detectordata->varWeightBinary, detectordata->varWeightContinous,detectordata->varWeightInteger,detectordata->varWeightInteger,detectordata->consWeight);
476
477 SCIP_CALL( graph->createFromPartialMatrix(partialdecdetectiondata->detprobdata, partialdec) );
478 SCIP_CALL( createMetisFile(gcg, detectordata, partialdec->getID(), graph, tempfile) );
479
480 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "Detecting Arrowhead structure:");
481
483 SCIP_CALL_ABORT( SCIPcreateClock(scip, &temporaryClock) );
484
485 for( j = 0, k = 0; k < maxnblockcandidates; ++k )
486 {
487 int nblocks = numberOfBlocks[k] - partialdec->getNBlocks();
488 SCIP_CALL_ABORT( SCIPstartClock(scip, temporaryClock) );
489 SCIP_RETCODE retcode;
490
491 if( nblocks > partialdec->getNOpenvars() || nblocks <= 1 )
492 {
493 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock ) );
494 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
495 continue;
496 }
497
498 retcode = callMetis(gcg, detectordata, graph, tempfile, nblocks, result);
499
500 if( *result != SCIP_SUCCESS || retcode != SCIP_OKAY)
501 {
502 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock ) );
503 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
504 continue;
505 }
506
507 if( allowopenpartialdecs )
508 {
509 SCIP_CALL( graph->createPartialdecFromPartition(partialdec, &newpartialdecs[j], &newpartialdecs[j+1], partialdecdetectiondata->detprobdata));
510 }
511 else
512 {
513 SCIP_CALL( graph->createPartialdecFromPartition(partialdec, &newpartialdecs[j], NULL, partialdecdetectiondata->detprobdata));
514 }
515
516 if( newpartialdecs[j] != NULL )
517 {
518 if( !allowopenpartialdecs )
519 {
520 newpartialdecs[j]->considerImplicits();
521 newpartialdecs[j]->refineToBlocks();
522 assert(newpartialdecs[j]->getNOpenconss() == 0);
523 assert(newpartialdecs[j]->getNOpenvars() == 0);
524 }
525 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
526
527 detectordata->found = TRUE;
528 (void) SCIPsnprintf(decinfo, SCIP_MAXSTRLEN, "hr\\_%d", numberOfBlocks[k]);
529 newpartialdecs[j]->addDetectorChainInfo(decinfo);
530
531 if( allowopenpartialdecs )
532 {
533 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock) / 2);
534 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock) / 2);
535 newpartialdecs[j + 1]->addDetectorChainInfo(decinfo);
536 j += 2;
537 }
538 else
539 {
540 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock));
541 j++;
542 }
543 }
544 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
545 }
546 delete graph;
547
548 int nnewpartialdecs = j;
549 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " done, %d partialdecs found.\n", nnewpartialdecs);
550 SCIP_CALL( SCIPallocMemoryArray(scip, &(partialdecdetectiondata->newpartialdecs), nnewpartialdecs) );
551 partialdecdetectiondata->nnewpartialdecs = nnewpartialdecs;
552 for( s = 0; s < nnewpartialdecs; ++s )
553 {
554 partialdecdetectiondata->newpartialdecs[s] = newpartialdecs[s];
555 partialdecdetectiondata->newpartialdecs[s]->addClockTime(clockTimes[s] + SCIPgetClockTime(scip, temporaryClock) / nnewpartialdecs);
556 }
557
558 SCIPfreeMemoryArray(scip, &newpartialdecs);
559 SCIP_CALL_ABORT( SCIPfreeClock(scip, &temporaryClock) );
561
562 if( detectordata->tidy )
563 {
564 int status = remove( tempfile );
565 if( status == -1 )
566 {
567 SCIPerrorMessage("Could not remove metis input file: %s", strerror( errno ));
568 return SCIP_WRITEERROR;
569 }
570 }
571
572 *result = detectordata->found ? SCIP_SUCCESS: SCIP_DIDNOTFIND;
573 return SCIP_OKAY;
574}
575
576
577static
578GCG_DECL_PROPAGATEPARTIALDEC(propagatePartialdecHrgpartition)
579{
580 SCIP_CLOCK* temporaryClock;
581 gcg::PARTIALDECOMP* partialdec = partialdecdetectiondata->workonpartialdec;
582 SCIP_Bool enabledforlarge;
583 int limit;
585
586 SCIPgetBoolParam(scip, "detection/detectors/hrgpartition/enabledforlargeproblems", &enabledforlarge);
587 SCIPgetIntParam(scip, "detection/detectors/hrgpartition/limitnconssnvarsdefault", &limit);
588
589 if ( !enabledforlarge && (SCIPgetNConss(scip) + SCIPgetNVars(scip) > limit) )
590 {
591 partialdecdetectiondata->detectiontime = 0;
592 partialdecdetectiondata->nnewpartialdecs = 0;
593 *result = SCIP_SUCCESS;
594 return SCIP_OKAY;
595 }
596
597 SCIPdebugMessage("Started propagate partialdec of detector %s and partial decomp %d \n", DEC_NAME, partialdec->getID() );
598
599 SCIP_CALL_ABORT( SCIPcreateClock(scip, &temporaryClock) );
600 SCIP_CALL_ABORT( SCIPstartClock(scip, temporaryClock) );
601
602 partialdec->considerImplicits();
603 partialdec->refineToMaster();
604
605 if( partialdec->alreadyAssignedConssToBlocks() )
606 {
607 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
608 SCIP_CALL_ABORT(SCIPfreeClock(scip, &temporaryClock) );
609 partialdecdetectiondata->detectiontime = 0;
610 partialdecdetectiondata->nnewpartialdecs = 0;
611 *result = SCIP_SUCCESS;
612 return SCIP_OKAY;
613 }
614
615 if( !connected(partialdecdetectiondata->detprobdata, partialdec) )
616 {
618 }
619
620 detection(gcg, GCGdetectorGetData(detector), partialdecdetectiondata, partialdec, true, result);
621
622 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
623 partialdecdetectiondata->detectiontime = SCIPgetClockTime(scip, temporaryClock);
624 SCIP_CALL_ABORT(SCIPfreeClock(scip, &temporaryClock) );
625
626 return SCIP_OKAY;
627}
628
629
630#define finishPartialdecHrgpartition NULL
631#define detectorPostprocessPartialdecHrgpartition NULL
632
633
634static
635GCG_DECL_SETPARAMAGGRESSIVE(setParamAggressiveHrgpartition)
636{
637 char setstr[SCIP_MAXSTRLEN];
638 const char* name = GCGdetectorGetName(detector);
639 int newval;
640 SCIP_Real modifier;
642
643 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
644 SCIP_CALL( SCIPsetBoolParam(scip, setstr, TRUE) );
645
646 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
647 SCIP_CALL( SCIPsetBoolParam(scip, setstr, TRUE ) );
648
649 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxcallround", name);
650 SCIP_CALL( SCIPgetIntParam(scip, setstr, &newval) );
651 ++newval;
652 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
653 SCIPinfoMessage(scip, NULL, "After Setting %s = %d\n", setstr, newval);
654
655
656 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/origmaxcallround", name);
657 SCIP_CALL( SCIPgetIntParam(scip, setstr, &newval) );
658 ++newval;
659 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
660
661 /* check if no problem is read */
663 {
664 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
667 return SCIP_OKAY;
668 }
669
671
672 modifier = log(modifier) / log(2);
673
674 if (!SCIPisFeasPositive(scip, modifier) )
675 modifier = -1.;
676
677 modifier = SCIPfloor(scip, modifier);
678 modifier += 1;
679
680 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier + 2 );
681 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
682 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
683 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
684
685 return SCIP_OKAY;
686}
687
688
689static
690GCG_DECL_SETPARAMDEFAULT(setParamDefaultHrgpartition)
691{
692 char setstr[SCIP_MAXSTRLEN];
693 int newval;
694 SCIP_Real modifier;
695 const char* name = GCGdetectorGetName(detector);
697
698 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
700
701 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
703
704 /* check if no problem is read */
706 {
707 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
710 return SCIP_OKAY;
711 }
712
714
715 modifier = log(modifier) / log(2);
716
717 if (!SCIPisFeasPositive(scip, modifier) )
718 modifier = -1.;
719
720 modifier = SCIPfloor(scip, modifier);
721 modifier += 1;
722
723 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier );
724 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
725 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
726 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
727
728 return SCIP_OKAY;
729}
730
731static
732GCG_DECL_SETPARAMFAST(setParamFastHrgpartition)
733{
734 char setstr[SCIP_MAXSTRLEN];
735 int newval;
736 SCIP_Real modifier;
737 const char* name = GCGdetectorGetName(detector);
739
740 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
742 SCIP_CALL( SCIPsetBoolParam(scip, setstr, TRUE) );
743 else SCIP_CALL( SCIPsetBoolParam(scip, setstr, FALSE) );
744
745 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
746 SCIP_CALL( SCIPsetBoolParam(scip, setstr, FALSE ) );
747
748 /* check if no problem is read */
750 {
751 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
754 return SCIP_OKAY;
755 }
756
758
759 modifier = log(modifier) / log(2);
760
761 if (!SCIPisFeasPositive(scip, modifier) )
762 modifier = -1.;
763
764 modifier = SCIPfloor(scip, modifier);
765 modifier += 1;
766
767 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier - 2 );
768 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
769 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
770 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
771
772 return SCIP_OKAY;
773}
774
775
776/** creates the hrgpartition presolver and includes it in SCIP */
777extern "C"
779 GCG* gcg /**< GCG data structure */
780 )
781{
782 GCG_DETECTORDATA *detectordata = NULL;
784 assert(scip != NULL);
785
786 SCIP_CALL( SCIPallocMemory(scip, &detectordata) );
787
788 assert(detectordata != NULL);
789 detectordata->found = FALSE;
790
791 SCIP_CALL( GCGincludeDetector(gcg, DEC_NAME, DEC_DECCHAR, DEC_DESC, DEC_FREQCALLROUND, DEC_MAXCALLROUND, DEC_MINCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUNDORIGINAL, DEC_PRIORITY, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_SKIP, DEC_USEFULRECALL, detectordata, freeHrgpartition, initHrgpartition, exitHrgpartition, propagatePartialdecHrgpartition, finishPartialdecHrgpartition, detectorPostprocessPartialdecHrgpartition, setParamAggressiveHrgpartition, setParamDefaultHrgpartition, setParamFastHrgpartition) );
792
793 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/limitnconssnvarsdefault", "Limit for sum of nvars and nconss for enabling this detector in default", &detectordata->limitnconssnvarsdefault, TRUE, DEFAULT_LIMITNCONSSNVARSDEFAULT, 0, INT_MAX, NULL, NULL) );
794
795 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrgpartition/enabledforlargeproblems", "Should this detector be enabled even the limit nconssnvars is exceeded",&detectordata->enabledforlargeproblems, TRUE, DEFAULT_ENABLEDFORLARGEPROBLEMS, NULL, NULL) );
796
797 /* add hrgpartition presolver parameters */
798 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/maxnblockcandidates", "The maximal number of block number candidates", &detectordata->maxnblockcandidates, FALSE, DEFAULT_MAXNBLOCKCANDIDATES, 0, 1000000, NULL, NULL) );
799 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrgpartition/beta", "Factor on how heavy equality (beta) and inequality constraints are measured", &detectordata->beta, FALSE, DEFAULT_BETA, 0.0, 1.0, NULL, NULL ) );
800 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrgpartition/alpha", "Factor on how heavy the standard deviation of the coefficients is measured", &detectordata->alpha, FALSE, DEFAULT_ALPHA, 0.0, 1E20, NULL, NULL ) );
801 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/varWeight", "Weight of a variable hyperedge", &detectordata->varWeight, FALSE, DEFAULT_VARWEIGHT, 0, 1000000, NULL, NULL) );
802 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/varWeightBinary", "Weight of a binary variable hyperedge", &detectordata->varWeightBinary, FALSE, DEFAULT_VARWEIGHTBIN, 0, 1000000, NULL, NULL) );
803 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/varWeightContinous", "Weight of a continuos variable hyperedge", &detectordata->varWeightContinous, FALSE, DEFAULT_VARWEIGHTCONT, 0, 1000000, NULL, NULL) );
804 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/varWeightImplint", "Weight of a implicit integer variable hyperedge", &detectordata->varWeightImplint, FALSE, DEFAULT_VARWEIGHTIMPL, 0, 1000000, NULL, NULL) );
805 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/varWeightInteger", "Weight of a integer variable hyperedge", &detectordata->varWeightInteger, FALSE, DEFAULT_VARWEIGHTINT, 0, 1000000, NULL, NULL) );
806 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/consWeight", "Weight of a constraint hyperedge", &detectordata->consWeight, FALSE, DEFAULT_CONSWEIGHT, 0, 1000000, NULL, NULL) );
807 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrgpartition/tidy", "Whether to clean up temporary files", &detectordata->tidy, FALSE, DEFAULT_TIDY, NULL, NULL) );
808 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/randomseed", "Random seed for hmetis", &detectordata->randomseed, FALSE, DEFAULT_RANDSEED, -1, INT_MAX, NULL, NULL) );
809 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrgpartition/dummynodes", "Percentage of dummy nodes for metis", &detectordata->dummynodes, FALSE, DEFAULT_DUMMYNODES, 0.0, 1.0, NULL, NULL) );
810 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrgpartition/consWeightSetppc", "Weight for constraint hyperedges that are setpartitioning or covering constraints", &detectordata->consWeightSetppc, FALSE, DEFAULT_CONSWEIGHT_SETPPC, 0, 1000000, NULL, NULL) );
811 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrgpartition/ubfactor", "Unbalance factor for metis", &detectordata->metisubfactor, FALSE, DEFAULT_METIS_UBFACTOR, 0.0, 1E20, NULL, NULL ) );
812 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrgpartition/metisverbose", "Should the metis output be displayed", &detectordata->metisverbose, FALSE, DEFAULT_METIS_VERBOSE, NULL, NULL ) );
813 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrgpartition/metisuseptyperb", "Should the rb or kway method be used for partitioning by metis", &detectordata->metisuseptyperb, FALSE, DEFAULT_METISUSEPTYPE_RB, NULL, NULL) );
814 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrgpartition/realname", "Should the problem be used for metis files or a temporary name", &detectordata->realname, FALSE, DEFAULT_REALNAME, NULL, NULL) );
815
816 return SCIP_OKAY;
817}
818
819#endif
SCIP_VAR * w
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
GCG_EXPORT std::vector< int > & getConssForVar(int varIndex)
returns the constraint indices of the coefficient matrix for a variable
GCG_EXPORT int getNVarsForCons(int consIndex)
returns the number of variables for a given constraint
GCG_EXPORT int getNVars()
return the number of variables considered in the detprobdata
GCG_EXPORT void getSortedCandidatesNBlocks(std::vector< int > &candidates)
gets the candidates for number of blocks added by the user followed by the found ones sorted in desce...
GCG_EXPORT int getNConssForVar(int varIndex)
returns the number of constraints for a given variable where the var has a nonzero entry in
GCG_EXPORT std::vector< int > & getVarsForCons(int consIndex)
returns the variable indices of the coefficient matrix for a constraint
virtual SCIP_RETCODE createFromPartialMatrix(DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
Definition: matrixgraph.h:147
virtual SCIP_RETCODE readPartition(const char *filename)
Definition: matrixgraph.h:114
virtual int getNNonzeroes() const
Definition: matrixgraph.h:153
virtual SCIP_RETCODE createPartialdecFromPartition(PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
Definition: matrixgraph.h:100
virtual SCIP_RETCODE writeToFile(int fd, SCIP_Bool writeweights)
Definition: matrixgraph.h:80
void setDummynodes(int dummynodes_)
Definition: matrixgraph.h:123
class to manage partial decompositions
GCG_EXPORT void assignSmallestComponentsButOneConssAdjacency()
computes components by connectedness of conss and vars
GCG_EXPORT void refineToMaster()
refine partialdec with focus on master
GCG_EXPORT int getNOpenvars()
Gets size of vector containing variables not assigned yet.
GCG_EXPORT bool alreadyAssignedConssToBlocks()
method to check if at least one constraint is assigned to some block
GCG_EXPORT void addDetectorChainInfo(const char *decinfo)
add information about the detector chain
GCG_EXPORT bool isVarOpenvar(int var)
Checks whether the var is an open var.
GCG_EXPORT void refineToBlocks()
refine partialdec with focus on blocks
GCG_EXPORT void considerImplicits()
: assigns every open cons/var
GCG_EXPORT int getID()
returns the unique id of the partialdec
GCG_EXPORT void addClockTime(SCIP_Real clocktime)
adds detection time of one detector
GCG_EXPORT bool isConsOpencons(int cons)
Gets whether the cons is an open cons.
GCG_EXPORT std::vector< int > & getOpenvars()
Gets vector containing variables not assigned yet.
GCG_EXPORT int getNBlocks()
Gets the number of blocks.
const char * GCGdetectorGetName(GCG_DETECTOR *detector)
returns the name of the provided detector
SCIP_Real GCGgetRemainingTime(GCG *gcg)
returns the remaining time of scip that the decomposition may use
GCG_DETECTORDATA * GCGdetectorGetData(GCG_DETECTOR *detector)
returns the data of the provided detector
SCIP_RETCODE GCGincludeDetector(GCG *gcg, const char *name, const char decchar, const char *description, int freqCallRound, int maxCallRound, int minCallRound, int freqCallRoundOriginal, int maxCallRoundOriginal, int minCallRoundOriginal, int priority, SCIP_Bool enabled, SCIP_Bool enabledFinishing, SCIP_Bool enabledPostprocessing, SCIP_Bool skip, SCIP_Bool usefulRecall, GCG_DETECTORDATA *detectordata, GCG_DECL_FREEDETECTOR((*freeDetector)), GCG_DECL_INITDETECTOR((*initDetector)), GCG_DECL_EXITDETECTOR((*exitDetector)), GCG_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), GCG_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), GCG_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), GCG_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), GCG_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)),)
constraint handler for structure detection
#define DEFAULT_DUMMYNODES
SCIP_RETCODE GCGincludeDetectorHrgpartition(GCG *gcg)
#define DEFAULT_METIS_VERBOSE
#define finishPartialdecHrgpartition
#define DEFAULT_METISUSEPTYPE_RB
static GCG_DECL_PROPAGATEPARTIALDEC(propagatePartialdecHrgpartition)
static GCG_DECL_INITDETECTOR(initHrgpartition)
#define DEFAULT_METIS_UBFACTOR
#define DEC_MAXCALLROUND
#define DEC_MINCALLROUNDORIGINAL
#define DEFAULT_MAXNBLOCKCANDIDATES
#define DEFAULT_VARWEIGHTINT
#define DEC_ENABLEDFINISHING
#define DEC_ENABLED
#define DEFAULT_VARWEIGHTBIN
#define SET_MULTIPLEFORSIZETRANSF
static GCG_DECL_FREEDETECTOR(freeHrgpartition)
#define DEFAULT_CONSWEIGHT
static SCIP_RETCODE createMetisFile(GCG *gcg, GCG_DETECTORDATA *detectordata, int partialdecID, MatrixGraph< gcg::GraphTclique > *graph, char tempfile[SCIP_MAXSTRLEN])
static GCG_DECL_SETPARAMDEFAULT(setParamDefaultHrgpartition)
#define DEC_DECCHAR
#define DEFAULT_ENABLEDFORLARGEPROBLEMS
static SCIP_RETCODE callMetis(GCG *gcg, GCG_DETECTORDATA *detectordata, MatrixGraph< gcg::GraphTclique > *graph, char tempfile[SCIP_MAXSTRLEN], int nblocks, SCIP_RESULT *result)
#define DEFAULT_REALNAME
#define DEFAULT_TIDY
#define DEC_NAME
static SCIP_RETCODE detection(GCG *gcg, GCG_DETECTORDATA *detectordata, Partialdec_Detection_Data *partialdecdetectiondata, gcg::PARTIALDECOMP *partialdec, bool allowopenpartialdecs, SCIP_RESULT *result)
static bool connected(gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec)
#define DEFAULT_CONSWEIGHT_SETPPC
#define DEC_MINCALLROUND
#define detectorPostprocessPartialdecHrgpartition
#define DEFAULT_LIMITNCONSSNVARSDEFAULT
#define DEFAULT_VARWEIGHT
#define DEC_ENABLEDPOSTPROCESSING
#define DEFAULT_ALPHA
#define DEFAULT_RANDSEED
static GCG_DECL_SETPARAMFAST(setParamFastHrgpartition)
#define DEFAULT_FALLBACK_NBLOCKS
static GCG_DECL_EXITDETECTOR(exitHrgpartition)
#define DEC_DESC
#define DEC_FREQCALLROUND
#define DEC_PRIORITY
#define HMETIS_EXECUTABLE
static GCG_DECL_SETPARAMAGGRESSIVE(setParamAggressiveHrgpartition)
#define DEC_USEFULRECALL
#define DEFAULT_BETA
#define DEC_SKIP
#define DEC_MAXCALLROUNDORIGINAL
#define DEFAULT_VARWEIGHTCONT
#define DEC_FREQCALLROUNDORIGINAL
#define DEFAULT_VARWEIGHTIMPL
arrowhead and bordered detector via graph partitioning (uses hmetis)
#define SCIP_MAXSTRLEN
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define MAX(x, y)
#define SCIP_CALL_ABORT(x)
#define SCIP_CALL(x)
#define TRUE
#define FALSE
interface to the SCIP tclique graph library
SCIP * GCGgetOrigprob(GCG *gcg)
Definition: gcg.cpp:87
SCIP_STAGE SCIPgetStage(SCIP *scip)
const char * SCIPgetProbName(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
int SCIPgetNConss(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
#define SCIPallocMemoryArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPfreeMemory(scip, ptr)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
int SCIPsnprintf(char *t, int len, const char *s,...)
Column hypergraph.
#define NULL
miscellaneous matrixgraph methods for structure detection
public methods for working with decomposition structures
#define SCIPerrorMessage
#define SCIPdebugMessage
various SCIP helper methods
SCIP_Bool enabledforlargeproblems
SCIP_Bool found
Definition: dec_dbscan.cpp:92
Definition: struct_gcg.h:55
interface data structure for the detector calling methods
gcg::PARTIALDECOMP ** newpartialdecs
gcg::DETPROBDATA * detprobdata
structure information for decomposition information in GCG projects
SCIP_VERBLEVEL_NORMAL
SCIP_DIDNOTRUN
SCIP_DIDNOTFIND
SCIP_SUCCESS
enum SCIP_Result SCIP_RESULT
SCIP_WRITEERROR
SCIP_OKAY
SCIP_ERROR
enum SCIP_Retcode SCIP_RETCODE
SCIP_STAGE_PROBLEM
weight class for graphs