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-2015 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file 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 "cons_stp.h"
33 #include "heur_tm.h"
34 #include "heur_local.h"
35 #include "heur_rec.h"
36 #include "pricer_stp.h"
37 #include "event_bestsol.h"
38 #include "probdata_stp.h"
39 #include "dialog_stp.h"
40 #include "prop_stp.h"
41 #include "branch_stp.h"
42 
43 /** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
44  * and frees the SCIP instance
45  */
46 static
47 SCIP_RETCODE runShell(
48  int argc, /**< number of shell parameters */
49  char** argv, /**< array containing shell parameters */
50  const char* defaultsetname /**< name of default settings file */
51  )
52 {
53  SCIP* scip = NULL;
54 
55  /*********
56  * Setup *
57  *********/
58 
59  /* initialize SCIP */
60  SCIP_CALL( SCIPcreate(&scip) );
61 
62  /* we explicitly enable the use of a debug solution for this main SCIP instance */
63  SCIPenableDebugSol(scip);
64 
65  /* include stp pricer */
66  SCIP_CALL( SCIPincludePricerStp(scip) );
67 
68  /* include steiner tree reader */
69  SCIP_CALL( SCIPincludeReaderStp(scip) );
70 
71  /* include default SCIP plugins */
72  SCIP_CALL( SCIPincludeDefaultPlugins(scip) );
73 
74  /* include STP dialog */
75  SCIP_CALL( SCIPincludeDialogStp(scip) );
76 
77  /* include steiner tree constraint handler */
78  SCIP_CALL( SCIPincludeConshdlrStp(scip) );
79 #if 1
80  /* include Takahashi Matsuyama heuristic */
81  SCIP_CALL( SCIPincludeHeurTM(scip) );
82 
83  /* include local heuristics */
84  SCIP_CALL( SCIPincludeHeurLocal(scip) );
85 #if 1
86  /* include recombination heuristic */
87  SCIP_CALL( SCIPincludeHeurRec(scip) );
88 #endif
89 #endif
90  /* include event handler for printing primal solution development */
91  SCIP_CALL( SCIPincludeEventHdlrBestsol(scip) );
92 
93  /* include branching rule */
94  SCIP_CALL( SCIPincludeBranchruleStp(scip) );
95 
96  /* include propagator */
97  SCIP_CALL( SCIPincludePropStp(scip) );
98 
99  /* set STP-specific default parameters */
100  SCIP_CALL( SCIPsetIntParam(scip, "presolving/maxrestarts", 0) );
101  SCIP_CALL( SCIPsetIntParam(scip, "display/freq", 1) );
102  SCIP_CALL( SCIPsetIntParam(scip, "limits/maxsol", 400) );
103  SCIP_CALL( SCIPsetIntParam(scip, "lp/rowagelimit", 30) );
104  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxrounds", -1) );
105  SCIP_CALL( SCIPsetIntParam(scip, "separating/maxstallrounds", -1) );
106  SCIP_CALL( SCIPsetIntParam(scip, "branching/relpscost/maxproprounds", 0) );
107  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/coefdiving/freq", -1) );
108  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/feaspump/freq", -1) );
109  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/fracdiving/freq", -1) );
110  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/guideddiving/freq", -1) );
111  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/linesearchdiving/freq", -1) );
112  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/nlpdiving/freq", -1) );
113  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/objpscostdiving/freq", -1) );
114  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/pscostdiving/freq", -1) );
115  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/randrounding/freq", -1) );
116  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/rootsoldiving/freq", -1) );
117  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/shiftandpropagate/freq", -1) );
118  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/shifting/freq", -1) );
119  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/subnlp/freq", -1) );
120  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/undercover/freq", -1) );
121  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/veclendiving/freq", -1) );
122  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/zirounding/freq", -1) );
123  SCIP_CALL( SCIPsetIntParam(scip, "propagating/probing/maxprerounds", 0) );
124  SCIP_CALL( SCIPsetIntParam(scip, "propagating/pseudoobj/timingmask", 5) );
125  SCIP_CALL( SCIPsetIntParam(scip, "propagating/redcost/freq", -1) );
126  SCIP_CALL( SCIPsetRealParam(scip, "branching/relpscost/maxreliable", 1.0) );
127  SCIP_CALL( SCIPsetRealParam(scip, "separating/minefficacyroot", 0.01) );
128 
129  /**********************************
130  * Process command line arguments *
131  **********************************/
132  SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
133 
134  /********************
135  * Deinitialization *
136  ********************/
137 
138  SCIP_CALL( SCIPfree(&scip) );
139 
140  BMScheckEmptyMemory();
141 
142  return SCIP_OKAY;
143 }
144 
145 int
147  int argc, /**< number of shell parameters */
148  char** argv /**< array containing shell parameters */
149  )
150 {
151  SCIP_RETCODE retcode;
152 
153  retcode = runShell(argc, argv, "scip.set");
154  if( retcode != SCIP_OKAY )
155  {
156  SCIPprintError(retcode);
157  return -1;
158  }
159 
160  return 0;
161 }
stp variable pricer
SCIP_RETCODE SCIPincludePricerStp(SCIP *scip)
Definition: pricer_stp.c:377
Constraint handler for Steiner problems.
SCIP_RETCODE SCIPincludeHeurTM(SCIP *scip)
Definition: heur_tm.c:2687
int main(int argc, char **argv)
Definition: cmain.c:146
SCIP_RETCODE SCIPincludeBranchruleStp(SCIP *scip)
Definition: branch_stp.c:277
Problem data for stp problem.
Steiner tree problem file reader.
SCIP_RETCODE SCIPincludeHeurRec(SCIP *scip)
Definition: heur_rec.c:1236
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:47
SCIP_RETCODE SCIPincludeReaderStp(SCIP *scip)
Definition: reader_stp.c:143
SCIP_RETCODE SCIPincludeConshdlrStp(SCIP *scip)
Definition: cons_stp.c:1070
stp user interface dialog
Improvement heuristic for Steiner problems.
SCIP_RETCODE SCIPincludePropStp(SCIP *scip)
Definition: prop_stp.c:342
propagator for Steiner tree problems, using the LP reduced costs
SCIP_RETCODE SCIPincludeDialogStp(SCIP *scip)
Definition: dialog_stp.c:48
eventhdlr for best solution found
Steiner vertex branching rule.
SCIP_RETCODE SCIPincludeEventHdlrBestsol(SCIP *scip)
Primal recombination heuristic for Steiner problems.
shortest paths based primal heuristics for Steiner problems
SCIP_RETCODE SCIPincludeHeurLocal(SCIP *scip)
Definition: heur_local.c:2421