Detailed Description
shortest paths based primal heuristics for Steiner problems
This file implements several shortest paths based primal heuristics for Steiner problems, see "SCIP-Jack - A solver for STP and variants with parallelization extensions" by Gamrath, Koch, Maher, Rehfeldt and Shinano
Definition in file heur_tm.h.
Go to the source code of this file.
Macros | |
#define | DEFAULT_HOPFACTOR 0.33 |
Enumerations | |
enum | PCMW_TmMode { pcmode_simple = 0, pcmode_bias = 1, pcmode_biasfull = 2, pcmode_fulltree = 3, pcmode_all = 4, pcmode_biasAndFulltree = 5, pcmode_fromheurdata = 6 } |
Functions | |
void | SCIPStpHeurTMCompStarts (GRAPH *graph, int *starts, int *runs) |
SCIP_RETCODE | SCIPStpIncludeHeurTM (SCIP *scip) |
SCIP_RETCODE | SCIPStpHeurTMRun (SCIP *scip, enum PCMW_TmMode pcmw_tmmode, GRAPH *graph, int *starts, const SCIP_Real *prize, int *best_result, int runs, int bestincstart, SCIP_Real *cost, SCIP_Real *costrev, SCIP_Real *hopfactor, SCIP_Real *nodepriority, SCIP_Bool *success) |
SCIP_RETCODE | SCIPStpHeurTMRunLP (SCIP *scip, GRAPH *graph, SCIP_HEUR *heur, int *result, int runs, SCIP_Bool *success) |
SCIP_RETCODE | SCIPStpHeurTMBuildTreePcMw (SCIP *scip, const GRAPH *g, SCIP_Bool useRootSym, PATH *mst, const SCIP_Real *cost, SCIP_Real *objresult, int *connected) |
void | SCIPStpHeurTMBuildTree (SCIP *scip, GRAPH *g, PATH *mst, const SCIP_Real *cost, SCIP_Real *objresult, int *connected) |
SCIP_RETCODE | SCIPStpHeurTMBuildTreeDc (SCIP *scip, const GRAPH *g, int *result, STP_Bool *connected) |
Macro Definition Documentation
◆ DEFAULT_HOPFACTOR
#define DEFAULT_HOPFACTOR 0.33 |
Definition at line 42 of file heur_tm.h.
Referenced by dhcstpWarmUp(), reduce_boundHopRc(), and SCIPStpIncludeHeurTM().
Enumeration Type Documentation
◆ PCMW_TmMode
enum PCMW_TmMode |
Function Documentation
◆ SCIPStpHeurTMCompStarts()
void SCIPStpHeurTMCompStarts | ( | GRAPH * | graph, |
int * | starts, | ||
int * | runs | ||
) |
compute starting points among marked (w.r.t. g->mark) vertices for constructive heuristics
- Parameters
-
graph graph data structure starts starting points array runs pointer to number of runs
Definition at line 2879 of file heur_tm.c.
References Is_term, GRAPH::knots, GRAPH::mark, nnodes, TM_base_data::nruns, nterms, NULL, r, GRAPH::source, GRAPH::term, and GRAPH::terms.
Referenced by computeNewSols(), computeSteinerTree(), computeSteinerTreeTM(), redcostGraphComputeSteinerTreeDirected(), and updateSolution().
◆ SCIPStpIncludeHeurTM()
SCIP_RETCODE SCIPStpIncludeHeurTM | ( | SCIP * | scip | ) |
creates the TM primal heuristic and includes it in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 3711 of file heur_tm.c.
References DEFAULT_DURINGLPFREQ, DEFAULT_EVALRUNS, DEFAULT_HARD_RUNSMULT, DEFAULT_HOPFACTOR, DEFAULT_INITRUNS, DEFAULT_LEAFRUNS, DEFAULT_PCMODE, DEFAULT_RANDSEED, DEFAULT_ROOTRUNS, DEFAULT_TYPE, FALSE, HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, NULL, SCIP_CALL, SCIP_HEURTIMING_AFTERLPLOOP, SCIP_HEURTIMING_AFTERNODE, SCIP_HEURTIMING_AFTERPSEUDONODE, SCIP_HEURTIMING_BEFORENODE, SCIP_HEURTIMING_DURINGLPLOOP, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddIntParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPcreateRandom(), SCIPincludeHeurBasic(), SCIPsetHeurCopy(), SCIPsetHeurFree(), SCIPsetHeurInit(), SCIPsnprintf(), and TRUE.
Referenced by runShell(), SCIP_DECL_HEURCOPY(), and subscipSetupCallbacks().
◆ SCIPStpHeurTMRun()
SCIP_RETCODE SCIPStpHeurTMRun | ( | SCIP * | scip, |
enum PCMW_TmMode | pcmw_tmmode, | ||
GRAPH * | graph, | ||
int * | starts, | ||
const SCIP_Real * | prize, | ||
int * | best_result, | ||
int | runs, | ||
int | bestincstart, | ||
SCIP_Real * | cost, | ||
SCIP_Real * | costrev, | ||
SCIP_Real * | hopfactor, | ||
SCIP_Real * | nodepriority, | ||
SCIP_Bool * | success | ||
) |
execute shortest paths heuristic to obtain a Steiner tree
- Parameters
-
scip SCIP data structure pcmw_tmmode mode for PC/MW graph graph data structure starts array containing start vertices (NULL to not provide any) prize prizes (for PCMW) or NULL best_result array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) runs number of runs bestincstart best incumbent start vertex cost arc costs costrev reversed arc costs hopfactor edge cost multiplicator for HC problems nodepriority vertex priorities for vertices to be starting points (NULL for no priorities) success pointer to store whether a solution could be found
Definition at line 3418 of file heur_tm.c.
References TM_base_data::best_result, computeStarts(), TM_base_data::cost, TM_base_data::costrev, TM_base_data::dheap, FALSE, FARAWAY, getTMheurData(), getTmMode(), graph_get_nEdges(), graph_pc_2transcheck(), graph_pc_isPcMw(), graph_printInfoReduced(), NULL, runTm(), runTmDhcstp(), runTmPcMW(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPisGE(), solstp_getObj(), GRAPH::source, STP_DHCSTP, GRAPH::stp_type, TM_SP, TM_VORONOI, tmAllspFree(), tmAllspInit(), tmBaseFree(), tmBaseInit(), tmVnoiFree(), and tmVnoiInit().
Referenced by computeNewSols(), computeReducedProbSolutionBiased(), computeSteinerTree(), computeSteinerTreeTM(), createInitialCuts(), daPcAddTmSolToPool(), redcostGraphComputeSteinerTreeDegCons(), redcostGraphComputeSteinerTreeDirected(), reduce_boundHopRc(), runTmPcFull(), SCIPStpHeurRecExclude(), SCIPStpHeurTMRunLP(), and updateSolution().
◆ SCIPStpHeurTMRunLP()
SCIP_RETCODE SCIPStpHeurTMRunLP | ( | SCIP * | scip, |
GRAPH * | graph, | ||
SCIP_HEUR * | heur, | ||
int * | result, | ||
int | runs, | ||
SCIP_Bool * | success | ||
) |
run shortest path heuristic, but bias edge costs towards best current LP solution
- Parameters
-
scip SCIP data structure graph graph data structure heur heuristic or NULL result (uninitialized) array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) runs number of runs success pointer to store whether a solution could be found
Definition at line 3509 of file heur_tm.c.
References BLOCKED, BMScopyMemoryArray, TM_base_data::cost, GRAPH::cost, TM_base_data::costrev, eps, FALSE, flipedge_Uint, getTmEdgeCostZeroOffset(), GRAPH::grad, graph_get_nEdges(), graph_get_nNodes(), graph_knot_chg(), graph_pc_isPcMw(), graph_typeIsSpgLike(), GRAPH::head, initCostsAndPrioLP(), Is_term, LE, MAX, nnodes, NULL, pcmode_bias, SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateSol(), SCIPepsilon(), SCIPfindHeur(), SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPfreeSol(), SCIPgetLPSolstat(), SCIPhasCurrentNodeLP(), SCIPheurGetData(), SCIPisZero(), SCIPlinkLPSol(), SCIPprobdataGetVars(), SCIPprobdataGetXval(), SCIPrandomGetReal(), SCIPStpHeurTMRun(), SCIPvarGetUbGlobal(), solstp_addSolToProb(), solstp_pruneFromEdges(), GRAPH::source, STP_BRMWCSP, STP_DHCSTP, STP_TERM, GRAPH::stp_type, GRAPH::term, and UNKNOWN.
Referenced by SCIP_DECL_HEUREXEC(), and selectBranchingVertexBySol().
◆ SCIPStpHeurTMBuildTreePcMw()
SCIP_RETCODE SCIPStpHeurTMBuildTreePcMw | ( | SCIP * | scip, |
const GRAPH * | g, | ||
SCIP_Bool | useRootSym, | ||
PATH * | mst, | ||
const SCIP_Real * | cost, | ||
SCIP_Real * | objresult, | ||
int * | connected | ||
) |
build (rooted) prize collecting Steiner tree in such a way that all leaves are positive-weight vertices
build (rooted) prize collecting Steiner tree in such a way that all leaves are terminals; objresult is set FARAWAY if infeasible
- Parameters
-
scip SCIP data structure g graph structure useRootSym use? mst path data structure array cost edge costs objresult pointer to store objective value of result connected CONNECT/UNKNOWN
Definition at line 3012 of file heur_tm.c.
References a, CONNECT, EAT_LAST, shortest_path::edge, GRAPH::extended, FALSE, FARAWAY, graph_path_exec(), graph_pc_isRootedPcMw(), graph_pc_isUnrootedPcMw(), graph_pc_knotIsDummyTerm(), graph_pc_knotIsFixedTerm(), GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_pseudoTerm, Is_term, GRAPH::knots, GRAPH::mark, MST_MODE, nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_state, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPprobdataGetNNodes(), SCIPprobdataGetNTerms(), SCIPprobdataGetPctermsorder(), GRAPH::source, GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.
Referenced by nodesolUpdate(), and SCIPStpHeurPruneUpdateSols().
◆ SCIPStpHeurTMBuildTree()
void SCIPStpHeurTMBuildTree | ( | SCIP * | scip, |
GRAPH * | g, | ||
PATH * | mst, | ||
const SCIP_Real * | cost, | ||
SCIP_Real * | objresult, | ||
int * | connected | ||
) |
build Steiner tree in such a way that all leaves are terminals
- Parameters
-
scip SCIP data structure g graph structure mst path data structure array cost edge costs objresult pointer to store objective value of result connected CONNECT/UNKNOWN
Definition at line 2932 of file heur_tm.c.
References CONNECT, EAT_LAST, shortest_path::edge, FALSE, FARAWAY, graph_path_exec(), graph_pc_isPcMw(), GRAPH::head, Is_term, GRAPH::knots, GRAPH::mark, MST_MODE, nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, SCIP_Real, GRAPH::source, GRAPH::term, and UNKNOWN.
Referenced by nodesolUpdate(), and SCIPStpHeurPruneUpdateSols().
◆ SCIPStpHeurTMBuildTreeDc()
SCIP_RETCODE SCIPStpHeurTMBuildTreeDc | ( | SCIP * | scip, |
const GRAPH * | g, | ||
int * | result, | ||
STP_Bool * | connected | ||
) |
prune a degree constrained Steiner tree in such a way that all leaves are terminals
- Parameters
-
scip SCIP data structure g graph structure result ST edges connected ST nodes (to be set)
Definition at line 3226 of file heur_tm.c.
References CONNECT, GRAPH::cost, EAT_LAST, FALSE, flipedge, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::knots, LT, GRAPH::maxdeg, nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPdebug, SCIPfreeBufferArray, GRAPH::source, GRAPH::term, TRUE, and UNKNOWN.
Referenced by computeDegConsTree(), and SCIPStpHeurRecRun().