GCG 4.1.1 (dev)

Generic Column Generation

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