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-2024 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file HeurFarthestInsert.h
26 * @brief farthest insert - combinatorial heuristic for TSP
27 * @author Timo Berthold
28 */
29
30/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
31
32#ifndef __HEURFARTHESTINSERT_H__
33#define __HEURFARTHESTINSERT_H__
34
35#include "objscip/objscip.h"
36
37namespace tsp
38{
39
40/** C++ farthest insert heuristic for TSP */
42{
43 GRAPH* graph_; /**< the underlying graph of the TSP */
44
45public:
46 /** default constructor */
48 SCIP* scip
49 )
50 : ObjHeur(scip, "farthestinsert", "farthest insert heuristic for TSPs", 'I',-10000, 0, 0, 0,
52 graph_(0)
53 {
54 }
55
56 /** destructor */
58 {
59 if( graph_ != NULL )
60 release_graph(&graph_); /*lint !e1551*/
61 }
62
63
64 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
65 virtual SCIP_DECL_HEURFREE(scip_free);
66
67 /** initialization method of primal heuristic (called after problem was transformed) */
68 virtual SCIP_DECL_HEURINIT(scip_init);
69
70 /** deinitialization method of primal heuristic (called before transformed problem is freed) */
71 virtual SCIP_DECL_HEUREXIT(scip_exit);
72
73 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
74 *
75 * This method is called when the presolving was finished and the branch and bound process is about to begin.
76 * The primal heuristic may use this call to initialize its branch and bound specific data.
77 *
78 */
79 virtual SCIP_DECL_HEURINITSOL(scip_initsol);
80
81 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
82 *
83 * This method is called before the branch and bound process is freed.
84 * The primal heuristic should use this call to clean up its branch and bound data.
85 */
86 virtual SCIP_DECL_HEUREXITSOL(scip_exitsol);
87
88 /** execution method of primal heuristic
89 *
90 * Searches for feasible primal solutions. The method is called in the node processing loop.
91 *
92 * possible return values for *result:
93 * - SCIP_FOUNDSOL : at least one feasible primal solution was found
94 * - SCIP_DIDNOTFIND : the heuristic searched, but did not find a feasible solution
95 * - SCIP_DIDNOTRUN : the heuristic was skipped
96 * - SCIP_DELAYED : the heuristic was skipped, but should be called again as soon as possible, disregarding
97 * its frequency
98 */
99 virtual SCIP_DECL_HEUREXEC(scip_exec);
100
101 /** clone method which will be used to copy a objective plugin */
102 virtual SCIP_DECL_HEURCLONE(ObjCloneable* clone); /*lint !e665*/
103
104 /** returns whether the objective plugin is copyable */
105 virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
106 {
107 return TRUE;
108 }
109}; /*lint !e1712*/
110
111}
112#endif
void release_graph(GRAPH **gr)
C++ wrapper for primal heuristics.
Definition: objheur.h:54
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:89
virtual SCIP_DECL_HEURFREE(scip_free)
virtual SCIP_DECL_HEUREXEC(scip_exec)
virtual SCIP_DECL_HEUREXIT(scip_exit)
virtual SCIP_DECL_HEURISCLONEABLE(iscloneable)
virtual SCIP_DECL_HEUREXITSOL(scip_exitsol)
virtual SCIP_DECL_HEURINITSOL(scip_initsol)
virtual SCIP_DECL_HEURCLONE(ObjCloneable *clone)
virtual SCIP_DECL_HEURINIT(scip_init)
#define NULL
Definition: def.h:267
#define TRUE
Definition: def.h:93
#define FALSE
Definition: def.h:94
C++ wrapper classes for SCIP.
#define SCIP_HEURTIMING_BEFORENODE
Definition: type_timing.h:78