Scippy

GCG

Branch-and-Price & Column Generation for Everyone

dec_hrcgpartition.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_hrcgpartition.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 */
44
45#if !defined(_WIN32) && !defined(_WIN64)
46#include <cassert>
47#include <cstring>
48#include <cerrno>
49#include <unistd.h>
50#include <iostream>
51#include <vector>
52#include <algorithm>
53#include <queue>
54
55#ifdef HMETIS_HEADER
56#include "gcg/hmetis.h"
57#else
58#define HMETIS_EXECUTABLE "hmetis"
59#endif
60
61#include "gcg/cons_decomp.h"
62#include "gcg/struct_decomp.h"
63#include "gcg/pub_decomp.h"
64#include "gcg/scip_misc.h"
65#include "scip/pub_misc.h"
66#include "scip/cons_linear.h"
67#include "scip/cons_setppc.h"
68#include "graph/matrixgraph.h"
70#include "graph/graph_tclique.h"
71#include "graph/weights.h"
74#include "scip/clock.h"
75
76
77#include <set>
78
81using gcg::Weights;
82
83#define DEC_NAME "hrcgpartition" /**< name of the detector */
84#define DEC_DESC "enforces arrowhead structures using graph partitioning" /**< description of detector */
85#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 */
86#define DEC_MAXCALLROUND 1 /**< last round the detector gets called */
87#define DEC_MINCALLROUND 0 /**< first round the detector gets called */
88#define DEC_FREQCALLROUNDORIGINAL 1 /**< frequency the detector gets called in detection loop while detecting the original problem */
89#define DEC_MAXCALLROUNDORIGINAL 1 /**< last round the detector gets called while detecting the original problem */
90#define DEC_MINCALLROUNDORIGINAL 0 /**< first round the detector gets called while detecting the original problem */
91#define DEC_PRIORITY 1000 /**< priority of the detector */
92#define DEC_DECCHAR 'a' /**< display character of detector */
93#define DEC_ENABLED FALSE /**< should detector be called by default */
94#define DEC_ENABLEDFINISHING FALSE /**< should the finishing be enabled */
95#define DEC_ENABLEDPOSTPROCESSING FALSE /**< should the postprocessing be enabled */
96#define DEC_SKIP FALSE /**< should detector be skipped if others found detections */
97#define DEC_USEFULRECALL TRUE /**< is it useful to call this detector on a descendant of the propagated partialdec */
98
99
100/* Default parameter settings */
101#define DEFAULT_VARWEIGHT 2 /**< weight for variable nodes */
102#define DEFAULT_VARWEIGHTBIN 3 /**< weight for binary variable nodes */
103#define DEFAULT_VARWEIGHTINT 3 /**< weight for integer variable nodes */
104#define DEFAULT_VARWEIGHTIMPL 3 /**< weight for implicit integer variable nodes */
105#define DEFAULT_VARWEIGHTCONT 2 /**< weight for continous variable nodes */
106#define DEFAULT_CONSWEIGHT 1 /**< weight for constraint hyperedges */
107#define DEFAULT_RANDSEED 1 /**< random seed for the hmetis call */
108#define DEFAULT_TIDY TRUE /**< whether to clean up afterwards */
109#define DEFAULT_DUMMYNODES 0.2 /**< percentage of dummy vertices*/
110#define DEFAULT_CONSWEIGHT_SETPPC 5 /**< weight for constraint hyperedges that are setpartitioning or covering
111 constraints */
112#define DEFAULT_MAXNBLOCKCANDIDATES 3 /**< number of block number candidates to be considered */
113#define DEFAULT_ALPHA 0.0 /**< factor for standard deviation of constraint weights */
114#define DEFAULT_BETA 0.5 /**< factor of how the weight for equality and inequality constraints is
115 distributed (keep 1/2 for the same on both) */
116#define DEFAULT_METIS_UBFACTOR 5.0 /**< default unbalance factor given to metis on the commandline */
117#define DEFAULT_METIS_VERBOSE FALSE /**< should metis be verbose */
118#define DEFAULT_METISUSEPTYPE_RB TRUE /**< Should metis use the rb or kway partitioning algorithm */
119#define DEFAULT_REALNAME FALSE /**< whether the metis name should be real or temporary */
120#define DEFAULT_TYPE 'a' /**< type of the decomposition 'c' column hypergraph (single bordered, no
121 linking constraints), 'r' row hypergraph (single bordered, no linking
122 variables) and 'a' column-row hypergraph (arrowhead) */
123
124#define FAST_MAXHALFPERIMETER 25000 /**< if nrows + ncols does not exceeds this value */
125
126#define SET_MULTIPLEFORSIZETRANSF 12500
127/*
128 * Data structures
129 */
130
131/** private detector data */
132struct GCG_DetectorData
133{
134
135 /* weight parameters */
136 int varWeight; /**< weight of a variable hyperedge */
137 int varWeightBinary; /**< weight of a binary variable hyperedge */
138 int varWeightContinous; /**< weight of a continuous variable hyperedge */
139 int varWeightInteger; /**< weight of an integer variable hyperedge */
140 int varWeightImplint; /**< weight of an implicit integer variable hyperedge */
141 int consWeight; /**< weight of a constraint hyperedge */
142 int consWeightSetppc; /**< weight of a setppc constraint hyperedge */
143 SCIP_Real alpha; /**< factor for constraint coefficient value standard deviation */
144 SCIP_Real beta; /**< factor for equality od inequality constraints */
145
146 /* general parameters */
147 SCIP_Real dummynodes; /**< percent of dummy nodes */
148 SCIP_Bool tidy; /**< whether tempory metis files should be cleaned up */
149 int maxnblockcandidates; /**< maximal number of block canddidates to test */
150
151 /* metis parameters */
152 int randomseed; /**< metis random seed */
153 SCIP_Real metisubfactor; /**< metis unbalance factor */
154 SCIP_Bool metisverbose; /**< should metis ouput be displayed */
155 SCIP_Bool metisuseptyperb; /**< flag to indicate whether metis uses kway or rb partitioning */
156 SCIP_Bool realname; /**< flag to indicate real problem name or temporary filename for metis files */
157
158 /* various data */
159 SCIP_Bool found; /**< indicates whethere a decomposition has been found */
160 char type; /**< type of the decomposition 'c' column hypergraph (single bordered, no linking
161 constraints), 'r' row hypergraph (single bordered, no linking variables) and
162 'a' column-row hypergraph (arrowhead) */
163};
164
165
166/*
167 * Local methods
168 */
169
170
171/** destructor of detector to free user data (called when GCG is exiting) */
172static
173GCG_DECL_FREEDETECTOR(freeHrcgpartition)
174{
175 GCG_DETECTORDATA* detectordata;
176
177 detectordata = GCGdetectorGetData(detector);
178 assert(detectordata != NULL);
179 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
180
181 SCIPfreeMemory(GCGgetOrigprob(gcg), &detectordata);
182
183 return SCIP_OKAY;
184}
185
186
187/** detector initialization method */
188static
189GCG_DECL_INITDETECTOR(initHrcgpartition)
190{
191 GCG_DETECTORDATA* detectordata;
192
193 detectordata = GCGdetectorGetData(detector);
194 assert(detectordata != NULL);
195 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
196
197 detectordata->found = FALSE;
198
199 return SCIP_OKAY;
200}
201
202/** detector deinitialization method (called before the transformed problem is freed) */
203static
204GCG_DECL_EXITDETECTOR(exitHrcgpartition)
205{
206 assert(gcg != NULL);
207
208 assert(strcmp(GCGdetectorGetName(detector), DEC_NAME) == 0);
209
210 return SCIP_OKAY;
211}
212
213/** will call hmetis via a system call */
214static
216 GCG* gcg, /**< GCG data struture */
217 GCG_DETECTORDATA* detectordata, /**< detector data data structure */
218 MatrixGraph<gcg::GraphTclique>* graph, /**< the graph of the matrix */
219 char tempfile[SCIP_MAXSTRLEN], /**< filename for the metis input file */
220 int nblocks, /**< number of blocks */
221 SCIP_RESULT* result /**< result indicating whether the detection was successful */
222 )
223{
224 SCIP* scip;
225 char metiscall[SCIP_MAXSTRLEN];
226 char metisout[SCIP_MAXSTRLEN];
227 SCIP_CLOCK* metisclock;
228
229 int status;
230
231 SCIP_Real remainingtime;
232
233 assert(gcg != NULL);
234 assert(detectordata != NULL);
235
237 *result = SCIP_DIDNOTRUN;
238
239
240 remainingtime = GCGgetRemainingTime(gcg);
241 SCIP_CALL( SCIPcreateWallClock(scip, &metisclock) );
242
243 if( remainingtime <= 0 )
244 {
245 return SCIP_OKAY;
246 }
247
248 /* call metis via syscall as there is no library usable ... */
250 {
251 (void) SCIPsnprintf(metiscall, SCIP_MAXSTRLEN, "zsh -c \"ulimit -t %.0f;" HMETIS_EXECUTABLE " %s %d -seed %d -ptype %s -ufactor %f %s\"",
252 remainingtime,
253 tempfile,
254 nblocks,
255 detectordata->randomseed,
256 detectordata->metisuseptyperb ? "rb" : "kway",
257 detectordata->metisubfactor,
258 detectordata->metisverbose ? "" : "> /dev/null" );
259 }
260 else
261 {
262 (void) SCIPsnprintf(metiscall, SCIP_MAXSTRLEN, "zsh -c \"" HMETIS_EXECUTABLE " %s %d -seed %d -ptype %s -ufactor %f %s\"",
263 tempfile,
264 nblocks,
265 detectordata->randomseed,
266 detectordata->metisuseptyperb ? "rb" : "kway",
267 detectordata->metisubfactor,
268 detectordata->metisverbose ? "" : "> /dev/null" );
269 }
270
271 SCIP_CALL( SCIPstartClock(scip, metisclock) );
272 SCIPdebugMessage("Calling metis with: %s\n", metiscall);
274 status = system( metiscall );
275
276 SCIP_CALL( SCIPstopClock(scip, metisclock) );
277 SCIPdebugMessage("time left before metis started: %f, time metis spend %f, remainingtime: %f\n", remainingtime, SCIPgetClockTime(scip, metisclock), remainingtime-SCIPgetClockTime(scip, metisclock) );
278
279 SCIP_CALL( SCIPfreeClock(scip, &metisclock) );
280
281 /* check error codes */
282 if( status == -1 )
283 {
284 SCIPerrorMessage("System call did not succed: %s\n", strerror( errno ));
285 SCIPerrorMessage("Call was %s\n", metiscall);
286 }
287 else if( status != 0 )
288 {
289
290 SCIPerrorMessage("Calling hmetis unsuccessful! See the above error message for more details.\n");
291 SCIPerrorMessage("Call was %s\n", metiscall);
292 }
293
294 /* exit gracefully in case of errors */
295 if( status != 0 )
296 {
297 return SCIP_ERROR;
298 }
299
300 (void) SCIPsnprintf(metisout, SCIP_MAXSTRLEN, "%s.part.%d", tempfile, nblocks);
301 SCIP_CALL( graph->readPartition(metisout) );
302
303 /* if desired delete the temoprary metis file */
304 if( detectordata->tidy )
305 {
306 status = remove( metisout );
307 if( status == -1 )
308 {
309 SCIPerrorMessage("Could not remove metis output file: %s\n", strerror( errno ));
310 return SCIP_WRITEERROR;
311 }
312 }
313 else
314 {
315 SCIPinfoMessage(scip, NULL, "Temporary file is in: %s\n", tempfile);
316 }
317 *result = SCIP_SUCCESS;
318 return SCIP_OKAY;
319}
320
321/** creates the temporary metis input file */
322static
324 SCIP* scip, /**< SCIP data struture */
325 GCG_DETECTORDATA* detectordata, /**< detector data structure */
326 int partialdecID, /**< ID of partial decomposition to be used */
327 MatrixGraph<gcg::GraphTclique>* graph, /**< the graph of the matrix */
328 char tempfile[SCIP_MAXSTRLEN] /**< filename for the metis input file */
329 )
330{
331 int nvertices;
332 int ndummyvertices;
333 int fd;
334 nvertices = graph->getNNonzeroes();
335 /*lint --e{524}*/
336 ndummyvertices = SCIPceil(scip, detectordata->dummynodes*nvertices);
337 graph->setDummynodes(ndummyvertices);
338
339 if( !detectordata->realname )
340 {
341 (void) SCIPsnprintf(tempfile, SCIP_MAXSTRLEN, "gcg-%c-%d.metis.XXXXXX", DEC_DECCHAR, partialdecID );
342 }
343 else
344 {
345 (void) SCIPsnprintf(tempfile, SCIP_MAXSTRLEN, "gcg-%s-%c-%d.metis.XXXXXX", SCIPgetProbName(scip), DEC_DECCHAR, partialdecID);
346 }
347
348 fd = mkstemp(tempfile);
349
350 SCIP_CALL( graph->writeToFile(fd, TRUE) );
351 close(fd);
352 return SCIP_OKAY;
353}
354
355/** returns, whether the hyperrolcolgraph is connected */
356static
358 gcg::DETPROBDATA* detprobdata,
359 gcg::PARTIALDECOMP* partialdec
360 )
361{
362 std::vector<int> queue;
363 std::vector<int> visited;
364 std::vector<bool> inqueue (detprobdata->getNVars(), false);
365 std::vector<bool> isvisited(detprobdata->getNVars(), false);
366 int start = -1;
367
368 if(partialdec->getNOpenvars() < 2)
369 return false;
370
371 start = partialdec->getOpenvars()[0];
372
373 queue.push_back(start);
374 inqueue[start] = true;
375 do
376 {
377 int node = queue[0];
378 queue.erase(queue.begin());
379 inqueue[node] = false;
380 visited.push_back(node);
381 isvisited[node] = true;
382 for(int c = 0; c < detprobdata->getNConssForVar(node); ++c)
383 {
384 int cons = detprobdata->getConssForVar(node)[c];
385 if(!partialdec->isConsOpencons(cons))
386 continue;
387 for(int v = 0; v < detprobdata->getNVarsForCons(cons); ++v)
388 {
389 int var = detprobdata->getVarsForCons(cons)[v];
390 if(!partialdec->isVarOpenvar(var))
391 continue;
392 if( isvisited[var] )
393 continue;
394 if( inqueue[var] )
395 continue;
396 queue.push_back(var);
397 inqueue[var] = true;
398 }
399 }
400 } while(!queue.empty());
401
402 if((int)visited.size() != partialdec->getNOpenvars())
403 return false;
404
405 queue.clear();
406 visited.clear();
407 inqueue = std::vector<bool>(detprobdata->getNConss(), false);
408 isvisited = std::vector<bool>(detprobdata->getNConss(), false);
409
410 if(partialdec->getNOpenconss() < 2)
411 return false;
412
413 queue.push_back(partialdec->getOpenconss()[0]);
414 inqueue[partialdec->getOpenconss()[0]] = true;
415 do
416 {
417 int node = queue[0];
418 queue.erase(queue.begin());
419 inqueue[node] = false;
420 visited.push_back(node);
421 isvisited[node] = true;
422 for(int v = 0; v < detprobdata->getNVarsForCons(node); ++v)
423 {
424 int var = detprobdata->getVarsForCons(node)[v];
425 if(!partialdec->isVarOpenvar(var))
426 continue;
427 for(int c = 0; c < detprobdata->getNConssForVar(var); ++c)
428 {
429 int cons = detprobdata->getConssForVar(var)[c];
430 if(!partialdec->isConsOpencons(cons))
431 continue;
432 if( isvisited[cons] )
433 continue;
434 if( inqueue[cons] )
435 continue;
436 queue.push_back(cons);
437 inqueue[cons] = true;
438 }
439 }
440 } while( !queue.empty() );
441
442 if( (int)visited.size() != partialdec->getNOpenconss() )
443 return false;
444 else
445 return true;
446}
447
448/** detection function for partialdecs */
449static
451 GCG* gcg, /**< GCG data structure */
452 GCG_DETECTORDATA* detectordata, /**< detectordata of the detector */
453 Partialdec_Detection_Data* partialdecdetectiondata, /**< partialdecdetectiondata (including the detprobdata) where to store the new Partialdecs */
454 gcg::PARTIALDECOMP* partialdec, /**< partialdec to propagate */
455 bool allowopenpartialdecs, /**< whether new partialdecs should be stored in which this detector only assignes conss to master */
456 SCIP_RESULT* result /**< pointer where to store the result */
457)
458{
459 SCIP* scip;
460 /* add hrgpartition presolver parameters */
461 int maxnblockcandidates;
462 int k;
463 int j;
464 int s;
465 gcg::PARTIALDECOMP** newpartialdecs;
466 SCIP_CLOCK* clock;
467 SCIP_CLOCK* temporaryClock;
468 std::vector<SCIP_Real> clockTimes; /* vector containing times in seconds */
469 /* Graph stuff for hmetis */
470 MatrixGraph<gcg::GraphTclique>* graph; /* the graph of the matrix */
471 char tempfile[SCIP_MAXSTRLEN]; /**< filename for the metis input file */
472
476
477 *result = SCIP_DIDNOTFIND;
478
479 std::vector<int> numberOfBlocks;
480 partialdecdetectiondata->detprobdata->getSortedCandidatesNBlocks(numberOfBlocks);
481 if( numberOfBlocks.empty() )
482 numberOfBlocks.push_back(8);
483
484 SCIP_CALL( SCIPgetIntParam(scip, "detection/detectors/hrcgpartition/maxnblockcandidates", &maxnblockcandidates) );
485
486 maxnblockcandidates = MIN(maxnblockcandidates, (int) numberOfBlocks.size());
487
488 assert(scip != NULL);
489 assert(detectordata != NULL);
490
491 SCIPdebugMessage("Detecting structure from %s\n", DEC_NAME);
492
493 /* allocate space for output data */
494 SCIP_CALL( SCIPallocMemoryArray(scip, &(newpartialdecs), 2 * maxnblockcandidates) );
495
496 /* build the hypergraph structure from the original problem */
497 Weights w(detectordata->varWeight, detectordata->varWeightBinary, detectordata->varWeightContinous, detectordata->varWeightInteger, detectordata->varWeightInteger, detectordata->consWeight);
499 SCIP_CALL( graph->createFromPartialMatrix(partialdecdetectiondata->detprobdata, partialdec) );
500 SCIP_CALL( createMetisFile(scip, detectordata, partialdec->getID(), graph, tempfile) );
501
502 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "Detecting Arrowhead structure:");
504 SCIP_CALL_ABORT( SCIPcreateClock(scip, &temporaryClock) );
505 for( j = 0, k = 0; k < maxnblockcandidates; ++k )
506 {
507 char decinfo[SCIP_MAXSTRLEN];
508 int nblocks = numberOfBlocks[k] - partialdec->getNBlocks();
509 SCIP_CALL_ABORT( SCIPstartClock(scip, temporaryClock) );
510 SCIP_RETCODE retcode;
511
512 if( nblocks > graph->getNNonzeroes() || nblocks <= 1 )
513 {
514 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock ) );
515 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
516 continue;
517 }
518
519 retcode = callMetis(gcg, detectordata, graph, tempfile, nblocks, result);
520
521 if( *result != SCIP_SUCCESS || retcode != SCIP_OKAY )
522 {
523 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock ) );
524 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
525 continue;
526 }
527
528 if( allowopenpartialdecs )
529 {
530 SCIP_CALL( graph->createPartialdecFromPartition(partialdec, &newpartialdecs[j], &newpartialdecs[j+1], partialdecdetectiondata->detprobdata));
531 }
532 else
533 {
534 SCIP_CALL( graph->createPartialdecFromPartition(partialdec, &newpartialdecs[j], NULL, partialdecdetectiondata->detprobdata));
535 }
536
537 if( newpartialdecs[j] != NULL )
538 {
539 if( !allowopenpartialdecs )
540 {
541 newpartialdecs[j]->considerImplicits();
542 newpartialdecs[j]->refineToBlocks();
543 assert(newpartialdecs[j]->getNOpenconss() == 0);
544 assert(newpartialdecs[j]->getNOpenvars() == 0);
545 }
546 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
547
548 detectordata->found = TRUE;
549 (void) SCIPsnprintf(decinfo, SCIP_MAXSTRLEN, "hrc\\_%d", numberOfBlocks[k]);
550 newpartialdecs[j]->addDetectorChainInfo(decinfo);
551
552 if( allowopenpartialdecs )
553 {
554 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock) / 2);
555 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock) / 2);
556 newpartialdecs[j + 1]->addDetectorChainInfo(decinfo);
557 j += 2;
558 }
559 else
560 {
561 clockTimes.push_back(SCIPgetClockTime(scip, temporaryClock));
562 j++;
563 }
564 }
565 SCIP_CALL_ABORT( SCIPresetClock(scip, temporaryClock ) );
566 }
567 delete graph;
568
569 int nnewpartialdecs = j;
570 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " done, %d partialdecs found.\n", nnewpartialdecs);
571 SCIP_CALL( SCIPallocMemoryArray(scip, &(partialdecdetectiondata->newpartialdecs), nnewpartialdecs) );
572 partialdecdetectiondata->nnewpartialdecs = nnewpartialdecs;
573 for( s = 0; s < nnewpartialdecs; ++s )
574 {
575 partialdecdetectiondata->newpartialdecs[s] = newpartialdecs[s];
576 partialdecdetectiondata->newpartialdecs[s]->addClockTime(clockTimes[s] + SCIPgetClockTime(scip, temporaryClock) / nnewpartialdecs);
577 }
578
579 SCIPfreeMemoryArray(scip, &newpartialdecs);
580 SCIP_CALL_ABORT( SCIPfreeClock(scip, &temporaryClock) );
582
583 if( detectordata->tidy )
584 {
585 int status = remove( tempfile );
586 if( status == -1 )
587 {
588 SCIPerrorMessage("Could not remove metis input file: %s", strerror( errno ));
589 return SCIP_WRITEERROR;
590 }
591 }
592
593 *result = detectordata->found ? SCIP_SUCCESS: SCIP_DIDNOTFIND;
594 return SCIP_OKAY;
595}
596
597
598static
599GCG_DECL_PROPAGATEPARTIALDEC(propagatePartialdecHrcgpartition)
600{
601 SCIP_CLOCK* temporaryClock;
602 gcg::PARTIALDECOMP* partialdec = partialdecdetectiondata->workonpartialdec;
604
605 SCIP_CALL_ABORT( SCIPcreateClock(scip, &temporaryClock) );
606 SCIP_CALL_ABORT( SCIPstartClock(scip, temporaryClock) );
607
608 partialdec->considerImplicits();
609 partialdec->refineToMaster();
610
611 if( !connected(partialdecdetectiondata->detprobdata, partialdec) || partialdec->alreadyAssignedConssToBlocks() )
612 {
614 }
615
616 detection(gcg, GCGdetectorGetData(detector), partialdecdetectiondata, partialdec, true, result);
617
618 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
619 partialdecdetectiondata->detectiontime = SCIPgetClockTime(scip, temporaryClock);
620 SCIP_CALL_ABORT(SCIPfreeClock(scip, &temporaryClock) );
621
622 return SCIP_OKAY;
623}
624
625
626static
627GCG_DECL_FINISHPARTIALDEC(finishPartialdecHrcgpartition)
628{
629 SCIP_CLOCK* temporaryClock;
630 gcg::PARTIALDECOMP* partialdec = partialdecdetectiondata->workonpartialdec;
632
633 SCIP_CALL_ABORT( SCIPcreateClock(scip, &temporaryClock) );
634 SCIP_CALL_ABORT( SCIPstartClock(scip, temporaryClock) );
635
636 partialdec->considerImplicits();
637 partialdec->refineToBlocks();
638
639 if( !connected(partialdecdetectiondata->detprobdata, partialdec) )
640 {
642 }
643
644 detection(gcg, GCGdetectorGetData(detector), partialdecdetectiondata, partialdec, false, result);
645
646 SCIP_CALL_ABORT( SCIPstopClock(scip, temporaryClock) );
647 partialdecdetectiondata->detectiontime = SCIPgetClockTime(scip, temporaryClock);
648 SCIP_CALL_ABORT(SCIPfreeClock(scip, &temporaryClock) );
649
650 return SCIP_OKAY;
651}
652
653
654#define detectorPostprocessPartialdecHrcgpartition NULL
655
656
657static
658GCG_DECL_SETPARAMAGGRESSIVE(setParamAggressiveHrcgpartition)
659{
660 char setstr[SCIP_MAXSTRLEN];
661 const char* name = GCGdetectorGetName(detector);
662 int newval;
663 SCIP_Real modifier;
665
666 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
667 SCIP_CALL( SCIPsetBoolParam(scip, setstr, TRUE) );
668
669 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
670 SCIP_CALL( SCIPsetBoolParam(scip, setstr, TRUE ) );
671
672 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxcallround", name);
673 SCIP_CALL( SCIPgetIntParam(scip, setstr, &newval) );
674 ++newval;
675 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
676 SCIPinfoMessage(scip, NULL, "After Setting %s = %d\n", setstr, newval);
677
678
679 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/origmaxcallround", name);
680 SCIP_CALL( SCIPgetIntParam(scip, setstr, &newval) );
681 ++newval;
682 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
683 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
684
685 /* check if no problem is read */
687 {
688 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
689 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
690 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
691 return SCIP_OKAY;
692 }
693
694
696
697 modifier = log(modifier) / log(2);
698
699 if (!SCIPisFeasPositive(scip, modifier) )
700 modifier = -1.;
701
702 modifier = SCIPfloor(scip, modifier);
703 modifier += 1;
704
705 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier + 2 );
706 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
707 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
708 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
709
710 return SCIP_OKAY;
711
712}
713
714
715static
716GCG_DECL_SETPARAMDEFAULT(setParamDefaultHrcgpartition)
717{
718 char setstr[SCIP_MAXSTRLEN];
719 int newval;
720 SCIP_Real modifier;
721 const char* name = GCGdetectorGetName(detector);
723
724 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
726
727 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
729
730 /* check if no problem is read */
732 {
733 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
736 return SCIP_OKAY;
737 }
738
739
741
742 modifier = log(modifier) / log(2);
743
744 if (!SCIPisFeasPositive(scip, modifier) )
745 modifier = -1.;
746
747 modifier = SCIPfloor(scip, modifier);
748 modifier += 1;
749
750 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier );
751 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
752 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
753 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
754
755
756
757 return SCIP_OKAY;
758
759}
760
761static
762GCG_DECL_SETPARAMFAST(setParamFastHrcgpartition)
763{
764 char setstr[SCIP_MAXSTRLEN];
765 int newval;
766 SCIP_Real modifier;
767 const char* name = GCGdetectorGetName(detector);
769
770 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", name);
772
773 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", name);
774 SCIP_CALL( SCIPsetBoolParam(scip, setstr, FALSE ) );
775
776 /* check if no problem is read */
778 {
779 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
782 return SCIP_OKAY;
783 }
784
786
787 modifier = log(modifier) / log(2);
788
789 if (!SCIPisFeasPositive(scip, modifier) )
790 modifier = -1.;
791
792 modifier = SCIPfloor(scip, modifier);
793 modifier += 1;
794
795 newval = MAX( 0, DEFAULT_MAXNBLOCKCANDIDATES - modifier - 2 );
796
797
798 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/maxnblockcandidates", name);
799 SCIP_CALL( SCIPsetIntParam(scip, setstr, newval ) );
800 SCIPinfoMessage(scip, NULL, "%s = %d\n", setstr, newval);
801
802 return SCIP_OKAY;
803}
804
805/** creates the hrcgpartition presolver and includes it in SCIP */
806extern "C"
808 GCG* gcg /**< GCG data structure */
809 )
810{
811 GCG_DETECTORDATA *detectordata = NULL;
813 assert(scip != NULL);
814
815 SCIP_CALL( SCIPallocMemory(scip, &detectordata) );
816 assert(detectordata != NULL);
817
818 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, freeHrcgpartition, initHrcgpartition, exitHrcgpartition, propagatePartialdecHrcgpartition, finishPartialdecHrcgpartition, detectorPostprocessPartialdecHrcgpartition, setParamAggressiveHrcgpartition, setParamDefaultHrcgpartition, setParamFastHrcgpartition) );
819
820
821 /* add hrcgpartition detector parameters */
822 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/maxnblockcandidates", "The maximal number of block number candidates", &detectordata->maxnblockcandidates, FALSE, DEFAULT_MAXNBLOCKCANDIDATES, 0, 1000000, NULL, NULL) );
823 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrcgpartition/beta", "Factor on how heavy equality (beta) and inequality constraints are measured", &detectordata->beta, FALSE, DEFAULT_BETA, 0.0, 1.0, NULL, NULL ) );
824 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrcgpartition/alpha", "Factor on how heavy the standard deviation of the coefficients is measured", &detectordata->alpha, FALSE, DEFAULT_ALPHA, 0.0, 1E20, NULL, NULL ) );
825 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/varWeight", "Weight of a variable hyperedge", &detectordata->varWeight, FALSE, DEFAULT_VARWEIGHT, 0, 1000000, NULL, NULL) );
826 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/varWeightBinary", "Weight of a binary variable hyperedge", &detectordata->varWeightBinary, FALSE, DEFAULT_VARWEIGHTBIN, 0, 1000000, NULL, NULL) );
827 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/varWeightContinous", "Weight of a continuos variable hyperedge", &detectordata->varWeightContinous, FALSE, DEFAULT_VARWEIGHTCONT, 0, 1000000, NULL, NULL) );
828 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/varWeightImplint", "Weight of a implicit integer variable hyperedge", &detectordata->varWeightImplint, FALSE, DEFAULT_VARWEIGHTIMPL, 0, 1000000, NULL, NULL) );
829 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/varWeightInteger", "Weight of a integer variable hyperedge", &detectordata->varWeightInteger, FALSE, DEFAULT_VARWEIGHTINT, 0, 1000000, NULL, NULL) );
830 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/consWeight", "Weight of a constraint hyperedge", &detectordata->consWeight, FALSE, DEFAULT_CONSWEIGHT, 0, 1000000, NULL, NULL) );
831 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrcgpartition/tidy", "Whether to clean up temporary files", &detectordata->tidy, FALSE, DEFAULT_TIDY, NULL, NULL) );
832 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/randomseed", "Random seed for hmetis", &detectordata->randomseed, FALSE, DEFAULT_RANDSEED, -1, INT_MAX, NULL, NULL) );
833 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrcgpartition/dummynodes", "Percentage of dummy nodes for metis", &detectordata->dummynodes, FALSE, DEFAULT_DUMMYNODES, 0.0, 1.0, NULL, NULL) );
834 SCIP_CALL( SCIPaddIntParam(scip, "detection/detectors/hrcgpartition/consWeightSetppc", "Weight for constraint hyperedges that are setpartitioning or covering constraints", &detectordata->consWeightSetppc, FALSE, DEFAULT_CONSWEIGHT_SETPPC, 0, 1000000, NULL, NULL) );
835 SCIP_CALL( SCIPaddRealParam(scip, "detection/detectors/hrcgpartition/ubfactor", "Unbalance factor for metis", &detectordata->metisubfactor, FALSE, DEFAULT_METIS_UBFACTOR, 0.0, 1E20, NULL, NULL ) );
836 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrcgpartition/metisverbose", "Should the metis output be displayed", &detectordata->metisverbose, FALSE, DEFAULT_METIS_VERBOSE, NULL, NULL ) );
837 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrcgpartition/metisuseptyperb", "Should the rb or kway method be used for partitioning by metis", &detectordata->metisuseptyperb, FALSE, DEFAULT_METISUSEPTYPE_RB, NULL, NULL) );
838 SCIP_CALL( SCIPaddBoolParam(scip, "detection/detectors/hrcgpartition/realname", "Should the problem be used for metis files or a temporary name", &detectordata->realname, FALSE, DEFAULT_REALNAME, NULL, NULL) );
839
840 return SCIP_OKAY;
841}
842
843#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 getNConss()
returns the number of variables considered in the detprobdata
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 int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
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 std::vector< int > & getOpenconss()
Gets vector containing constraints not assigned yet.
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
#define DEFAULT_METIS_VERBOSE
static GCG_DECL_EXITDETECTOR(exitHrcgpartition)
#define DEFAULT_METISUSEPTYPE_RB
static GCG_DECL_PROPAGATEPARTIALDEC(propagatePartialdecHrcgpartition)
static GCG_DECL_FREEDETECTOR(freeHrcgpartition)
#define DEFAULT_METIS_UBFACTOR
#define DEC_MAXCALLROUND
#define DEC_MINCALLROUNDORIGINAL
#define DEFAULT_MAXNBLOCKCANDIDATES
SCIP_RETCODE GCGincludeDetectorHrcgpartition(GCG *gcg)
static GCG_DECL_FINISHPARTIALDEC(finishPartialdecHrcgpartition)
#define DEFAULT_VARWEIGHTINT
#define DEC_ENABLEDFINISHING
static GCG_DECL_INITDETECTOR(initHrcgpartition)
#define DEC_ENABLED
#define DEFAULT_VARWEIGHTBIN
#define SET_MULTIPLEFORSIZETRANSF
#define DEFAULT_CONSWEIGHT
#define DEC_DECCHAR
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
static GCG_DECL_SETPARAMDEFAULT(setParamDefaultHrcgpartition)
#define DEFAULT_VARWEIGHT
#define DEC_ENABLEDPOSTPROCESSING
#define DEFAULT_ALPHA
#define DEFAULT_RANDSEED
#define DEC_DESC
#define DEC_FREQCALLROUND
#define detectorPostprocessPartialdecHrcgpartition
#define DEC_PRIORITY
static GCG_DECL_SETPARAMFAST(setParamFastHrcgpartition)
#define HMETIS_EXECUTABLE
#define DEC_USEFULRECALL
#define DEFAULT_BETA
#define DEC_SKIP
#define DEC_MAXCALLROUNDORIGINAL
#define DEFAULT_VARWEIGHTCONT
#define DEC_FREQCALLROUNDORIGINAL
#define DEFAULT_VARWEIGHTIMPL
static SCIP_RETCODE createMetisFile(SCIP *scip, GCG_DETECTORDATA *detectordata, int partialdecID, MatrixGraph< gcg::GraphTclique > *graph, char tempfile[SCIP_MAXSTRLEN])
static GCG_DECL_SETPARAMAGGRESSIVE(setParamAggressiveHrcgpartition)
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 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,...)
A hypergraph with row and column nodes.
#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 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