dialog_gcg.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
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-2018 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
37 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38 
39 #include <sys/stat.h>
40 #include <assert.h>
41 #include <string.h>
42 
43 #include "scip/pub_dialog.h"
44 #include "scip/type_dialog.h"
45 #include "scip/dialog_default.h"
46 
47 #include "gcg.h"
48 
49 #include "dialog_gcg.h"
50 #include "relax_gcg.h"
51 #include "pricer_gcg.h"
52 #include "cons_decomp.h"
53 #include "pub_gcgheur.h"
54 #include "pub_gcgsepa.h"
55 #include "stat.h"
56 #include "reader_dec.h"
57 #include "reader_tex.h"
58 #include "params_visu.h"
59 
60 /* display the reader information */
61 static
63  SCIP* scip,
64  SCIP_Bool reader,
65  SCIP_Bool writer
66  )
67 {
68  SCIP_READER** readers;
69  int nreaders;
70  int r;
71 
72  assert( scip != NULL );
73 
74  readers = SCIPgetReaders(scip);
75  nreaders = SCIPgetNReaders(scip);
76 
77  /* display list of readers */
78  SCIPdialogMessage(scip, NULL, "\n");
79  SCIPdialogMessage(scip, NULL, " file reader extension description\n");
80  SCIPdialogMessage(scip, NULL, " ----------- --------- -----------\n");
81  for( r = 0; r < nreaders; ++r )
82  {
83  if( (reader && SCIPreaderCanRead(readers[r])) || (writer && SCIPreaderCanWrite(readers[r])) )
84  {
85  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPreaderGetName(readers[r]));
86  if( strlen(SCIPreaderGetName(readers[r])) > 20 )
87  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
88  SCIPdialogMessage(scip, NULL, "%9s ", SCIPreaderGetExtension(readers[r]));
89  SCIPdialogMessage(scip, NULL, "%s", SCIPreaderGetDesc(readers[r]));
90  SCIPdialogMessage(scip, NULL, "\n");
91  }
92  }
93  SCIPdialogMessage(scip, NULL, "\n");
94 }
95 
96 
98 static
100  SCIP* scip,
101  SCIP_DIALOG* dialog,
102  SCIP_DIALOGHDLR* dialoghdlr,
103  SCIP_DIALOG** nextdialog,
104  SCIP_Bool original,
105  SCIP_Bool presolved
107  )
108 {
109  char filename[SCIP_MAXSTRLEN];
110  char dirname[SCIP_MAXSTRLEN];
111  char* tmp;
112  SCIP_Bool endoffile;
113 
115  {
116  SCIPdialogMessage(scip, NULL, "No decomposition to write, please read or detect one first.\n");
117  SCIPdialoghdlrClearBuffer(dialoghdlr);
118  *nextdialog = NULL;
119  return SCIP_OKAY;
120  }
121 
122  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter directory: ", &tmp, &endoffile) );
123 
124 
125  if( endoffile )
126  {
127  *nextdialog = NULL;
128  return SCIP_OKAY;
129  }
130 
131  SCIPdebugMessage("dirname: %s\n", tmp);
132 
133  strcpy(dirname, tmp);
134 
135  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, tmp, TRUE) );
136 
137  /* if no directory is specified, initialize it with a standard solution */
138  if( dirname[0] == '\0' )
139  {
140  strcpy(dirname, "alldecompositions/");
141  }
142 
143  /* make sure directory exists */
144  if( dirname != NULL )
145  {
146  mkdir(dirname, S_IRWXU | S_IRWXG | S_IRWXO);
147  }
148 
149  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter extension: ", &tmp, &endoffile) );
150  strcpy(filename, tmp);
151 
152  if( filename[0] != '\0' )
153  {
154  char* extension;
155  extension = filename;
156  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, extension, TRUE) );
157 
158  do
159  {
160  SCIP_RETCODE retcode = DECwriteAllDecomps(scip, dirname, extension, original, presolved);
161 
162  if( retcode == SCIP_FILECREATEERROR )
163  {
164  SCIPdialogMessage(scip, NULL, "error creating files\n");
165  SCIPdialoghdlrClearBuffer(dialoghdlr);
166  break;
167  }
168  else if( retcode == SCIP_WRITEERROR )
169  {
170  SCIPdialogMessage(scip, NULL, "error writing files\n");
171  SCIPdialoghdlrClearBuffer(dialoghdlr);
172  break;
173  }
174  else if( retcode == SCIP_PLUGINNOTFOUND )
175  {
176  /* ask user once for a suitable reader */
177  if( extension == NULL )
178  {
179  SCIPdialogMessage(scip, NULL, "no reader for requested output format\n");
180 
181  SCIPdialogMessage(scip, NULL, "following readers are avaliable for writing:\n");
182  displayReaders(scip, FALSE, TRUE);
183 
184  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
185  "select a suitable reader by extension (or return): ", &extension, &endoffile) );
186 
187  if( extension[0] == '\0' )
188  break;
189  }
190  else
191  {
192  SCIPdialogMessage(scip, NULL, "no reader for output in <%s> format\n", extension);
193  extension = NULL;
194  }
195  }
196  else
197  {
198  /* check for unexpected errors */
199  SCIP_CALL( retcode );
200 
201  /* print result message if writing was successful */
202  SCIPdialogMessage(scip, NULL, "written all decompositions %s\n", extension);
203  break;
204  }
205  }
206  while (extension != NULL );
207  }
208 
209  return SCIP_OKAY;
210 }
211 
213 static
214 SCIP_RETCODE writeFamilyTree(
215  SCIP* scip,
216  SCIP_DIALOG* dialog,
217  SCIP_DIALOGHDLR* dialoghdlr,
218  SCIP_DIALOG** nextdialog
219  )
220 {
221  SCIP_Bool endoffile;
222  SCIP_RETCODE retcode;
223  char* probname;
224  char* tmpstring;
225  const char* extension = "tex";
226  char dirname[SCIP_MAXSTRLEN];
227  char probnamepath[SCIP_MAXSTRLEN];
228  char filename[SCIP_MAXSTRLEN];
229  char outname[SCIP_MAXSTRLEN];
230 
232  {
233  SCIPdialogMessage(scip, NULL, "No decomposition to write for family tree, please read or detect one first.\n");
234  SCIPdialoghdlrClearBuffer(dialoghdlr);
235  *nextdialog = NULL;
236  return SCIP_OKAY;
237  }
238 
239  /* create the file path */
240  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,"Enter directory for output (e.g. ../path/to/directory):\n",
241  &tmpstring, &endoffile) );
242  if( endoffile )
243  {
244  *nextdialog = NULL;
245  return SCIP_OKAY;
246  }
247 
248  strncpy(dirname, tmpstring, SCIP_MAXSTRLEN);
249 
250  /* if no directory is specified, initialize it with a standard solution */
251  if( dirname[0] == '\0' )
252  {
253  strcpy(dirname, "familytree/");
254  }
255 
256  /* make sure directory exists */
257  if( dirname != NULL )
258  {
259  mkdir(dirname, S_IRWXU | S_IRWXG | S_IRWXO);
260  }
261 
262  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, dirname, TRUE) );
263 
264  (void) SCIPsnprintf(probnamepath, SCIP_MAXSTRLEN, "%s", SCIPgetProbName(scip));
265  SCIPsplitFilename(probnamepath, NULL, &probname, NULL, NULL);
266  (void) SCIPsnprintf(filename, SCIP_MAXSTRLEN, "familytree-%s", probname);
267 
268  /* make sure there are no dots in the pure filename */
269  for(size_t i = 0; i < strlen(filename); i++)
270  {
271  if(filename[i] == '.')
272  filename[i] = '-';
273  }
274 
275  (void) SCIPsnprintf(outname, SCIP_MAXSTRLEN, "%s/%s.%s", dirname, filename, extension);
276 
277  /* call the creation of the family tree */
278  retcode = DECwriteFamilyTree( scip, outname, dirname, GCGfamtreeGetMaxNDecomps(), SCIPvisuGetDraftmode() );
279 
280  if( retcode == SCIP_FILECREATEERROR )
281  {
282  SCIPdialogMessage(scip, NULL, "error creating file\n");
283  SCIPdialoghdlrClearBuffer(dialoghdlr);
284  }
285  else if( retcode == SCIP_WRITEERROR )
286  {
287  SCIPdialogMessage(scip, NULL, "error writing file\n");
288  SCIPdialoghdlrClearBuffer(dialoghdlr);
289  }
290  else
291  {
292  /* check for unexpected errors */
293  SCIP_CALL( retcode );
294 
295  /* print result message if writing was successful */
296  SCIPdialogMessage(scip, NULL,
297  "Family tree visualization is written to %s. \n For compilation read the README in the same folder.\n", outname);
298  }
299 
300  return SCIP_OKAY;
301 }
302 
305 static
307  SCIP* scip,
308  SCIP_DIALOG* dialog,
309  SCIP_DIALOGHDLR* dialoghdlr,
310  SCIP_DIALOG** nextdialog
311  )
312 {
313  DEC_DECOMP** decomps;
314  FILE* file;
315  DEC_DECTYPE type;
316  SCIP_Bool endoffile;
317  char* pname;
318  char* dirname;
319  const char* nameinfix = "report_";
320  const char* extension = "tex";
321  char ppath[SCIP_MAXSTRLEN];
322  char outname[SCIP_MAXSTRLEN];
323  int* seeedids;
324  int nseeeds;
325  int ndecomps;
326  int i;
327 
329  ndecomps = SCIPconshdlrDecompGetNFinishedDecomps(scip);
330  decomps = SCIPconshdlrDecompGetFinishedDecomps(scip);
331 
332  if( ndecomps == 0 )
333  {
334  SCIPdialogMessage(scip, NULL, "No decomposition to write, please read or detect one first.\n");
335  SCIPdialoghdlrClearBuffer(dialoghdlr);
336  *nextdialog = NULL;
337  return SCIP_OKAY;
338  }
339 
340  /* get a directory to write to */
341  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter a directory: ", &dirname, &endoffile) );
342  if( endoffile )
343  {
344  *nextdialog = NULL;
345  return SCIP_OKAY;
346  }
347  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, dirname, TRUE) );
348 
349  /* if no directory is specified, initialize it with a standard solution */
350  if( dirname[0] == '\0' )
351  {
352  strcpy(dirname, "report/");
353  }
354 
355  /* make sure directory exists */
356  if( dirname != NULL )
357  {
358  mkdir(dirname, S_IRWXU | S_IRWXG | S_IRWXO);
359  }
360 
361  /* create a name for the new file */
362  strcpy(ppath, (char*) SCIPgetProbName(scip));
363  SCIPsplitFilename(ppath, NULL, &pname, NULL, NULL);
364 
365  (void) SCIPsnprintf(outname, SCIP_MAXSTRLEN, "%s/%s%s.%s", dirname, nameinfix, pname, extension);
366 
367  SCIPallocBlockMemoryArray(scip, &seeedids, ndecomps);
368  nseeeds = 0;
370  if( (int) type == 0 )
371  {
372  nseeeds = ndecomps;
373  for( i = 0; i < ndecomps; i++ )
374  {
375  seeedids[i] = DECdecompGetSeeedID(decomps[i]);
376  }
377  }
378  else
379  {
380  for( i = 0; i < ndecomps; i++ )
381  {
382  if( DECdecompGetType(decomps[i]) == type && nseeeds <= GCGreportGetMaxNDecomps() )
383  {
384  nseeeds++;
385  seeedids[i] = DECdecompGetSeeedID(decomps[i]);
386  }
387  }
388  }
389 
390  /* create output file and write report */
391  file = fopen(outname, "w");
392  if( file == NULL )
393  {
394  SCIPdialogMessage(scip, NULL, "error creating report file\n");
395  SCIPdialoghdlrClearBuffer(dialoghdlr);
396  }
397  GCGwriteTexReport( scip, file, seeedids, &nseeeds, GCGreportGetShowTitlepage(), GCGreportGetShowToc(),
399  fclose(file);
400 
401  SCIPfreeBlockMemoryArray(scip, &seeedids, ndecomps);
402 
403  /* print result message if writing was successful */
404  SCIPdialogMessage(scip, NULL,
405  "Report is written to file %s\n. For compilation read the README in the same folder.\n", outname);
406 
407  /* free the decomp files */
408  for( i = 0; i < ndecomps; ++i )
409  {
410  DECdecompFree(scip, &decomps[ndecomps - i - 1]);
411  }
412 
413  /* free the decomps array (it is allocated in SCIPconshdlrDecompGetFinishedDecomps) */
414  SCIPfreeMemoryArray(scip, &decomps);
415 
416  return SCIP_OKAY;
417 }
418 
420 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayStatistics)
421 { /*lint --e{715}*/
422  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
423 
424  SCIP_CALL( GCGprintStatistics(scip, NULL) );
425 
426  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
427 
428  return SCIP_OKAY;
429 }
430 
431 
433 SCIP_DECL_DIALOGEXEC(GCGdialogExecPrintDetectionInformation)
434 { /*lint --e{715}*/
435  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
436 
437  SCIP_CALL( GCGprintCompleteDetectionStatistics(scip, NULL) );
438 
439  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
440 
441  return SCIP_OKAY;
442 }
443 
444 
446 SCIP_DECL_DIALOGEXEC(GCGdialogExecChangeAddBlocknr)
447 { /*lint --e{715}*/
448 
449  char* blocknrchar;
450  char* token;
451  int blocknr;
452  char tempstr[SCIP_MAXSTRLEN];
453  SCIP_Bool endoffile;
454 
455  tempstr[0] = '\0';
456 
457  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
458 
459  (void) SCIPsnprintf(tempstr, SCIP_MAXSTRLEN, "Please type the block number candidates you want to add (as white space separated list): ");
460  SCIP_CALL( SCIPdialoghdlrGetLine(dialoghdlr, dialog, (char*)tempstr, &blocknrchar, &endoffile) );
461 
462  token = strtok(blocknrchar, " ");
463 
464  while( token )
465  {
466  blocknr = atoi( token );
467  if ( blocknr == 0 )
468  {
469  SCIPdialogMessage(scip, NULL,
470  "%s is not a compatible number; no new block number candidate added. \n", token);
471  return SCIP_OKAY;
472  }
473 
475  token = strtok(NULL, " ");
476  }
477 
478  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
479 
480  return SCIP_OKAY;
481 }
482 
484 SCIP_DECL_DIALOGEXEC(GCGdialogExecChangeAddInstancename
485 )
486 { /*lint --e{715}*/
487 
488  char* instancename;
489  char tempstr[SCIP_MAXSTRLEN];
490  SCIP_Bool endoffile;
491 
492  tempstr[0] = '\0';
493 
494  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
495 
496  (void) SCIPsnprintf(tempstr, SCIP_MAXSTRLEN, "Please type the instancename information (used in complete detection statistics): ");
497  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, (char*)tempstr, &instancename, &endoffile) );
498 
499  GCGsetFilename(scip, instancename);
500 
501  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
502 
503  return SCIP_OKAY;
504 }
505 
506 
508 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayDecomposition)
509 { /*lint --e{715}*/
510  DEC_DECOMP* decomp;
511  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
512 
513  decomp = DECgetBestDecomp(scip);
514  if( decomp != NULL )
515  {
516  SCIP_CALL( GCGwriteDecomp(scip, NULL, decomp) );
517  }
518 
519  SCIP_CALL(DECdecompFree(scip, &decomp) );
520 
521  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
522 
523  return SCIP_OKAY;
524 }
525 
527 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayNBlockcandidates)
528 { /*lint --e{715}*/
529  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
530 
531  SCIP_CALL(GCGprintBlockcandidateInformation(scip, NULL) );
532 
533  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
534 
535  return SCIP_OKAY;
536 }
537 
538 
540 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayAdditionalStatistics)
541 { /*lint --e{715}*/
542 
543  DEC_DECOMP* bestdecomp;
544 
545 
546  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
547  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVING || SCIPgetStage(scip) == SCIP_STAGE_SOLVED )
548  {
549  if( SCIPgetStage(GCGgetMasterprob(scip)) < SCIP_STAGE_PRESOLVED )
550  {
551  SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), NULL, "No Dantzig-Wolfe reformulation applied. No decomposition statistics available.\n");
552  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
553  return SCIP_OKAY;
554  }
555 
556  SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), NULL, "\nAdditional statistics:\n");
557  bestdecomp = DECgetBestDecomp(scip);
558  if( DECdecompGetType(bestdecomp) == DEC_DECTYPE_DIAGONAL )
559  {
560  SCIPmessageFPrintInfo(SCIPgetMessagehdlr(GCGgetMasterprob(scip)), NULL, "\n");
561  SCIP_CALL( GCGwriteDecompositionData(scip) );
562 
563  }
564  else
565  {
567  SCIPmessageFPrintInfo(SCIPgetMessagehdlr(GCGgetMasterprob(scip)), NULL, "\n");
568  SCIP_CALL( GCGwriteDecompositionData(scip) );
570  }
571  DECdecompFree(scip, &bestdecomp);
572  }
573  else
574  {
575  SCIPdialogMessage(scip, NULL, "Problem needs to solved first for additional statistics");
576  }
577  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
578 
579  return SCIP_OKAY;
580 }
581 
582 
584 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayDetectors)
585 { /*lint --e{715}*/
586  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
587 
589  SCIPdialogMessage(scip, NULL, "\n");
590 
591  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
592 
593  return SCIP_OKAY;
594 }
595 
597 SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplaySolvers)
598 { /*lint --e{715}*/
599  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
600 
602  SCIPdialogMessage(scip, NULL, "\n");
603 
604  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
605 
606  return SCIP_OKAY;
607 }
608 
610 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetMaster)
611 { /*lint --e{715}*/
612  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
613 
614  if( SCIPgetStage(GCGgetMasterprob(scip)) != SCIP_STAGE_INIT )
615  {
616  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "switching to the master problem shell is only possible before the solving process is started\n");
617 
618  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
619 
620  return SCIP_OKAY;
621  }
622 
623  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "switching to the master problem...\n");
624  SCIP_CALL( SCIPstartInteraction(GCGgetMasterprob(scip)) );
625  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "back in the original problem...\n");
626 
627  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
628 
629  return SCIP_OKAY;
630 }
631 
633 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetLoadmaster)
634 { /*lint --e{715}*/
635  SCIP* masterprob;
636  char* filename;
637  SCIP_Bool endoffile;
638 
639  masterprob = GCGgetMasterprob(scip);
640  assert(masterprob != NULL);
641 
642  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
643  if( endoffile )
644  {
645  *nextdialog = NULL;
646  return SCIP_OKAY;
647  }
648 
649  if( filename[0] != '\0' )
650  {
651  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
652 
653  if( SCIPfileExists(filename) )
654  {
655  SCIP_CALL( SCIPreadParams(masterprob, filename) );
656  SCIPdialogMessage(scip, NULL, "loaded master parameter file <%s>\n", filename);
657  }
658  else
659  {
660  SCIPdialogMessage(scip, NULL, "file <%s> not found\n", filename);
661  SCIPdialoghdlrClearBuffer(dialoghdlr);
662  }
663  }
664 
665  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
666 
667  return SCIP_OKAY;
668 }
669 
671 SCIP_DECL_DIALOGEXEC(GCGdialogExecDetect)
672 { /*lint --e{715}*/
673  SCIP_RESULT result;
674 
675  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
676 
677  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "Starting detection\n");
678 
679  if( SCIPgetStage(scip) > SCIP_STAGE_INIT )
680  {
681  SCIPdebugMessage("Start DECdetectstructure!\n");
682  SCIP_CALL( DECdetectStructure(scip, &result) );
683  if( result == SCIP_SUCCESS )
684  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "Detection was successful.\n");
685  else
686  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "Detection was not successful.\n");
687  }
688  else
689  SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "No problem exists");
690 
691  SCIP_CALL( GCGprintOptionalOutput(scip, dialoghdlr) );
692 
693  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
694 
695  return SCIP_OKAY;
696 }
697 
699 SCIP_DECL_DIALOGEXEC(GCGdialogExecSelect)
700 { /*lint --e{715}*/
701  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
702 
703  SCIP_CALL( SCIPconshdlrDecompExecSelect(scip, dialoghdlr, dialog ) );
704 
705  SCIPdialogMessage(scip, NULL, "\n");
706 
707  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
708 
709  return SCIP_OKAY;
710 }
711 
713 SCIP_DECL_DIALOGEXEC(GCGdialogExecToolbox)
714 { /*lint --e{715}*/
715 
716  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
717 
718  SCIP_CALL( SCIPconshdlrDecompExecToolbox(scip, dialoghdlr, dialog ) );
719 
720  SCIPdialogMessage(scip, NULL, "\n");
721 
722  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
723 
724  return SCIP_OKAY;
725 }
726 
727 
728 
730 SCIP_DECL_DIALOGEXEC(GCGdialogExecOptimize)
731 { /*lint --e{715}*/
732 
733  SCIP_RESULT result;
734  int presolrounds;
735 
736  presolrounds = -1;
737 
738  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
739  presolrounds = -1;
740 
741 
743 
744  // SCIPdialogMessage(scip, NULL, "In optimize3 \n");
745  SCIPdialogMessage(scip, NULL, "\n");
746  switch( SCIPgetStage(scip) )
747  {
748  case SCIP_STAGE_INIT:
749  SCIPdialogMessage(scip, NULL, "No problem exists\n");
750  break;
751 
752  case SCIP_STAGE_PROBLEM:
753  case SCIP_STAGE_TRANSFORMED:
754  // SCIPdialogMessage(scip, NULL, "in transformed \n");
755 
756  case SCIP_STAGE_PRESOLVING:
757  // SCIPdialogMessage(scip, NULL, "in presolving \n");
758 
760  {
761  SCIPinfoMessage(scip, NULL,"there is an unpresolved decomposition and problem is not presolved yet -> disable presolving and start optimizing (rerun with presolve command before detect command for detecting in presolved problem ) \n");
762  SCIP_CALL( SCIPgetIntParam(scip, "presolving/maxrounds", &presolrounds) );
763  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrounds", 0) );
764  }
765  SCIP_CALL( SCIPpresolve(scip) ); /*lint -fallthrough*/
766 
767  case SCIP_STAGE_PRESOLVED:
768 
770  // SCIPdialogMessage(scip, NULL, "In presolved \n");
771 
773  {
775  {
776  SCIP_Bool success;
777  SCIPinfoMessage(scip, NULL,"there is an unpresolved decomposition -> try to translate it to presolved problem... \n");
779 
780  if( !success )
781  {
782  SCIPinfoMessage(scip, NULL,"translatation was not successful -> revoke presolving and use user given decomposition \n");
783  /* @TODO experimental */
785  SCIPfreeTransform(scip);
787  SCIP_CALL( SCIPgetIntParam(scip, "presolving/maxrounds", &presolrounds) );
788  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrounds", 0) );
789  SCIP_CALL( SCIPpresolve(scip) ); /*lint -fallthrough*/
791  assert(success);
792  }
793  else
794  SCIPinfoMessage(scip, NULL,"translation was successful \n");
795  }
796  }
797 
799  {
800  SCIP_CALL( DECdetectStructure(scip, &result) );
801  if( result == SCIP_DIDNOTFIND )
802  {
803  DEC_DECOMP* bestdecomp;
804  bestdecomp = DECgetBestDecomp(scip);
805  assert(bestdecomp == NULL && DEChasDetectionRun(scip));
806  DECdecompFree(scip, &bestdecomp);
807  SCIPdialogMessage(scip, NULL, "No decomposition exists or could be detected. Solution process started with original problem...\n");
808  }
809  }
810  else if(! SCIPconshdlrDecompHasDecomp(scip) )
811  {
812  //assert(DECgetBestDecomp(scip) == NULL && DEChasDetectionRun(scip));
813  SCIPdialogMessage(scip, NULL, "No decomposition exists or could be detected. Solution process started with original problem...\n");
814  }
815 
816  /*lint -fallthrough*/
817  case SCIP_STAGE_SOLVING:
819  assert(SCIPgetNConss(scip) == SCIPgetNActiveConss(scip) );
822  else
825  {
826  int npresolvingrounds;
827 
828  /* @TODO experimental */
829  SCIPgetIntParam(scip, "presolving/maxrounds", &npresolvingrounds);
830  if( npresolvingrounds > 0)
831  {
832  SCIPinfoMessage(scip, NULL,"best candidate decomposition is from unpresolved problem -> revoke presolving and use it \n");
834  SCIPfreeTransform(scip);
836  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrounds", 0) );
837  SCIP_CALL( SCIPpresolve(scip) ); /*lint -fallthrough*/
838  }
839  }
840  SCIP_CALL( SCIPsolve(scip) );
841  break;
842 
843  case SCIP_STAGE_SOLVED:
844  SCIPdialogMessage(scip, NULL, "Problem is already solved\n");
845  break;
846 
847  case SCIP_STAGE_TRANSFORMING:
848  case SCIP_STAGE_INITPRESOLVE:
849  case SCIP_STAGE_EXITPRESOLVE:
850  case SCIP_STAGE_INITSOLVE:
851  case SCIP_STAGE_EXITSOLVE:
852  case SCIP_STAGE_FREETRANS:
853  case SCIP_STAGE_FREE:
854  default:
855  SCIPerrorMessage("Invalid SCIP stage\n");
856  return SCIP_INVALIDCALL;
857  }
858  SCIPdialogMessage(scip, NULL, "\n");
859 
860  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
861 
862  if( presolrounds != -1 )
863  {
864  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrounds", presolrounds) );
865  }
866 
867  return SCIP_OKAY;
868 }
869 
871 static
872 SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteAllDecompositions)
873 {
874  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
875 
876  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
877  {
878  SCIP_CALL( writeAllDecompositions(scip, dialog, dialoghdlr, nextdialog, TRUE, TRUE) );
879  }
880  else
881  SCIPdialogMessage(scip, NULL, "no problem available\n");
882 
883  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
884 
885  return SCIP_OKAY;
886 }
887 
888 
890 static
891 SCIP_DECL_DIALOGEXEC(GCGdialogExecWritePresolvedDecompositions)
892 {
893  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
894 
895  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
896  {
897  SCIP_CALL( writeAllDecompositions(scip, dialog, dialoghdlr, nextdialog, FALSE, TRUE) );
898  }
899  else
900  SCIPdialogMessage(scip, NULL, "no problem available\n");
901 
902  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
903 
904  return SCIP_OKAY;
905 }
906 
907 
909 static
910 SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteOriginalDecompositions)
911 {
912  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
913 
914  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
915  {
916  SCIP_CALL( writeAllDecompositions(scip, dialog, dialoghdlr, nextdialog, TRUE, FALSE) );
917  }
918  else
919  SCIPdialogMessage(scip, NULL, "no problem available\n");
920 
921  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
922 
923  return SCIP_OKAY;
924 }
925 
926 
928 static
929 SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteFamilyTree)
930 {
931  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
932 
933  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
934  {
935  SCIP_CALL( writeFamilyTree(scip, dialog, dialoghdlr, nextdialog) );
936  }
937  else
938  SCIPdialogMessage(scip, NULL, "no problem available\n");
939 
940  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
941 
942  return SCIP_OKAY;
943 }
944 
945 
947 static
948 SCIP_DECL_DIALOGEXEC(GCGdialogExecReportAllDecompositions)
949 {
950  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
951 
952  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
953  {
954  SCIP_CALL( reportAllDecompositions(scip, dialog, dialoghdlr, nextdialog) );
955  }
956  else
957  SCIPdialogMessage(scip, NULL, "no problem available\n");
958 
959  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
960 
961  return SCIP_OKAY;
962 }
963 
965 static
966 SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteStatistics)
967 {
968  char* filename;
969  SCIP_Bool endoffile;
970 
971  SCIPdialogMessage(scip, NULL, "\n");
972 
973  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
974  if( endoffile )
975  {
976  *nextdialog = NULL;
977  return SCIP_OKAY;
978  }
979  if( filename[0] != '\0' )
980  {
981  FILE* file;
982 
983  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
984 
985  file = fopen(filename, "w");
986  if( file == NULL )
987  {
988  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
989  SCIPprintSysError(filename);
990  SCIPdialoghdlrClearBuffer(dialoghdlr);
991  }
992  else
993  {
994  SCIP_RETCODE retcode;
995  retcode = GCGprintStatistics(scip, file);
996  if( retcode != SCIP_OKAY )
997  {
998  fclose(file);
999  SCIP_CALL( retcode );
1000  }
1001  else
1002  {
1003  SCIPdialogMessage(scip, NULL, "written statistics to file <%s>\n", filename);
1004  fclose(file);
1005  }
1006  }
1007  }
1008 
1009  SCIPdialogMessage(scip, NULL, "\n");
1010 
1011  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1012 
1013  return SCIP_OKAY;
1014 }
1016 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsAggressive)
1017 { /*lint --e{715}*/
1018  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1019 
1020  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1021 
1022  SCIP_CALL( GCGsetDetection(scip, SCIP_PARAMSETTING_AGGRESSIVE, FALSE) );
1023 
1024  return SCIP_OKAY;
1025 }
1026 
1028 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsDefault)
1029 { /*lint --e{715}*/
1030  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1031 
1032  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1033 
1034  SCIP_CALL( GCGsetDetection(scip, SCIP_PARAMSETTING_DEFAULT, FALSE) );
1035 
1036  return SCIP_OKAY;
1037 }
1038 
1040 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsOff)
1041 { /*lint --e{715}*/
1042  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1043 
1044  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1045 
1046  SCIP_CALL( GCGsetDetection(scip, SCIP_PARAMSETTING_OFF, FALSE) );
1047 
1048  return SCIP_OKAY;
1049 }
1050 
1052 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsFast)
1053 { /*lint --e{715}*/
1054  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1055 
1056  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1057 
1058  SCIP_CALL( GCGsetDetection(scip, SCIP_PARAMSETTING_FAST, FALSE) );
1059 
1060  return SCIP_OKAY;
1061 }
1062 
1064 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsAggressive)
1065 { /*lint --e{715}*/
1066  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1067 
1068  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1069 
1070  SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE, FALSE) );
1071  SCIP_CALL( GCGsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE) );
1072 
1073  return SCIP_OKAY;
1074 }
1075 
1077 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsOff)
1078 { /*lint --e{715}*/
1079  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1080 
1081  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1082 
1083  SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_OFF, FALSE) );
1084  SCIP_CALL( GCGsetHeuristics(scip, SCIP_PARAMSETTING_OFF) );
1085 
1086  return SCIP_OKAY;
1087 }
1088 
1090 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsFast)
1091 { /*lint --e{715}*/
1092  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1093 
1094  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1095 
1096  SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_FAST, FALSE) );
1097  SCIP_CALL( GCGsetHeuristics(scip, SCIP_PARAMSETTING_FAST) );
1098 
1099  return SCIP_OKAY;
1100 }
1101 
1103 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsDefault)
1104 { /*lint --e{715}*/
1105  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1106 
1107  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1108 
1109  SCIP_CALL( GCGsetSeparators(scip, SCIP_PARAMSETTING_DEFAULT) );
1110 
1111  return SCIP_OKAY;
1112 }
1113 
1115 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsAggressive)
1116 { /*lint --e{715}*/
1117  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1118 
1119  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1120 
1121  SCIP_CALL( GCGsetSeparators(scip, SCIP_PARAMSETTING_AGGRESSIVE) );
1122 
1123  return SCIP_OKAY;
1124 }
1125 
1127 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsOff)
1128 { /*lint --e{715}*/
1129  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1130 
1131  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1132 
1133  SCIP_CALL( GCGsetSeparators(scip, SCIP_PARAMSETTING_OFF) );
1134 
1135  return SCIP_OKAY;
1136 }
1137 
1139 SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsFast)
1140 { /*lint --e{715}*/
1141  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1142 
1143  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1144 
1145  SCIP_CALL( GCGsetSeparators(scip, SCIP_PARAMSETTING_FAST) );
1146 
1147  return SCIP_OKAY;
1148 }
1149 
1151 SCIP_RETCODE GCGcreateRootDialog(
1152  SCIP* scip,
1153  SCIP_DIALOG** root
1154  )
1155 {
1156  SCIP_CALL( SCIPincludeDialog(scip, root, NULL, SCIPdialogExecMenuLazy, NULL, NULL,
1157  "GCG", "GCG's main menu", TRUE, NULL) );
1158 
1159  SCIP_CALL( SCIPsetRootDialog(scip, *root) );
1160  SCIP_CALL( SCIPreleaseDialog(scip, root) );
1161  *root = SCIPgetRootDialog(scip);
1162 
1163  return SCIP_OKAY;
1164 }
1165 
1167 static
1169  SCIP* scip,
1170  SCIP_DIALOG* root,
1171  SCIP_DIALOG** submenu
1172  )
1173 {
1174  if( !SCIPdialogHasEntry(root, "emphasis") )
1175  {
1176  SCIP_CALL( SCIPincludeDialog(scip, submenu,
1177  NULL, SCIPdialogExecMenu, NULL, NULL,
1178  "emphasis", "predefined parameter settings", TRUE, NULL) );
1179  SCIP_CALL( SCIPaddDialogEntry(scip, root, *submenu) );
1180  SCIP_CALL( SCIPreleaseDialog(scip, submenu) );
1181  }
1182  else if( SCIPdialogFindEntry(root, "emphasis", submenu) != 1 )
1183  {
1184  SCIPerrorMessage("emphasis sub menu not found\n");
1185  return SCIP_PLUGINNOTFOUND;
1186  }
1187 
1188  assert(*submenu != NULL);
1189 
1190  return SCIP_OKAY;
1191 }
1192 
1195  SCIP* scip
1196  )
1197 {
1198  SCIP_DIALOG* root;
1199  SCIP_DIALOG* submenu;
1200  SCIP_DIALOG* dialog;
1201  SCIP_DIALOG* setmenu;
1202  SCIP_DIALOG* emphasismenu;
1203 
1204  /* root menu */
1205  root = SCIPgetRootDialog(scip);
1206  if( root == NULL )
1207  {
1208  SCIP_CALL( GCGcreateRootDialog(scip, &root) );
1209  }
1210 
1211  /* display */
1212  if( !SCIPdialogHasEntry(root, "display") )
1213  {
1214  SCIP_CALL( SCIPincludeDialog(scip, &submenu, NULL, SCIPdialogExecMenu, NULL, NULL,
1215  "display", "display information", TRUE, NULL) );
1216  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1217  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1218  }
1219  if( SCIPdialogFindEntry(root, "display", &submenu) != 1 )
1220  {
1221  SCIPerrorMessage("display sub menu not found\n");
1222  return SCIP_PLUGINNOTFOUND;
1223  }
1224 
1225  /* display statistics */
1226  if( !SCIPdialogHasEntry(submenu, "statistics") )
1227  {
1228  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDisplayStatistics, NULL, NULL,
1229  "statistics", "display problem and optimization statistics", FALSE, NULL) );
1230  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1231  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1232  }
1233  /* display statistics */
1234  if( !SCIPdialogHasEntry(submenu, "detectionstatistics") )
1235  {
1236  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecPrintDetectionInformation, NULL, NULL,
1237  "detectionstatistics", "display complete detection information", FALSE, NULL) );
1238  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1239  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1240  }
1241 
1242  /* display decomposition */
1243  if( !SCIPdialogHasEntry(submenu, "decomposition") )
1244  {
1245  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDisplayDecomposition, NULL, NULL,
1246  "decomposition", "display decomposition", FALSE, NULL) );
1247  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1248  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1249  }
1250 
1251  /* display nblockcandidates */
1252  if( !SCIPdialogHasEntry(submenu, "blocknumbercandidates") )
1253  {
1254  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDisplayNBlockcandidates, NULL, NULL,
1255  "blocknumbercandidates", "display number of blocks candidates ", FALSE, NULL) );
1256  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1257  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1258  }
1259 
1260 
1261  /* display additionalstatistics */
1262  if( !SCIPdialogHasEntry(submenu, "additionalstatistics") )
1263  {
1264  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDisplayAdditionalStatistics, NULL, NULL,
1265  "additionalstatistics", "display additional solving statistics", FALSE, NULL) );
1266  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1267  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1268  }
1269 
1270 
1271  /* display solvers */
1272  if( !SCIPdialogHasEntry(submenu, "solvers") )
1273  {
1274  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDisplaySolvers, NULL, NULL,
1275  "solvers", "display available pricing problem solvers", FALSE, NULL) );
1276  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1277  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1278  }
1279 
1280  /* master */
1281  if( !SCIPdialogHasEntry(root, "master") )
1282  {
1283  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecSetMaster, NULL, NULL,
1284  "master", "switch to the interactive shell of the master problem", FALSE, NULL) );
1285  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
1286  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1287  }
1288 
1289  /* optimize */
1290  if( !SCIPdialogHasEntry(root, "optimize") )
1291  {
1292  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1293  NULL,
1294  GCGdialogExecOptimize, NULL, NULL,
1295  "optimize", "solve the problem", FALSE, NULL) );
1296  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
1297  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1298  }
1299 
1300  /* explore */
1301  if( !SCIPdialogHasEntry(root, "explore") )
1302  {
1303  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1304  NULL,
1305  GCGdialogExecSelect, NULL, NULL,
1306  "explore", "explore decompositions", FALSE, NULL) );
1307  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1308  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1309  }
1310 
1311  /* select */
1312  if( !SCIPdialogHasEntry(root, "decomposition_toolbox") )
1313  {
1314  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1315  NULL,
1316  GCGdialogExecToolbox, NULL, NULL,
1317  "decomposition_toolbox", "create/modify (partial) decompositions", FALSE, NULL) );
1318  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1319  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1320  }
1321 
1322 
1323  /* detect */
1324  if( !SCIPdialogHasEntry(root, "detect") )
1325  {
1326  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecDetect, NULL, NULL,
1327  "detect", "detect structure", FALSE, NULL) );
1328  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
1329  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1330  }
1331 
1332  /* quit */
1333  if( !SCIPdialogHasEntry(root, "quit") )
1334  {
1335  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1336  NULL,
1337  SCIPdialogExecQuit, NULL, NULL,
1338  "quit", "leave GCG", FALSE, NULL) );
1339  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
1340  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1341  }
1342 
1343  /* set */
1344  if( !SCIPdialogHasEntry(root, "set") )
1345  {
1346  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1347  NULL, SCIPdialogExecMenu, NULL, NULL,
1348  "set", "load/save/change parameters", TRUE, NULL) );
1349  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1350  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1351  }
1352  if( SCIPdialogFindEntry(root, "set", &setmenu) != 1 )
1353  {
1354  SCIPerrorMessage("set sub menu not found\n");
1355  return SCIP_PLUGINNOTFOUND;
1356  }
1357 
1358  /* set loadmaster */
1359  if( !SCIPdialogHasEntry(setmenu, "loadmaster") )
1360  {
1361  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1362  NULL,
1363  GCGdialogExecSetLoadmaster, NULL, NULL,
1364  "loadmaster", "load parameter settings for master problem from a file", FALSE, NULL) );
1365  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, dialog) );
1366  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1367  }
1368 
1369 
1370 
1371  /* set detectors */
1372  if( !SCIPdialogHasEntry(setmenu, "detection") )
1373  {
1374  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1375  NULL,
1376  SCIPdialogExecMenu, NULL, NULL,
1377  "detection", "change parameters for detection in general", TRUE, NULL) );
1378  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
1379  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1380  }
1381  if( SCIPdialogFindEntry(setmenu, "detection", &submenu) != 1 )
1382  {
1383  SCIPerrorMessage("detection sub menu not found\n");
1384  return SCIP_PLUGINNOTFOUND;
1385  }
1386 
1387 
1388  /* create set detectors emphasis */
1389  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
1390  assert(emphasismenu != NULL);
1391 
1392  /* set detectors emphasis aggressive */
1393  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1394  {
1395  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1396  NULL, SCIPdialogExecSetDetectorsAggressive, NULL, NULL,
1397  "aggressive", "sets detection <aggressive>", FALSE, NULL) );
1398  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1399  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1400  }
1401 
1402  /* set detectors emphasis default */
1403  if( !SCIPdialogHasEntry(emphasismenu, "default") )
1404  {
1405  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1406  NULL, SCIPdialogExecSetDetectorsDefault, NULL, NULL,
1407  "default", "sets detection <default>", FALSE, NULL) );
1408  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1409  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1410  }
1411 
1412  /* set detectors emphasis fast */
1413  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1414  {
1415  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1416  NULL, SCIPdialogExecSetDetectorsFast, NULL, NULL,
1417  "fast", "sets detection <fast>", FALSE, NULL) );
1418  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1419  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1420  }
1421 
1422  /* set detectors emphasis off */
1423  if( !SCIPdialogHasEntry(emphasismenu, "off") )
1424  {
1425  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1426  NULL, SCIPdialogExecSetDetectorsOff, NULL, NULL,
1427  "off", "turns <off> all detectors", FALSE, NULL) );
1428  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1429  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1430  }
1431 
1432  /* set heuristics */
1433  if( !SCIPdialogHasEntry(setmenu, "heuristics") )
1434  {
1435  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1436  NULL,
1437  SCIPdialogExecMenu, NULL, NULL,
1438  "heuristics", "change parameters for primal heuristics", TRUE, NULL) );
1439  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
1440  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1441  }
1442  if( SCIPdialogFindEntry(setmenu, "heuristics", &submenu) != 1 )
1443  {
1444  SCIPerrorMessage("heuristics sub menu not found\n");
1445  return SCIP_PLUGINNOTFOUND;
1446  }
1447 
1448  /* create set heuristics emphasis */
1449  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
1450  assert(emphasismenu != NULL);
1451 
1452  /* set heuristics emphasis aggressive */
1453  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1454  {
1455  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1456  NULL, GCGdialogExecSetHeuristicsAggressive, NULL, NULL,
1457  "aggressive", "sets heuristics <aggressive>", FALSE, NULL) );
1458  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1459  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1460  }
1461 
1462  /* set heuristics emphasis fast */
1463  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1464  {
1465  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1466  NULL, GCGdialogExecSetHeuristicsFast, NULL, NULL,
1467  "fast", "sets heuristics <fast>", FALSE, NULL) );
1468  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1469  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1470  }
1471 
1472  /* set heuristics emphasis off */
1473  if( !SCIPdialogHasEntry(emphasismenu, "off") )
1474  {
1475  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1476  NULL, GCGdialogExecSetHeuristicsOff, NULL, NULL,
1477  "off", "turns <off> all heuristics", FALSE, NULL) );
1478  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1479  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1480  }
1481 
1482  /* set heuristics */
1483  if( !SCIPdialogHasEntry(setmenu, "sepa") )
1484  {
1485  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1486  NULL,
1487  SCIPdialogExecMenu, NULL, NULL,
1488  "sepa", "change parameters for gcg separators", TRUE, NULL) );
1489  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
1490  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1491  }
1492  if( SCIPdialogFindEntry(setmenu, "sepa", &submenu) != 1 )
1493  {
1494  SCIPerrorMessage("gcg separators sub menu not found\n");
1495  return SCIP_PLUGINNOTFOUND;
1496  }
1497 
1498  /* create set separators emphasis */
1499  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
1500  assert(emphasismenu != NULL);
1501 
1502  /* set separators emphasis default */
1503  if( !SCIPdialogHasEntry(emphasismenu, "default") )
1504  {
1505  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1506  NULL, GCGdialogExecSetSeparatorsDefault, NULL, NULL,
1507  "default", "sets separators <default>", FALSE, NULL) );
1508  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1509  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1510  }
1511 
1512  /* set separators emphasis aggressive */
1513  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1514  {
1515  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1516  NULL, GCGdialogExecSetSeparatorsAggressive, NULL, NULL,
1517  "aggressive", "sets separators <aggressive>", FALSE, NULL) );
1518  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1519  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1520  }
1521 
1522  /* set separators emphasis fast */
1523  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1524  {
1525  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1526  NULL, GCGdialogExecSetSeparatorsFast, NULL, NULL,
1527  "fast", "sets separators <fast>", FALSE, NULL) );
1528  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1529  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1530  }
1531 
1532  /* set separators emphasis off */
1533  if( !SCIPdialogHasEntry(emphasismenu, "off") )
1534  {
1535  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1536  NULL, GCGdialogExecSetSeparatorsOff, NULL, NULL,
1537  "off", "turns <off> all separators", FALSE, NULL) );
1538  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
1539  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1540  }
1541 
1542  /* write */
1543  if( !SCIPdialogHasEntry(root, "write") )
1544  {
1545  SCIP_CALL( SCIPincludeDialog(scip, &submenu, NULL, SCIPdialogExecMenu, NULL, NULL,
1546  "write", "write information to file", TRUE, NULL) );
1547  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1548  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1549  }
1550  if( SCIPdialogFindEntry(root, "write", &submenu) != 1 )
1551  {
1552  SCIPerrorMessage("write sub menu not found\n");
1553  return SCIP_PLUGINNOTFOUND;
1554  }
1555 
1556  /* write alldecompositions */
1557  if( !SCIPdialogHasEntry(submenu, "alldecompositions") )
1558  {
1559  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecWriteAllDecompositions, NULL, NULL,
1560  "alldecompositions",
1561  "write all known decompositions to files (format is given by file extension, e.g. {dec,blk,ref,gp,tex})",
1562  FALSE, NULL) );
1563  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1564  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1565  }
1566 
1567  /* write original decompositions */
1568  if( !SCIPdialogHasEntry(submenu, "alloriginaldecompositions") )
1569  {
1570  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecWriteOriginalDecompositions, NULL, NULL,
1571  "alloriginaldecompositions",
1572  "write all known original decompositions to files (format is given by file extension, e.g. {dec,blk,ref,gp,tex})",
1573  FALSE, NULL) );
1574  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1575  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1576  }
1577 
1578  /* write alldecompositions */
1579  if( !SCIPdialogHasEntry(submenu, "allpresolveddecompositions") )
1580  {
1581  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecWritePresolvedDecompositions, NULL, NULL,
1582  "allpresolveddecompositions",
1583  "write all known presolved decompositions to files (format is given by file extension, e.g. {dec,blk,ref,gp,tex})",
1584  FALSE, NULL) );
1585  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1586  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1587  }
1588 
1589 
1590 
1591  /* write family tree of whites decompositions */
1592  if( !SCIPdialogHasEntry(submenu, "familytree") )
1593  {
1594  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecWriteFamilyTree, NULL, NULL,
1595  "familytree",
1596  "write all (partial) decompositions contained in family tree to files (.gp/.tex) and create family tree file (.tex)",
1597  FALSE, NULL) );
1598  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1599  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1600  }
1601 
1602  /* write reportdecompositions */
1603  if( !SCIPdialogHasEntry(submenu, "reportdecompositions") )
1604  {
1605  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecReportAllDecompositions, NULL, NULL,
1606  "reportdecompositions",
1607  "write report of all finished decompositions to LaTeX format",
1608  FALSE, NULL) );
1609  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1610  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1611  }
1612 
1613  /* write statistics */
1614  if( !SCIPdialogHasEntry(submenu, "statistics") )
1615  {
1616  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, GCGdialogExecWriteStatistics, NULL, NULL,
1617  "statistics",
1618  "write statistics to file",
1619  FALSE, NULL) );
1620  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1621  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1622  }
1623 
1624 
1625  /* change */
1626  if( !SCIPdialogHasEntry(root, "change") )
1627  {
1628  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
1629  NULL,
1630  SCIPdialogExecMenu, NULL, NULL,
1631  "change", "change the problem", TRUE, NULL) );
1632  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
1633  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
1634  }
1635  if( SCIPdialogFindEntry(root, "change", &submenu) != 1 )
1636  {
1637  SCIPerrorMessage("change sub menu not found\n");
1638  return SCIP_PLUGINNOTFOUND;
1639  }
1640 
1641  /* add blocknr candidate*/
1642  if( !SCIPdialogHasEntry(submenu, "blocknr") )
1643  {
1644  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1645  NULL,
1646  GCGdialogExecChangeAddBlocknr, NULL, NULL,
1647  "blocknr", "add block number candidate", FALSE, NULL) );
1648  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1649  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1650  }
1651 
1652  /* add instance name entry*/
1653  if( !SCIPdialogHasEntry(submenu, "instancename") )
1654  {
1655  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL,
1656  GCGdialogExecChangeAddInstancename, NULL, NULL,
1657  "instancename", "add instancename information", FALSE, NULL) );
1658  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1659  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1660  }
1661 
1662  if( SCIPdialogFindEntry(root, "set", &submenu) != 1 )
1663  {
1664  SCIPerrorMessage("set sub menu not found\n");
1665  return SCIP_PLUGINNOTFOUND;
1666  }
1667 
1668  if( SCIPdialogFindEntry(submenu, "detection", &submenu) != 1 )
1669  {
1670  SCIPerrorMessage("set/detection sub menu not found\n");
1671  return SCIP_PLUGINNOTFOUND;
1672  }
1673 
1674  /* add blocknr candidate*/
1675  if( !SCIPdialogHasEntry(submenu, "addblocknr") )
1676  {
1677  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
1678  NULL,
1679  GCGdialogExecChangeAddBlocknr, NULL, NULL,
1680  "addblocknr", "add block number candidates (as white space separated list)", FALSE, NULL) );
1681  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
1682  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
1683  }
1684 
1685 
1686 
1687  return SCIP_OKAY;
1688 }
SCIP_RETCODE DECdetectStructure(SCIP *scip, SCIP_RESULT *result)
SCIP_RETCODE GCGprintCompleteDetectionStatistics(SCIP *scip, FILE *file)
Definition: misc.c:761
DEC_DECOMP * DECgetBestDecomp(SCIP *scip)
void DECprintListOfDetectors(SCIP *scip)
SCIP_Bool DEChasDetectionRun(SCIP *scip)
SCIP_Bool SCIPconshdlrDecompUnpresolvedSeeedExists(SCIP *scip)
returns whether or not an unpresolved (untransformed) decompositions exists in the data structures ...
SCIP_RETCODE GCGprintStatistics(SCIP *scip, FILE *file)
Definition: misc.c:659
SCIP_RETCODE GCGprintOptionalOutput(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr)
SCIP_RETCODE GCGwriteDecompositionData(SCIP *scip)
Definition: stat.c:48
GCG interface methods.
SCIP_RETCODE DECwriteFamilyTree(SCIP *scip, const char *filename, const char *workfolder, int ndecompositions, SCIP_Bool draft)
SCIP_Bool GCGreportGetShowTitlepage()
Definition: params_visu.c:561
SCIP_RETCODE SCIPconshdlrDecompExecToolbox(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
method to handle and moderate user input for creating new decompositions and modifying existing decom...
SCIP_RETCODE SCIPconshdlrDecompExecSelect(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
method too handle user input for "explore" command
SCIP_RETCODE SCIPconshdlrDecompChooseCandidatesFromSelected(SCIP *scip, SCIP_Bool updatelist)
initilizes the candidates data structures with selected seeeds (or all if there are no selected seeed...
SCIP * GCGgetMasterprob(SCIP *scip)
Definition: relax_gcg.c:3838
SCIP_RETCODE DECdecompFree(SCIP *scip, DEC_DECOMP **decdecomp)
Definition: decomp.c:525
DEC file reader for structure information.
SCIP_RETCODE SCIPconshdlrDecompAddBlockNumberCandidate(SCIP *scip, int blockNumberCandidate)
add block number user candidate (user candidates are prioritized over found ones) ...
SCIP_Bool GCGgetUseGp()
Definition: params_visu.c:533
Prints information about the best decomposition.
SCIP_RETCODE GCGsetDetection(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
static SCIP_RETCODE writeFamilyTree(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
Definition: dialog_gcg.c:214
DEC_DECTYPE GCGreportGetDecompTypeToShow()
Definition: params_visu.c:554
SCIP_Bool GCGreportGetShowStatistics()
Definition: params_visu.c:575
SCIP_RETCODE GCGwriteDecomp(SCIP *scip, FILE *file, DEC_DECOMP *decdecomp)
SCIP_RETCODE GCGwriteTexReport(SCIP *scip, FILE *file, int *seeedids, int *nseeeds, SCIP_Bool titlepage, SCIP_Bool toc, SCIP_Bool statistics, SCIP_Bool usegp)
Definition: reader_tex.cpp:758
void GCGpricerPrintStatistics(SCIP *scip, FILE *file)
DEC_DECTYPE DECdecompGetType(DEC_DECOMP *decomp)
Definition: decomp.c:686
SCIP_RETCODE GCGcreateRootDialog(SCIP *scip, SCIP_DIALOG **root)
Definition: dialog_gcg.c:1151
int DECdecompGetSeeedID(DEC_DECOMP *decomp)
Definition: decomp.c:1633
enum Dectype DEC_DECTYPE
Definition: type_decomp.h:55
static SCIP_RETCODE createEmphasisSubmenu(SCIP *scip, SCIP_DIALOG *root, SCIP_DIALOG **submenu)
Definition: dialog_gcg.c:1168
void GCGpricerPrintListOfSolvers(SCIP *scip)
SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayStatistics)
Definition: dialog_gcg.c:420
static void displayReaders(SCIP *scip, SCIP_Bool reader, SCIP_Bool writer)
Definition: dialog_gcg.c:62
SCIP_RETCODE GCGsetFilename(SCIP *scip, const char *filename)
Definition: relax_gcg.c:4804
GCG relaxator.
int SCIPconshdlrDecompGetNFinishedDecomps(SCIP *scip)
SCIP_Bool SCIPvisuGetDraftmode()
Definition: params_visu.c:272
GCG variable pricer.
SCIP_RETCODE GCGsetHeuristics(SCIP *scip, SCIP_PARAMSETTING paramsetting)
Definition: gcgheur.c:152
SCIP_Bool SCIPconshdlrDecompExistsSelected(SCIP *scip)
returns if there is a decomposition that is currently selected by the user (done in explore menue) ...
SCIP_Bool SCIPconshdlrDecompCheckConsistency(SCIP *scip)
static SCIP_RETCODE reportAllDecompositions(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
Definition: dialog_gcg.c:306
SCIP_RETCODE GCGprintBlockcandidateInformation(SCIP *scip, FILE *file)
SCIP_Bool SCIPconshdlrDecompHasDecomp(SCIP *scip)
returns whether or not there exists at least one (com[plete or incomplete) decomposition ...
tex file reader for writing decomposition details to LaTeX files
int GCGfamtreeGetMaxNDecomps()
Definition: params_visu.c:582
SCIP_RETCODE SCIPconshdlrDecompNotifyFinishedNonFinalFreeTransform(SCIP *scip)
used after calling SCIPfreeTransform() if called to revoke presolving (e.g. if unpresolved decomposit...
SCIP_Bool GCGreportGetShowToc()
Definition: params_visu.c:568
SCIP_RETCODE SCIPincludeDialogGcg(SCIP *scip)
Definition: dialog_gcg.c:1194
SCIP_RETCODE SCIPconshdlrDecompNotifyNonFinalFreeTransform(SCIP *scip)
used before calling SCIPfreeTransform(),, if called to revoke presolving (e.g. if unpresolved decompo...
SCIP_RETCODE DECwriteAllDecomps(SCIP *scip, char *directory, char *extension, SCIP_Bool original, SCIP_Bool presolved)
SCIP_RETCODE SCIPconshdlrDecompTranslateAndAddCompleteUnpresolvedSeeeds(SCIP *scip, SCIP_Bool *success)
translates unpresolved seeed to a complete presolved one
SCIP_Bool SCIPconshdlrDecompIsBestCandidateUnpresolved(SCIP *scip)
int GCGreportGetMaxNDecomps()
Definition: params_visu.c:547
GCG user interface dialog.
SCIP_RETCODE GCGsetSeparators(SCIP *scip, SCIP_PARAMSETTING paramsetting)
Definition: gcgsepa.c:179
constraint handler for structure detection
struct DecDecomp DEC_DECOMP
Definition: type_decomp.h:43
public methods for GCG separators
DEC_DECOMP ** SCIPconshdlrDecompGetFinishedDecomps(SCIP *scip)
static SCIP_RETCODE writeAllDecompositions(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog, SCIP_Bool original, SCIP_Bool presolved)
Definition: dialog_gcg.c:99
SCIP_RETCODE GCGwriteVarCreationDetails(SCIP *scip)
Definition: stat.c:104
public methods for GCG heuristics