Scippy

SCIP

Solving Constraint Integer Programs

HeurFrats.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-2022 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 HeurFrats.h
17  * @brief fractional travelling salesman heuristic - Rounding 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 __HEURFRATS_H__
24 #define __HEURFRATS_H__
25 
26 
27 #include "objscip/objheur.h"
28 #include "GomoryHuTree.h"
29 
30 namespace tsp
31 {
32 
33 /** C++ rounding heuristic for TSP */
34 class HeurFrats : public scip::ObjHeur
35 {
36  GRAPH* graph; /**< the underlying graph of the TSP */
37  SCIP_SOL* sol; /**< current solution */
38 
39 public:
40  /** default constructor */
42  SCIP* scip
43  )
44  : ObjHeur(scip, "frats", "fractional travelling salesman: TSP rounding heuristic", 'T',-50000, 5, 0, -1,
46  graph(NULL),
47  sol(NULL)
48  {
49  }
50 
51  /** destructor */
52  virtual ~HeurFrats()
53  {
54  } /*lint !e1540*/
55 
56  /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
57  virtual SCIP_DECL_HEURFREE(scip_free);
58 
59  /** initialization method of primal heuristic (called after problem was transformed) */
60  virtual SCIP_DECL_HEURINIT(scip_init);
61 
62  /** deinitialization method of primal heuristic (called before transformed problem is freed) */
63  virtual SCIP_DECL_HEUREXIT(scip_exit);
64 
65  /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
66  *
67  * This method is called when the presolving was finished and the branch and bound process is about to begin.
68  * The primal heuristic may use this call to initialize its branch and bound specific data.
69  *
70  */
71  virtual SCIP_DECL_HEURINITSOL(scip_initsol);
72 
73  /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
74  *
75  * This method is called before the branch and bound process is freed.
76  * The primal heuristic should use this call to clean up its branch and bound data.
77  */
78  virtual SCIP_DECL_HEUREXITSOL(scip_exitsol);
79 
80  /** execution method of primal heuristic
81  *
82  * Searches for feasible primal solutions. The method is called in the node processing loop.
83  *
84  * possible return values for *result:
85  * - SCIP_FOUNDSOL : at least one feasible primal solution was found
86  * - SCIP_DIDNOTFIND : the heuristic searched, but did not find a feasible solution
87  * - SCIP_DIDNOTRUN : the heuristic was skipped
88  * - SCIP_DELAYED : the heuristic was skipped, but should be called again as soon as possible, disregarding
89  * its frequency
90  */
91  virtual SCIP_DECL_HEUREXEC(scip_exec);
92 
93  /** clone method which will be used to copy a objective plugin */
94  virtual SCIP_DECL_HEURCLONE(ObjCloneable* clone); /*lint !e665*/
95 
96  /** returns whether the objective plugin is copyable */
97  virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
98  {
99  return TRUE;
100  }
101 }; /*lint !e1712*/
102 
103 }
104 #endif
virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
Definition: HeurFrats.h:97
C++ wrapper for primal heuristics.
Definition: objheur.h:43
#define FALSE
Definition: def.h:87
HeurFrats(SCIP *scip)
Definition: HeurFrats.h:41
#define TRUE
Definition: def.h:86
virtual SCIP_DECL_HEUREXEC(scip_exec)
generator for global cuts in undirected graphs
virtual SCIP_DECL_HEURINITSOL(scip_initsol)
virtual SCIP_DECL_HEUREXITSOL(scip_exitsol)
#define SCIP_HEURTIMING_AFTERLPNODE
Definition: type_timing.h:73
#define NULL
Definition: lpi_spx1.cpp:155
C++ wrapper for primal heuristics.
virtual SCIP_DECL_HEUREXIT(scip_exit)
virtual ~HeurFrats()
Definition: HeurFrats.h:52
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
virtual SCIP_DECL_HEURCLONE(ObjCloneable *clone)
virtual SCIP_DECL_HEURFREE(scip_free)
virtual SCIP_DECL_HEURINIT(scip_init)