farthest insert - combinatorial heuristic for TSP
Definition in file HeurFarthestInsert.cpp.
#include <iostream>
#include <cassert>
#include "objscip/objscip.h"
#include "GomoryHuTree.h"
#include "HeurFarthestInsert.h"
#include "ProbDataTSP.h"
Go to the source code of this file.
Functions | |
static GRAPHEDGE * | findEdge (GRAPHNODE *nodes, int index1, int index2) |
static void | updateDistances (GRAPHNODE *nodes, double *dist, int idx) |
SCIP_DECL_HEURFREE (HeurFarthestInsert::scip_free) | |
SCIP_DECL_HEURINIT (HeurFarthestInsert::scip_init) | |
SCIP_DECL_HEUREXIT (HeurFarthestInsert::scip_exit) | |
SCIP_DECL_HEURINITSOL (HeurFarthestInsert::scip_initsol) | |
SCIP_DECL_HEUREXITSOL (HeurFarthestInsert::scip_exitsol) | |
SCIP_DECL_HEUREXEC (HeurFarthestInsert::scip_exec) |
method finding the edge going from the node with id index1 to the node with id index2
nodes | all nodes of the graph |
index1 | id of the node where the searched edge starts |
index2 | id of the node where the searched edge ends |
Definition at line 46 of file HeurFarthestInsert.cpp.
References GraphEdge::adjac, GraphNode::first_edge, GraphNode::id, GraphEdge::next, and NULL.
Referenced by SCIP_DECL_HEUREXEC().
|
static |
method updating the distances of the nodes to the tour after having inserted one node with id index
nodes | all nodes of the graph |
dist | array with current distances of all nodes to the subtour |
idx | id of the inserted node |
Definition at line 68 of file HeurFarthestInsert.cpp.
References GraphEdge::adjac, GraphNode::first_edge, GraphNode::id, GraphEdge::length, GraphEdge::next, NULL, SCIPvarGetUbGlobal(), and GraphEdge::var.
Referenced by SCIP_DECL_HEUREXEC().
SCIP_DECL_HEURFREE | ( | HeurFarthestInsert::scip_free | ) |
destructor of primal heuristic to free user data (called when SCIP is exiting)
Definition at line 88 of file HeurFarthestInsert.cpp.
References SCIP_OKAY.
SCIP_DECL_HEURINIT | ( | HeurFarthestInsert::scip_init | ) |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 94 of file HeurFarthestInsert.cpp.
References capture_graph(), tsp::ProbDataTSP::getGraph(), SCIP_OKAY, and SCIPgetObjProbData().
SCIP_DECL_HEUREXIT | ( | HeurFarthestInsert::scip_exit | ) |
deinitialization method of primal heuristic (called before transformed problem is freed)
Definition at line 103 of file HeurFarthestInsert.cpp.
References release_graph(), and SCIP_OKAY.
SCIP_DECL_HEURINITSOL | ( | HeurFarthestInsert::scip_initsol | ) |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
This method is called when the presolving was finished and the branch and bound process is about to begin. The primal heuristic may use this call to initialize its branch and bound specific data.
Definition at line 116 of file HeurFarthestInsert.cpp.
References SCIP_OKAY.
SCIP_DECL_HEUREXITSOL | ( | HeurFarthestInsert::scip_exitsol | ) |
solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
This method is called before the branch and bound process is freed. The primal heuristic should use this call to clean up its branch and bound data.
Definition at line 126 of file HeurFarthestInsert.cpp.
References SCIP_OKAY.
SCIP_DECL_HEUREXEC | ( | HeurFarthestInsert::scip_exec | ) |
execution method of primal heuristic
Searches for feasible primal solutions. The method is called in the node processing loop.
possible return values for *result:
Definition at line 142 of file HeurFarthestInsert.cpp.
References GraphEdge::adjac, assert(), GraphEdge::back, BMSclearMemoryArray, FALSE, findEdge(), GraphNode::first_edge, i, GraphNode::id, GraphEdge::length, GraphEdge::next, nnodes, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_FOUNDSOL, SCIP_OKAY, SCIPallocBufferArray, SCIPcreateSol(), SCIPfreeBufferArray, SCIPfreeSol(), SCIPsetSolVal(), SCIPtrySol(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), sol, TRUE, updateDistances(), GraphEdge::var, var, and w.