Scippy

SCIP

Solving Constraint Integer Programs

solpool.c File Reference

Detailed Description

includes solution pool for Steiner tree problems

Author
Daniel Rehfeldt

This file contains several basic methods for a Steiner tree solution pool.

Definition in file solpool.c.

#include "solpool.h"
#include "probdata_stp.h"

Go to the source code of this file.

Functions

SCIP_Bool solpool_isContained (const int *soledges, const STPSOLPOOL *pool)
 
STPSOLsolpool_solFromIndex (STPSOLPOOL *pool, const int soindex)
 
SCIP_RETCODE solpool_init (SCIP *scip, STPSOLPOOL **pool, const int nedges, const int maxsize)
 
void solpool_free (SCIP *scip, STPSOLPOOL **pool)
 
SCIP_RETCODE solpool_addSolToScip (SCIP *scip, SCIP_HEUR *heur, const GRAPH *g, const int *result, SCIP_Bool *success)
 
SCIP_RETCODE solpool_addSol (SCIP *scip, const SCIP_Real obj, const int *soledges, STPSOLPOOL *pool, SCIP_Bool *success)
 

Function Documentation

◆ solpool_isContained()

SCIP_Bool solpool_isContained ( const int *  soledges,
const STPSOLPOOL pool 
)

is given solution in pool?

Parameters
soledgesedge array of solution to be checked
poolthe pool

Definition at line 35 of file solpool.c.

References FALSE, stp_solution_pool::nedges, NULL, SCIPdebugMessage, stp_solution_pool::size, stp_solution::soledges, stp_solution_pool::sols, and TRUE.

Referenced by solpool_addSol().

◆ solpool_solFromIndex()

STPSOL* solpool_solFromIndex ( STPSOLPOOL pool,
const int  soindex 
)

get solution from index

Parameters
poolthe pool
soindexthe index

Definition at line 66 of file solpool.c.

References stp_solution::index, NULL, stp_solution_pool::size, and stp_solution_pool::sols.

Referenced by computeSteinerTreeRedCosts(), and computeSteinerTreeRedCostsPcMw().

◆ solpool_init()

SCIP_RETCODE solpool_init ( SCIP scip,
STPSOLPOOL **  pool,
const int  nedges,
const int  maxsize 
)

initializes STPSOL pool

Parameters
scipSCIP data structure
poolthe pool
nedgesnumber of edges of solutions to be stored in the pool
maxsizecapacity of pool

Definition at line 91 of file solpool.c.

References stp_solution_pool::maxindex, stp_solution_pool::maxsize, stp_solution_pool::nedges, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPallocMemoryArray, stp_solution_pool::size, and stp_solution_pool::sols.

Referenced by reduce_da(), and reduce_daPcMw().

◆ solpool_free()

void solpool_free ( SCIP scip,
STPSOLPOOL **  pool 
)

frees STPSOL pool

Parameters
scipSCIP data structure
poolthe pool

Definition at line 122 of file solpool.c.

References stp_solution_pool::maxsize, NULL, SCIPfreeBlockMemory, SCIPfreeMemoryArray, stp_solution_pool::size, stp_solution::soledges, and stp_solution_pool::sols.

Referenced by daPcMarkRoots(), reduce_da(), and reduce_daPcMw().

◆ solpool_addSolToScip()

SCIP_RETCODE solpool_addSolToScip ( SCIP scip,
SCIP_HEUR heur,
const GRAPH g,
const int *  result,
SCIP_Bool success 
)

tries to add sol to SCIP

Parameters
scipSCIP data structure
heurheuristic data structure or NULL
ggraph data structure
resultedge array of solution to be added
successhas solution been added?

Definition at line 150 of file solpool.c.

References CONNECT, graph_get_nEdges(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMessage, SCIPfreeBufferArray, SCIPprobdataAddNewSol(), and SCIPprobdataGetNVars().

Referenced by addRedsol(), and SCIPStpHeurAscendPruneRun().

◆ solpool_addSol()

SCIP_RETCODE solpool_addSol ( SCIP scip,
const SCIP_Real  obj,
const int *  soledges,
STPSOLPOOL pool,
SCIP_Bool success 
)

tries to add STPSOL to pool

Parameters
scipSCIP data structure
objobjective of solution to be added
soledgesedge array of solution to be added
poolthe pool
successhas solution been added?

Definition at line 183 of file solpool.c.

References BMScopyMemoryArray, FALSE, stp_solution::index, stp_solution_pool::maxindex, stp_solution_pool::maxsize, stp_solution_pool::nedges, NULL, stp_solution::obj, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPallocMemoryArray, SCIPdebugMessage, SCIPisGT(), stp_solution_pool::size, stp_solution::soledges, solpool_isContained(), stp_solution_pool::sols, and TRUE.

Referenced by computeSteinerTreeRedCosts(), computeSteinerTreeRedCostsPcMw(), daPcAddTmSolToPool(), and poolAddSol().