GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
solver_mip.c File Reference

Detailed Description

pricing solver solving the pricing problem as a sub-MIP, using SCIP

Author
Gerald Gamrath
Martin Bergner
Christian Puchert

Definition in file solver_mip.c.

#include <assert.h>
#include <string.h>
#include "gcg/solver_mip.h"
#include "scip/cons_linear.h"
#include "scip/cons_knapsack.h"
#include "gcg/gcg.h"
#include "gcg/pricer_gcg.h"
#include "gcg/pub_solver.h"
#include "scip/scipdefplugins.h"
#include "gcg/pub_gcgcol.h"

Go to the source code of this file.

Data Structures

struct  GCG_SolverData

Macros

#define SOLVER_NAME   "mip"
#define SOLVER_DESC   "pricing solver solving the pricing problem as a sub-MIP, using SCIP"
#define SOLVER_PRIORITY   0
#define SOLVER_HEURENABLED   TRUE
#define SOLVER_EXACTENABLED   TRUE
#define DEFAULT_CHECKSOLS   TRUE
#define DEFAULT_STARTNODELIMIT   1000LL
#define DEFAULT_STARTSTALLNODELIMIT   100LL
#define DEFAULT_STARTGAPLIMIT   0.2
#define DEFAULT_STARTSOLLIMIT   10
#define DEFAULT_NODELIMITFAC   1.0
#define DEFAULT_STALLNODELIMITFAC   1.0
#define DEFAULT_GAPLIMITFAC   0.8
#define DEFAULT_SOLLIMITFAC   1.0
#define DEFAULT_SETTINGSFILE   "-"
#define DEFAULT_ENABLE_WARNINGS   FALSE
#define solverInitMip   NULL
#define solverExitMip   NULL
#define solverUpdateMip   NULL

Functions

static SCIP_RETCODE resolvePricingWithoutPresolving (SCIP *pricingprob)
static SCIP_RETCODE checkSolNew (SCIP *pricingprob, SCIP_SOL **sols, int idx, SCIP_Bool *isnew)
static SCIP_Bool solutionHasInfiniteValue (SCIP *pricingprob, SCIP_SOL *sol)
static SCIP_RETCODE solveProblem (GCG *gcg, SCIP *pricingprob, int probnr, GCG_SOLVERDATA *solverdata, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status)
static GCG_DECL_SOLVERFREE (solverFreeMip)
static GCG_DECL_SOLVERINITSOL (solverInitsolMip)
static GCG_DECL_SOLVEREXITSOL (solverExitsolMip)
static GCG_DECL_SOLVERSOLVE (solverSolveMip)
static GCG_DECL_SOLVERSOLVEHEUR (solverSolveHeurMip)
SCIP_RETCODE createColumnFromRay (GCG *gcg, SCIP *pricingprob, SCIP *subproblem, SCIP_HASHMAP *varmap, int probnr, GCG_COL **newcol)
GCG_PRICINGSTATUS getPricingstatus (SCIP *pricingprob)
SCIP_RETCODE getColumnsFromPricingprob (GCG *gcg, SCIP *pricingprob, SCIP *subproblem, SCIP_HASHMAP *varmap, int probnr, SCIP_Bool checksols)
SCIP_RETCODE GCGincludeSolverMip (GCG *gcg)

Macro Definition Documentation

◆ SOLVER_NAME

#define SOLVER_NAME   "mip"

Definition at line 52 of file solver_mip.c.

◆ SOLVER_DESC

#define SOLVER_DESC   "pricing solver solving the pricing problem as a sub-MIP, using SCIP"

Definition at line 53 of file solver_mip.c.

◆ SOLVER_PRIORITY

#define SOLVER_PRIORITY   0

Definition at line 54 of file solver_mip.c.

◆ SOLVER_HEURENABLED

#define SOLVER_HEURENABLED   TRUE

indicates whether the heuristic solving method of the solver should be enabled

Definition at line 55 of file solver_mip.c.

◆ SOLVER_EXACTENABLED

#define SOLVER_EXACTENABLED   TRUE

indicates whether the exact solving method of the solver should be enabled

Definition at line 56 of file solver_mip.c.

◆ DEFAULT_CHECKSOLS

#define DEFAULT_CHECKSOLS   TRUE

should solutions be checked extensively

Definition at line 58 of file solver_mip.c.

◆ DEFAULT_STARTNODELIMIT

#define DEFAULT_STARTNODELIMIT   1000LL

start node limit for heuristic pricing

Definition at line 59 of file solver_mip.c.

◆ DEFAULT_STARTSTALLNODELIMIT

#define DEFAULT_STARTSTALLNODELIMIT   100LL

start stalling node limit for heuristic pricing

Definition at line 60 of file solver_mip.c.

◆ DEFAULT_STARTGAPLIMIT

#define DEFAULT_STARTGAPLIMIT   0.2

start gap limit for heuristic pricing

Definition at line 61 of file solver_mip.c.

◆ DEFAULT_STARTSOLLIMIT

#define DEFAULT_STARTSOLLIMIT   10

start solution limit for heuristic pricing

Definition at line 62 of file solver_mip.c.

◆ DEFAULT_NODELIMITFAC

#define DEFAULT_NODELIMITFAC   1.0

factor by which to increase node limit for heuristic pricing (1.0: add start limit)

Definition at line 63 of file solver_mip.c.

◆ DEFAULT_STALLNODELIMITFAC

#define DEFAULT_STALLNODELIMITFAC   1.0

factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit)

Definition at line 64 of file solver_mip.c.

◆ DEFAULT_GAPLIMITFAC

#define DEFAULT_GAPLIMITFAC   0.8

factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit)

Definition at line 65 of file solver_mip.c.

◆ DEFAULT_SOLLIMITFAC

#define DEFAULT_SOLLIMITFAC   1.0

factor by which to increase solution limit for heuristic pricing (1.0: add start limit)

Definition at line 66 of file solver_mip.c.

◆ DEFAULT_SETTINGSFILE

#define DEFAULT_SETTINGSFILE   "-"

settings file to be applied in pricing problems

Definition at line 67 of file solver_mip.c.

◆ DEFAULT_ENABLE_WARNINGS

#define DEFAULT_ENABLE_WARNINGS   FALSE

should warnings (of pricing problems) be enabled by default

Definition at line 68 of file solver_mip.c.

◆ solverInitMip

#define solverInitMip   NULL

initialization method of pricing solver (called after problem was transformed and solver is active)

Definition at line 339 of file solver_mip.c.

Referenced by GCGincludeSolverMip().

◆ solverExitMip

#define solverExitMip   NULL

deinitialization method of pricing solver (called before transformed problem is freed and solver is active)

Definition at line 342 of file solver_mip.c.

Referenced by GCGincludeSolverMip().

◆ solverUpdateMip

#define solverUpdateMip   NULL

Definition at line 405 of file solver_mip.c.

Referenced by GCGincludeSolverMip().

Function Documentation

◆ resolvePricingWithoutPresolving()

SCIP_RETCODE resolvePricingWithoutPresolving ( SCIP * pricingprob)
static

solves the pricing problem again without presolving

Parameters
pricingprobpricing problem to solve again

Definition at line 102 of file solver_mip.c.

References assert(), resolvePricingWithoutPresolving(), and SCIP_CALL().

Referenced by resolvePricingWithoutPresolving(), and solveProblem().

◆ checkSolNew()

SCIP_RETCODE checkSolNew ( SCIP * pricingprob,
SCIP_SOL ** sols,
int idx,
SCIP_Bool * isnew )
static

checks whether the given solution is equal to one of the former solutions in the sols array

Parameters
pricingprobpricing problem SCIP data structure
solsarray of solutions
idxindex of the solution
isnewpointer to store whether the solution is new

Definition at line 119 of file solver_mip.c.

References assert(), checkSolNew(), i, SCIP_CALL(), and SCIPfreeBufferArray().

Referenced by checkSolNew(), and getColumnsFromPricingprob().

◆ solutionHasInfiniteValue()

SCIP_Bool solutionHasInfiniteValue ( SCIP * pricingprob,
SCIP_SOL * sol )
static

check whether a column contains an infinite solution value

Parameters
pricingprobpricing problem SCIP data structure
solsolution to be checked

Definition at line 178 of file solver_mip.c.

References i, nvars, sol, solutionHasInfiniteValue(), and vars.

Referenced by getColumnsFromPricingprob(), and solutionHasInfiniteValue().

◆ solveProblem()

SCIP_RETCODE solveProblem ( GCG * gcg,
SCIP * pricingprob,
int probnr,
GCG_SOLVERDATA * solverdata,
SCIP_Real * lowerbound,
GCG_PRICINGSTATUS * status )
static

solves the given pricing problem as a sub-SCIP

Parameters
gcgGCG data structure
pricingprobpricing problem SCIP data structure
probnrproblem number
solverdatasolver data structure
lowerboundpointer to store lower bound
statuspointer to store pricing problem status

Definition at line 200 of file solver_mip.c.

References assert(), GCG_SolverData::checksols, createColumnFromRay(), GCG_SolverData::enablewarnings, GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_NOTAPPLICABLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, GCGpricerAddCol(), getColumnsFromPricingprob(), getPricingstatus(), resolvePricingWithoutPresolving(), retcode, SCIP_CALL(), SCIPdebugMessage(), and solveProblem().

Referenced by GCG_DECL_SOLVERSOLVE(), GCG_DECL_SOLVERSOLVEHEUR(), and solveProblem().

◆ GCG_DECL_SOLVERFREE()

GCG_DECL_SOLVERFREE ( solverFreeMip )
static

destructor of pricing solver to free user data (called when SCIP is exiting)

Definition at line 319 of file solver_mip.c.

References assert(), GCG_DECL_SOLVERFREE, GCGgetDwMasterprob(), GCGsolverGetData(), and GCGsolverSetData().

◆ GCG_DECL_SOLVERINITSOL()

GCG_DECL_SOLVERINITSOL ( solverInitsolMip )
static

◆ GCG_DECL_SOLVEREXITSOL()

GCG_DECL_SOLVEREXITSOL ( solverExitsolMip )
static

solving process deinitialization method of pricing solver (called before branch and bound process data is freed)

Definition at line 381 of file solver_mip.c.

References assert(), GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_SolverData::curstallnodelimit, GCG_DECL_SOLVEREXITSOL, GCGgetMasterprob(), GCGgetNPricingprobs(), GCGsolverGetData(), and masterprob.

◆ GCG_DECL_SOLVERSOLVE()

GCG_DECL_SOLVERSOLVE ( solverSolveMip )
static

solving method for pricing solver which solves the pricing problem to optimality

Definition at line 409 of file solver_mip.c.

References assert(), GCG_DECL_SOLVERSOLVE, GCGsolverGetData(), SCIP_CALL(), SCIPdebugMessage(), GCG_SolverData::settingsfile, and solveProblem().

◆ GCG_DECL_SOLVERSOLVEHEUR()

◆ createColumnFromRay()

SCIP_RETCODE createColumnFromRay ( GCG * gcg,
SCIP * pricingprob,
SCIP * subproblem,
SCIP_HASHMAP * varmap,
int probnr,
GCG_COL ** newcol )

extracts ray from a subproblem used to solve a pricing problem pricing problem (or directly from the pricing problem if no subproblem is specified)

Parameters
gcgGCG data structure
pricingprobpricing problem SCIP data structure
subproblemSCIP data structure that contains the actual solution (if NULL pricingprob will be used)
varmapmapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL)
probnrproblem number
newcolcolumn pointer to store new column

Definition at line 521 of file solver_mip.c.

References assert(), createColumnFromRay(), GCGcreateGcgCol(), i, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), and solval.

Referenced by createColumnFromRay(), solveProblem(), and solveProblem().

◆ getPricingstatus()

GCG_PRICINGSTATUS getPricingstatus ( SCIP * pricingprob)

get the status of the pricing problem

Parameters
pricingprobpricing problem SCIP data structure

Definition at line 592 of file solver_mip.c.

References assert(), GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, getPricingstatus(), and SCIPdebugMessage().

Referenced by getPricingstatus(), solveProblem(), and solveProblem().

◆ getColumnsFromPricingprob()

SCIP_RETCODE getColumnsFromPricingprob ( GCG * gcg,
SCIP * pricingprob,
SCIP * subproblem,
SCIP_HASHMAP * varmap,
int probnr,
SCIP_Bool checksols )

transforms feasible solutions of a subproblem used to solve a pricing problem pricing problem into columns (or directly of the pricing problem if no subproblem is specified)

Parameters
gcgGCG data structure
pricingprobpricing problem SCIP data structure
subproblemSCIP data structure that contains the actual solution (if NULL pricingprob will be used)
varmapmapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL)
probnrproblem number
checksolsshould solutions be checked extensively

Definition at line 652 of file solver_mip.c.

References assert(), checkSolNew(), GCGcreateGcgColFromSol(), GCGpricerAddCol(), getColumnsFromPricingprob(), SCIP_CALL(), SCIPdebugMessage(), solutionHasInfiniteValue(), and success.

Referenced by getColumnsFromPricingprob(), solveProblem(), and solveProblem().

◆ GCGincludeSolverMip()