GCG 4.1.1 (dev)

Generic Column Generation

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

Detailed Description

methods for GCG pricing solvers

Author
Henri Lotze
Christian Puchert

Definition in file solver.c.

#include "gcg/pub_solver.h"
#include "gcg/solver.h"
#include "gcg/struct_solver.h"
#include "gcg/gcg.h"
#include "gcg/pricer_gcg.h"
#include <string.h>

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (GCGsolverComp)
SCIP_RETCODE GCGsolverCreate (GCG *gcg, GCG_SOLVER **solver, const char *name, const char *desc, int priority, SCIP_Bool heurenabled, SCIP_Bool exactenabled, GCG_DECL_SOLVERUPDATE((*solverupdate)), GCG_DECL_SOLVERSOLVE((*solversolve)), GCG_DECL_SOLVERSOLVEHEUR((*solveheur)), GCG_DECL_SOLVERFREE((*solverfree)), GCG_DECL_SOLVERINIT((*solverinit)), GCG_DECL_SOLVEREXIT((*solverexit)), GCG_DECL_SOLVERINITSOL((*solverinitsol)), GCG_DECL_SOLVEREXITSOL((*solverexitsol)), GCG_SOLVERDATA *solverdata)
SCIP_RETCODE GCGsolverFree (GCG *gcg, GCG_SOLVER **solver)
SCIP_RETCODE GCGsolverInit (GCG *gcg, GCG_SOLVER *solver)
SCIP_RETCODE GCGsolverExit (GCG *gcg, GCG_SOLVER *solver)
SCIP_RETCODE GCGsolverInitsol (GCG *gcg, GCG_SOLVER *solver)
SCIP_RETCODE GCGsolverExitsol (GCG *gcg, GCG_SOLVER *solver)
SCIP_RETCODE GCGsolverUpdate (GCG *gcg, SCIP *pricingprob, GCG_SOLVER *solver, int probnr, SCIP_Bool varobjschanged, SCIP_Bool varbndschanged, SCIP_Bool consschanged)
SCIP_RETCODE GCGsolverSolve (GCG *gcg, SCIP *pricingprob, GCG_SOLVER *solver, SCIP_Bool redcost, SCIP_Bool heuristic, int probnr, SCIP_Real dualsolconv, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status, SCIP_Bool *solved)
GCG_SOLVERDATA * GCGsolverGetData (GCG_SOLVER *solver)
void GCGsolverSetData (GCG_SOLVER *solver, GCG_SOLVERDATA *solverdata)
const char * GCGsolverGetName (GCG_SOLVER *solver)
const char * GCGsolverGetDesc (GCG_SOLVER *solver)
int GCGsolverGetPriority (GCG_SOLVER *solver)
SCIP_Bool GCGsolverIsHeurEnabled (GCG_SOLVER *solver)
SCIP_Bool GCGsolverIsExactEnabled (GCG_SOLVER *solver)
int GCGsolverGetOptFarkasCalls (GCG_SOLVER *solver)
int GCGsolverGetOptRedcostCalls (GCG_SOLVER *solver)
int GCGsolverGetHeurFarkasCalls (GCG_SOLVER *solver)
int GCGsolverGetHeurRedcostCalls (GCG_SOLVER *solver)
SCIP_Real GCGsolverGetOptFarkasTime (GCG *gcg, GCG_SOLVER *solver)
SCIP_Real GCGsolverGetOptRedcostTime (GCG *gcg, GCG_SOLVER *solver)
SCIP_Real GCGsolverGetHeurFarkasTime (GCG *gcg, GCG_SOLVER *solver)
SCIP_Real GCGsolverGetHeurRedcostTime (GCG *gcg, GCG_SOLVER *solver)

Function Documentation

◆ GCGsolverCreate()

SCIP_RETCODE GCGsolverCreate ( GCG * gcg,
GCG_SOLVER ** solver,
const char * name,
const char * desc,
int priority,
SCIP_Bool heurenabled,
SCIP_Bool exactenabled,
GCG_DECL_SOLVERUPDATE((*solverupdate)) ,
GCG_DECL_SOLVERSOLVE((*solversolve)) ,
GCG_DECL_SOLVERSOLVEHEUR((*solveheur)) ,
GCG_DECL_SOLVERFREE((*solverfree)) ,
GCG_DECL_SOLVERINIT((*solverinit)) ,
GCG_DECL_SOLVEREXIT((*solverexit)) ,
GCG_DECL_SOLVERINITSOL((*solverinitsol)) ,
GCG_DECL_SOLVEREXITSOL((*solverexitsol)) ,
GCG_SOLVERDATA * solverdata )

creates a GCG pricing solver

Parameters
gcgGCG data structure
solverpointer to pricing solver data structure
namename of solver
descdescription of solver
prioritypriority of solver
heurenabledflag to indicate whether heuristic solving method of the solver is enabled
exactenabledflag to indicate whether exact solving method of the solver is enabled
-update method for solver
-solving method for solver
-heuristic solving method for solver
-free method of solver
-init method of solver
-exit method of solver
-initsol method of solver
-exitsol method of solver
solverdatapricing solver data

Definition at line 64 of file solver.c.

References assert(), GCG_DECL_SOLVEREXIT, GCG_DECL_SOLVEREXITSOL, GCG_DECL_SOLVERFREE, GCG_DECL_SOLVERINIT, GCG_DECL_SOLVERINITSOL, GCG_DECL_SOLVERSOLVE, GCG_DECL_SOLVERSOLVEHEUR, GCG_DECL_SOLVERUPDATE, GCGgetMasterprob(), GCGgetOrigprob(), GCGsolverCreate(), masterprob, and SCIP_CALL().

Referenced by GCGpricerIncludeSolver(), and GCGsolverCreate().

◆ GCGsolverFree()

SCIP_RETCODE GCGsolverFree ( GCG * gcg,
GCG_SOLVER ** solver )

calls destructor and frees memory of GCG pricing solver

Parameters
gcgGCG data structure
solverpointer to pricing solver data structure

Definition at line 152 of file solver.c.

References assert(), GCGgetMasterprob(), GCGsolverFree(), masterprob, SCIP_CALL(), and SCIPfreeMemory().

Referenced by GCGsolverFree().

◆ GCGsolverInit()

◆ GCGsolverExit()

SCIP_RETCODE GCGsolverExit ( GCG * gcg,
GCG_SOLVER * solver )

calls exit method of GCG pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 218 of file solver.c.

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

Referenced by GCGsolverExit().

◆ GCGsolverInitsol()

SCIP_RETCODE GCGsolverInitsol ( GCG * gcg,
GCG_SOLVER * solver )

calls solving process initialization method of GCG pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 235 of file solver.c.

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

Referenced by GCGsolverInitsol().

◆ GCGsolverExitsol()

SCIP_RETCODE GCGsolverExitsol ( GCG * gcg,
GCG_SOLVER * solver )

calls solving process deinitialization method of GCG pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 252 of file solver.c.

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

Referenced by GCGsolverExitsol().

◆ GCGsolverUpdate()

SCIP_RETCODE GCGsolverUpdate ( GCG * gcg,
SCIP * pricingprob,
GCG_SOLVER * solver,
int probnr,
SCIP_Bool varobjschanged,
SCIP_Bool varbndschanged,
SCIP_Bool consschanged )

calls update method of GCG pricing solver

Parameters
gcgGCG data structure
pricingprobthe pricing problem that should be solved
solverpricing solver
probnrnumber of the pricing problem
varobjschangedhave the objective coefficients changed?
varbndschangedhave the lower and upper bounds changed?
consschangedhave the constraints changed?

Definition at line 269 of file solver.c.

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

Referenced by GCGsolverUpdate().

◆ GCGsolverSolve()

SCIP_RETCODE GCGsolverSolve ( GCG * gcg,
SCIP * pricingprob,
GCG_SOLVER * solver,
SCIP_Bool redcost,
SCIP_Bool heuristic,
int probnr,
SCIP_Real dualsolconv,
SCIP_Real * lowerbound,
GCG_PRICINGSTATUS * status,
SCIP_Bool * solved )

calls heuristic or exact solving method of GCG pricing solver

Note
This method has to be threadsafe!

calls heuristic or exact solving method of GCG pricing solver

Parameters
gcgGCG data structure
pricingprobthe pricing problem that should be solved
solverpricing solver
redcostis reduced cost (TRUE) or Farkas (FALSE) pricing performed?
heuristicshall the pricing problem be solved heuristically?
probnrnumber of the pricing problem
dualsolconvdual solution of the corresponding convexity constraint
lowerboundpointer to store lower bound of pricing problem
statuspointer to store the returned pricing status
solvedpointer to store whether the solution method was called

Definition at line 293 of file solver.c.

References assert(), GCG_Solver::exactenabled, GCG_PRICINGSTATUS_NOTAPPLICABLE, GCGgetMasterprob(), GCGsolverSolve(), GCG_Solver::heurenabled, GCG_Solver::heurfarkascalls, GCG_Solver::heurfarkasclock, GCG_Solver::heurredcostcalls, GCG_Solver::heurredcostclock, masterprob, GCG_Solver::optfarkascalls, GCG_Solver::optfarkasclock, GCG_Solver::optredcostcalls, GCG_Solver::optredcostclock, and SCIP_CALL().

Referenced by GCGsolverSolve().

◆ GCGsolverGetData()

◆ GCGsolverSetData()

void GCGsolverSetData ( GCG_SOLVER * solver,
GCG_SOLVERDATA * solverdata )

sets user data of GCG pricing solver

Parameters
solverpricing solver
solverdatapricing solver data

Definition at line 410 of file solver.c.

References assert(), GCGsolverSetData(), and GCG_Solver::solverdata.

Referenced by GCG_DECL_SOLVERFREE(), GCG_DECL_SOLVERFREE(), GCG_DECL_SOLVERFREE(), GCG_DECL_SOLVERFREE(), GCG_DECL_SOLVERFREE(), and GCGsolverSetData().

◆ GCGsolverGetName()

const char * GCGsolverGetName ( GCG_SOLVER * solver)

gets name of GCG pricing solver

Parameters
solverpricing solver

Definition at line 421 of file solver.c.

References assert(), GCGsolverGetName(), and GCG_Solver::name.

Referenced by gcg::Pricingcontroller::evaluatePricingjob(), GCGpricerPrintListOfSolvers(), GCGpricerPrintPricingStatistics(), GCGsolverGetName(), and ObjPricerGcg::pricingLoop().

◆ GCGsolverGetDesc()

const char * GCGsolverGetDesc ( GCG_SOLVER * solver)

gets description of GCG pricing solver

Parameters
solverpricing solver

Definition at line 431 of file solver.c.

References assert(), GCG_Solver::desc, and GCGsolverGetDesc().

Referenced by GCGpricerPrintListOfSolvers(), and GCGsolverGetDesc().

◆ GCGsolverGetPriority()

int GCGsolverGetPriority ( GCG_SOLVER * solver)

gets priority of GCG pricing solver

Parameters
solverpricing solver

Definition at line 441 of file solver.c.

References assert(), GCGsolverGetPriority(), and GCG_Solver::priority.

Referenced by GCGpricerPrintListOfSolvers(), GCGsolverGetPriority(), and gcg::SCIP_DECL_SORTPTRCOMP().

◆ GCGsolverIsHeurEnabled()

SCIP_Bool GCGsolverIsHeurEnabled ( GCG_SOLVER * solver)

gets whether heuristic solving method of GCG pricing solver is enabled

Parameters
solverpricing solver

Definition at line 451 of file solver.c.

References assert(), GCGsolverIsHeurEnabled(), and GCG_Solver::heurenabled.

Referenced by GCGpricerPrintListOfSolvers(), GCGpricingjobNextSolver(), GCGpricingjobResetHeuristic(), GCGpricingjobResetSolver(), GCGpricingjobSetup(), GCGsolverIsHeurEnabled(), and gcg::Pricingcontroller::initSol().

◆ GCGsolverIsExactEnabled()

SCIP_Bool GCGsolverIsExactEnabled ( GCG_SOLVER * solver)

gets whether exact solving method of GCG pricing solver is enabled

Parameters
solverpricing solver

Definition at line 461 of file solver.c.

References assert(), GCG_Solver::exactenabled, and GCGsolverIsExactEnabled().

Referenced by GCGpricerPrintListOfSolvers(), GCGpricingjobNextSolver(), GCGpricingjobResetSolver(), GCGsolverIsExactEnabled(), and gcg::Pricingcontroller::initSol().

◆ GCGsolverGetOptFarkasCalls()

int GCGsolverGetOptFarkasCalls ( GCG_SOLVER * solver)

gets number of exact Farkas pricing calls of pricing solver

Parameters
solverpricing solver

Definition at line 471 of file solver.c.

References assert(), GCGsolverGetOptFarkasCalls(), and GCG_Solver::optfarkascalls.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetOptFarkasCalls().

◆ GCGsolverGetOptRedcostCalls()

int GCGsolverGetOptRedcostCalls ( GCG_SOLVER * solver)

gets number of exact reduced cost pricing calls of pricing solver

Parameters
solverpricing solver

Definition at line 481 of file solver.c.

References assert(), GCGsolverGetOptRedcostCalls(), and GCG_Solver::optredcostcalls.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetOptRedcostCalls().

◆ GCGsolverGetHeurFarkasCalls()

int GCGsolverGetHeurFarkasCalls ( GCG_SOLVER * solver)

gets number of heuristic Farkas pricing calls of pricing solver

Parameters
solverpricing solver

Definition at line 491 of file solver.c.

References assert(), GCGsolverGetHeurFarkasCalls(), and GCG_Solver::heurfarkascalls.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetHeurFarkasCalls().

◆ GCGsolverGetHeurRedcostCalls()

int GCGsolverGetHeurRedcostCalls ( GCG_SOLVER * solver)

gets number of heuristic reduced cost pricing calls of pricing solver

Parameters
solverpricing solver

Definition at line 501 of file solver.c.

References assert(), GCGsolverGetHeurRedcostCalls(), and GCG_Solver::heurredcostcalls.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetHeurRedcostCalls().

◆ GCGsolverGetOptFarkasTime()

SCIP_Real GCGsolverGetOptFarkasTime ( GCG * gcg,
GCG_SOLVER * solver )

gets exact Farkas pricing time of pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 511 of file solver.c.

References assert(), GCGgetMasterprob(), GCGsolverGetOptFarkasTime(), and GCG_Solver::optfarkasclock.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetOptFarkasTime().

◆ GCGsolverGetOptRedcostTime()

SCIP_Real GCGsolverGetOptRedcostTime ( GCG * gcg,
GCG_SOLVER * solver )

gets exact reduced cost pricing time of pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 523 of file solver.c.

References assert(), GCGgetMasterprob(), GCGsolverGetOptRedcostTime(), and GCG_Solver::optredcostclock.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetOptRedcostTime().

◆ GCGsolverGetHeurFarkasTime()

SCIP_Real GCGsolverGetHeurFarkasTime ( GCG * gcg,
GCG_SOLVER * solver )

gets heuristic Farkas pricing time of pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 535 of file solver.c.

References assert(), GCGgetMasterprob(), GCGsolverGetHeurFarkasTime(), and GCG_Solver::heurfarkasclock.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetHeurFarkasTime().

◆ GCGsolverGetHeurRedcostTime()

SCIP_Real GCGsolverGetHeurRedcostTime ( GCG * gcg,
GCG_SOLVER * solver )

gets heuristic reduced cost pricing time of pricing solver

Parameters
gcgGCG data structure
solverpricing solver

Definition at line 547 of file solver.c.

References assert(), GCGgetMasterprob(), GCGsolverGetHeurRedcostTime(), and GCG_Solver::heurredcostclock.

Referenced by GCGpricerPrintPricingStatistics(), and GCGsolverGetHeurRedcostTime().