Scippy

SCIP

Solving Constraint Integer Programs

cmain.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file STP/src/cmain.c
17  * @brief Main file for SCIP-Jack
18  * @author Gerald Gamrath
19  * @author Daniel Rehfeldt
20  *
21  * This the file contains the \ref main() main function of the projects. This includes all the default plugins of
22  * \SCIP and the once which belong to that projects. After that is starts the interactive shell of \SCIP or processes
23  * the shell arguments if given.
24  */
25 #include <stdio.h>
26 
27 #include "scip/scip.h"
28 #include "scip/scipshell.h"
29 #include "scip/scipdefplugins.h"
30 
31 #include "reader_stp.h"
32 #include "reader_gr.h"
33 #include "cons_stp.h"
34 #include "heur_tm.h"
35 #include "heur_local.h"
36 #include "heur_prune.h"
37 #include "heur_ascendprune.h"
38 #include "heur_slackprune.h"
39 #include "heur_rec.h"
40 #include "pricer_stp.h"
41 #include "event_bestsol.h"
42 #include "probdata_stp.h"
43 #include "dialog_stp.h"
44 #include "prop_stp.h"
45 #include "branch_stp.h"
46 
47 /** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
48  * and frees the SCIP instance
49  */
50 static
52  int argc, /**< number of shell parameters */
53  char** argv, /**< array containing shell parameters */
54  const char* defaultsetname /**< name of default settings file */
55  )
56 {
57  SCIP* scip = NULL;
58 
59  /*********
60  * Setup *
61  *********/
62 
63  /* initialize SCIP */
64  SCIP_CALL( SCIPcreate(&scip) );
65 
66  /* we explicitly enable the use of a debug solution for this main SCIP instance */
67  SCIPenableDebugSol(scip);
68 
69  /* include stp pricer */
71 
72  /* include Steiner tree reader */
75 
76  /* include default SCIP plugins */
78 
79  /* include STP dialog */
81 
82  /* include Steiner tree constraint handler */
84 
85  /* include shortest path heuristic */
87 
88  /* include local heuristics */
90 
91  /* include recombination heuristic */
93 
94  /* include pruning heuristic */
96 
97  /* include ascend-and-prune heuristic */
99 
100  /* include slack-and-prune heuristic */
102 
103  /* include event handler for printing primal solution development */
105 
106  /* include branching rule */
108 
109  /* include propagator */
110  SCIP_CALL( SCIPincludePropStp(scip) );
111 
113 
114  /* set STP-specific default parameters */
115  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrestarts", 0) );
116  SCIP_CALL( SCIPsetIntParam(scip, "display/freq", 1) );
117  SCIP_CALL( SCIPsetIntParam(scip, "limits/maxsol", 400) );
118  SCIP_CALL( SCIPsetIntParam(scip, "lp/rowagelimit", 30) );
119  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxroundsroot", -1) );
120  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxrounds", -1) );
121  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxstallroundsroot", -1) );
122  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxcutsroot", 100000) );
123  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxcuts", 1000) ); // todo tune
124 
125  SCIP_CALL( SCIPsetRealParam(scip, "separating/minefficacyroot", 0.01) ); // todo tune
126  SCIP_CALL( SCIPsetRealParam(scip, "separating/minorthoroot", 0.4) ); // todo tune > 0.4
127  SCIP_CALL( SCIPsetRealParam(scip, "separating/minortho", 0.4) ); // todo tune > 0.4 best soplex: 0.8
128  SCIP_CALL( SCIPsetRealParam(scip, "separating/objparalfac", 0.01) ); // todo tune < 0.1
129 
130  SCIP_CALL( SCIPsetRealParam(scip, "separating/intsupportfac", 0.0) );
131  SCIP_CALL( SCIPsetIntParam(scip, "branching/relpscost/maxproprounds", 0) );
132  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/alns/freq", -1) );
133  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/coefdiving/freq", -1) );
134  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/feaspump/freq", -1) );
135  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/fracdiving/freq", -1) );
136  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/farkasdiving/freq", -1) );
137  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/guideddiving/freq", -1) );
138  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/linesearchdiving/freq", -1) );
139  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/nlpdiving/freq", -1) );
140  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/objpscostdiving/freq", -1) );
141  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/pscostdiving/freq", -1) );
142  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/randrounding/freq", -1) );
143  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/rootsoldiving/freq", -1) );
144  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/shiftandpropagate/freq", -1) );
145  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/shifting/freq", -1) );
146  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/subnlp/freq", -1) );
147  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/undercover/freq", -1) );
148  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/veclendiving/freq", -1) );
149  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/zirounding/freq", -1) );
150  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/oneopt/freq", -1) );
151  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/rounding/freq", -1) );
152  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/locks/freq", -1) );
153  SCIP_CALL( SCIPsetIntParam(scip, "propagating/probing/maxprerounds", 0) );
154  SCIP_CALL( SCIPsetIntParam(scip, "propagating/pseudoobj/timingmask", 5) );
155  SCIP_CALL( SCIPsetIntParam(scip, "propagating/redcost/freq", -1) );
156  SCIP_CALL( SCIPsetRealParam(scip, "branching/relpscost/maxreliable", 1.0) );
157 
158  // todo test properly; normal dfs?
159  SCIP_CALL( SCIPsetIntParam(scip, "nodeselection/restartdfs/stdpriority", 400000) );
160 
161 
162  /**********************************
163  * Process command line arguments *
164  **********************************/
165  SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
166 
167  /********************
168  * Deinitialization *
169  ********************/
170 
171  SCIP_CALL( SCIPfree(&scip) );
172 
174 
175  return SCIP_OKAY;
176 }
177 
178 int
180  int argc, /**< number of shell parameters */
181  char** argv /**< array containing shell parameters */
182  )
183 {
184  SCIP_RETCODE retcode;
185 
186  retcode = runShell(argc, argv, "scip.set");
187  if( retcode != SCIP_OKAY )
188  {
189  SCIPprintError(retcode);
190  return -1;
191  }
192 
193  return 0;
194 }
stp variable pricer
#define NULL
Definition: def.h:246
#define BMScheckEmptyMemory()
Definition: memory.h:144
eventhdlr for best solution found
SCIP_RETCODE SCIPincludePricerStp(SCIP *scip)
Definition: pricer_stp.c:379
Constraint handler for Steiner problems.
SCIP_RETCODE SCIPStpIncludeHeurTM(SCIP *scip)
Definition: heur_tm.c:2833
SCIP_RETCODE SCIPStpIncludeHeurLocal(SCIP *scip)
Definition: heur_local.c:2273
dual-ascent and reduction based primal heuristic for Steiner problems
SCIP_RETCODE SCIPincludeBranchruleStp(SCIP *scip)
Definition: branch_stp.c:747
reduction and dual-cost based primal heuristic for Steiner problems
#define FALSE
Definition: def.h:72
Problem data for stp problem.
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPStpIncludeHeurRec(SCIP *scip)
Definition: heur_rec.c:2104
Steiner tree problem file reader.
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:338
int main(int argc, char **argv)
Definition: cmain.c:102
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip_param.c:694
SCIP_RETCODE SCIPStpIncludeHeurPrune(SCIP *scip)
Definition: heur_prune.c:908
SCIP command line interface.
SCIP_RETCODE SCIPincludeReaderStp(SCIP *scip)
Definition: reader_stp.c:215
SCIP_RETCODE SCIPincludeConshdlrStp(SCIP *scip)
Definition: cons_stp.c:1573
stp user interface dialog
#define SCIP_CALL(x)
Definition: def.h:358
Improvement heuristic for Steiner problems.
reduction-based primal heuristic for Steiner problems
SCIP_RETCODE SCIPincludePropStp(SCIP *scip)
Definition: prop_stp.c:904
propagator for Steiner tree problems, using the LP reduced costs
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPincludeDialogStp(SCIP *scip)
Definition: dialog_stp.c:48
SCIP_RETCODE SCIPStpIncludeHeurAscendPrune(SCIP *scip)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:578
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:147
Steiner vertex branching rule.
Primal recombination heuristic for Steiner problems.
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:51
shortest paths based primal heuristics for Steiner problems
SCIP_RETCODE SCIPStpIncludeHeurSlackPrune(SCIP *scip)
SCIP_RETCODE SCIPincludeEventHdlrBestsol(SCIP *scip)
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:266
SCIP_RETCODE SCIPincludeReaderGr(SCIP *scip)
Definition: reader_gr.c:100
default SCIP plugins
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip_param.c:973
SCIP callable library.
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:370
void SCIPenableDebugSol(SCIP *scip)
Definition: scip_debug.c:132