Scippy

SCIP

Solving Constraint Integer Programs

HeurFarthestInsert.h
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-2021 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 scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file HeurFarthestInsert.h
17  * @brief farthest insert - combinatorial heuristic for TSP
18  * @author Timo Berthold
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __HEURFARTHESTINSERT_H__
24 #define __HEURFARTHESTINSERT_H__
25 
26 #include "objscip/objscip.h"
27 
28 namespace tsp
29 {
30 
31 /** C++ farthest insert heuristic for TSP */
33 {
34  GRAPH* graph_; /**< the underlying graph of the TSP */
35 
36 public:
37  /** default constructor */
39  SCIP* scip
40  )
41  : ObjHeur(scip, "farthestinsert", "farthest insert heuristic for TSPs", 'I',-10000, 0, 0, 0,
43  graph_(0)
44  {
45  }
46 
47  /** destructor */
49  {
50  if( graph_ != NULL )
51  release_graph(&graph_); /*lint !e1551*/
52  }
53 
54 
55  /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
56  virtual SCIP_DECL_HEURFREE(scip_free);
57 
58  /** initialization method of primal heuristic (called after problem was transformed) */
59  virtual SCIP_DECL_HEURINIT(scip_init);
60 
61  /** deinitialization method of primal heuristic (called before transformed problem is freed) */
62  virtual SCIP_DECL_HEUREXIT(scip_exit);
63 
64  /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
65  *
66  * This method is called when the presolving was finished and the branch and bound process is about to begin.
67  * The primal heuristic may use this call to initialize its branch and bound specific data.
68  *
69  */
70  virtual SCIP_DECL_HEURINITSOL(scip_initsol);
71 
72  /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
73  *
74  * This method is called before the branch and bound process is freed.
75  * The primal heuristic should use this call to clean up its branch and bound data.
76  */
77  virtual SCIP_DECL_HEUREXITSOL(scip_exitsol);
78 
79  /** execution method of primal heuristic
80  *
81  * Searches for feasible primal solutions. The method is called in the node processing loop.
82  *
83  * possible return values for *result:
84  * - SCIP_FOUNDSOL : at least one feasible primal solution was found
85  * - SCIP_DIDNOTFIND : the heuristic searched, but did not find a feasible solution
86  * - SCIP_DIDNOTRUN : the heuristic was skipped
87  * - SCIP_DELAYED : the heuristic was skipped, but should be called again as soon as possible, disregarding
88  * its frequency
89  */
90  virtual SCIP_DECL_HEUREXEC(scip_exec);
91 
92  /** clone method which will be used to copy a objective plugin */
93  virtual SCIP_DECL_HEURCLONE(ObjCloneable* clone); /*lint !e665*/
94 
95  /** returns whether the objective plugin is copyable */
96  virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
97  {
98  return true;
99  }
100 }; /*lint !e1712*/
101 
102 }
103 #endif
Definition: grph.h:57
C++ wrapper for primal heuristics.
Definition: objheur.h:43
virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
#define SCIP_HEURTIMING_BEFORENODE
Definition: type_timing.h:70
virtual SCIP_DECL_HEURINIT(scip_init)
#define FALSE
Definition: def.h:73
virtual SCIP_DECL_HEURINITSOL(scip_initsol)
virtual SCIP_DECL_HEURFREE(scip_free)
#define NULL
Definition: lpi_spx1.cpp:155
C++ wrapper classes for SCIP.
virtual SCIP_DECL_HEUREXITSOL(scip_exitsol)
virtual SCIP_DECL_HEUREXIT(scip_exit)
ObjHeur(SCIP *scip, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip)
Definition: objheur.h:79
void release_graph(GRAPH **gr)
virtual SCIP_DECL_HEURCLONE(ObjCloneable *clone)
virtual SCIP_DECL_HEUREXEC(scip_exec)