Scippy

SCIP

Solving Constraint Integer Programs

probdata_stp.h File Reference

Detailed Description

Problem data for stp problem.

Author
Gerald Gamrath
Thorsten Koch
Michael Winkler
Daniel Rehfeldt

This file implements the problem data for Steiner problems. For more details see Main problem data page.

Definition in file probdata_stp.h.

#include "scip/scip.h"
#include "graph.h"

Go to the source code of this file.

Macros

#define STP_MODE_CUT   0
 
#define STP_MODE_FLOW   1
 
#define STP_MODE_PRICE   2
 
#define STP_CONS_NEVER   0
 
#define STP_CONS_ALWAYS   1
 
#define STP_CONS_AUTOMATIC   2
 
#define STP_USEDP_NEVER   0
 
#define STP_USEDP_ALWAYS   1
 
#define STP_USEDP_AUTOMATIC   2
 

Functions

SCIP_RETCODE SCIPprobdataSetDefaultParams (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataCreate (SCIP *scip, const char *filename)
 
SCIP_RETCODE SCIPprobdataCreateFromGraph (SCIP *scip, SCIP_Real offset, const char *probname, SCIP_Bool isSubProb, GRAPH *graph_move)
 
void SCIPprobdataSetGraph (SCIP_PROBDATA *probdata, GRAPH *graph)
 
GRAPHSCIPprobdataGetGraph (SCIP_PROBDATA *probdata)
 
GRAPHSCIPprobdataGetGraph2 (SCIP *scip)
 
void SCIPprobdataSetOffset (SCIP_PROBDATA *probdata, SCIP_Real offset)
 
SCIP_VAR ** SCIPprobdataGetVars (SCIP *scip)
 
SCIP_VAR ** SCIPprobdataGetEdgeVars (SCIP *scip)
 
int * SCIPprobdataGetRTerms (SCIP *scip)
 
int * SCIPprobdataGetPctermsorder (SCIP *scip)
 
int SCIPprobdataGetNLayers (SCIP *scip)
 
int SCIPprobdataGetNVars (SCIP *scip)
 
int SCIPprobdataGetNTerms (SCIP *scip)
 
int SCIPprobdataGetRNTerms (SCIP *scip)
 
int SCIPprobdataGetRoot (SCIP *scip)
 
int SCIPprobdataGetNorgEdges (SCIP *scip)
 
int SCIPprobdataGetNEdges (SCIP *scip)
 
int SCIPprobdataGetNNodes (SCIP *scip)
 
SCIP_Real SCIPprobdataGetOffset (SCIP *scip)
 
SCIP_Real SCIPprobdataGetPresolUpperBound (SCIP *scip)
 
SCIP_Real SCIPprobdataGetPresolUpperBoundWithOffset (SCIP *scip)
 
SCIP_VARSCIPprobdataGetedgeVarByIndex (SCIP *scip, int idx)
 
SCIP_RealSCIPprobdataGetXval (SCIP *scip, SCIP_SOL *sol)
 
SCIP_CONS ** SCIPprobdataGetEdgeConstraints (SCIP *scip)
 
SCIP_CONS ** SCIPprobdataGetPathConstraints (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataPrintGraph (SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool printsol)
 
SCIP_Bool SCIPprobdataIsBigt (SCIP *scip)
 
SCIP_Bool SCIPprobdataObjIsIntegral (SCIP *scip)
 
SCIP_Bool SCIPprobdataIsSubproblem (SCIP *scip)
 
SCIP_Bool SCIPprobdataProbIsAdversarial (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataWriteIntermediateSolution (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataWriteSolution (SCIP *scip, FILE *file)
 
void SCIPprobdataWriteLogLine (SCIP *scip, const char *formatstr,...)
 
SCIP_RETCODE SCIPprobdataAddNewSol (SCIP *scip, SCIP_Real *nval, SCIP_HEUR *heur, SCIP_Bool *success)
 
void SCIPprobdataSetDualBound (SCIP *scip, SCIP_Real dual)
 
void SCIPprobdataSetNSolvers (SCIP *scip, int nSolvers)
 
int SCIPprobdataGetType (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataWriteLogfileEnd (SCIP *scip)
 
void initReceivedSubproblem (SCIP *scip, const int lLinearConsNames, const char *linearConsNames, const int lSetppcConsNames, const char *setppcConsNames)
 

Macro Definition Documentation

◆ STP_MODE_CUT

◆ STP_MODE_FLOW

◆ STP_MODE_PRICE

#define STP_MODE_PRICE   2

◆ STP_CONS_NEVER

#define STP_CONS_NEVER   0

never use (respective) constraints

Definition at line 43 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph().

◆ STP_CONS_ALWAYS

#define STP_CONS_ALWAYS   1

always use (respective) constraints

Definition at line 44 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph(), and setParams().

◆ STP_CONS_AUTOMATIC

#define STP_CONS_AUTOMATIC   2

use (respective) constraints depending on the problem instance

Definition at line 45 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph(), and setParams().

◆ STP_USEDP_NEVER

#define STP_USEDP_NEVER   0

never use DP

Definition at line 47 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph().

◆ STP_USEDP_ALWAYS

#define STP_USEDP_ALWAYS   1

always use

Definition at line 48 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph().

◆ STP_USEDP_AUTOMATIC

#define STP_USEDP_AUTOMATIC   2

let SCIP-Jack decide

Definition at line 49 of file probdata_stp.h.

Referenced by SCIPprobdataCreateFromGraph().

Function Documentation

◆ SCIPprobdataSetDefaultParams()

SCIP_RETCODE SCIPprobdataSetDefaultParams ( SCIP scip)

sets up the problem data

Parameters
scipSCIP data structure

Definition at line 2645 of file probdata_stp.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIPlpiGetSolverName(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetRealParam(), SCIPsetSubscipsOff(), and TRUE.

Referenced by initReceivedSubproblem(), runShell(), and subscipSetupParameters().

◆ SCIPprobdataCreate()

SCIP_RETCODE SCIPprobdataCreate ( SCIP scip,
const char *  filename 
)

◆ SCIPprobdataCreateFromGraph()

◆ SCIPprobdataSetGraph()

void SCIPprobdataSetGraph ( SCIP_PROBDATA probdata,
GRAPH graph 
)

sets the probdata graph

Parameters
probdataproblem data
graphgraph data structure

Definition at line 2936 of file probdata_stp.c.

References NULL.

◆ SCIPprobdataGetGraph()

◆ SCIPprobdataGetGraph2()

◆ SCIPprobdataSetOffset()

void SCIPprobdataSetOffset ( SCIP_PROBDATA probdata,
SCIP_Real  offset 
)

sets the offset

Parameters
probdataproblem data
offsetthe offset value

Definition at line 2973 of file probdata_stp.c.

References NULL.

◆ SCIPprobdataGetVars()

◆ SCIPprobdataGetEdgeVars()

SCIP_VAR** SCIPprobdataGetEdgeVars ( SCIP scip)

returns the array with all edge variables

Parameters
scipSCIP data structure

Definition at line 3277 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by branchOnVertex(), buildsolgraph(), selectBranchingVertexByLp(), and selectBranchingVertexByLp2Flow().

◆ SCIPprobdataGetRTerms()

int* SCIPprobdataGetRTerms ( SCIP scip)

returns the array with all terminals (without the root)

returns the array with all variables

Parameters
scipSCIP data structure

Definition at line 3247 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataGetPctermsorder()

int* SCIPprobdataGetPctermsorder ( SCIP scip)

returns array

Parameters
scipSCIP data structure

Definition at line 3262 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIPStpHeurTMBuildTreePcMw(), and solstp_pcGetSolRoot().

◆ SCIPprobdataGetNLayers()

int SCIPprobdataGetNLayers ( SCIP scip)

returns the number of layers

Parameters
scipSCIP data structure

Definition at line 3015 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetNVars()

int SCIPprobdataGetNVars ( SCIP scip)

returns the number of vars

returns the number of variables

Parameters
scipSCIP data structure

Definition at line 2985 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by consdataCheck(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSLOCK(), SCIP_DECL_CONSPROP(), SCIP_DECL_HEUREXEC(), selectBranchingVertexBySol(), and solpool_addSolToScip().

◆ SCIPprobdataGetNTerms()

int SCIPprobdataGetNTerms ( SCIP scip)

returns the number of terminals

Parameters
scipSCIP data structure

Definition at line 3060 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIPStpHeurTMBuildTreePcMw(), and solstp_pcGetSolRoot().

◆ SCIPprobdataGetRNTerms()

int SCIPprobdataGetRNTerms ( SCIP scip)

returns the number of terminals without the root node

Parameters
scipSCIP data structure

Definition at line 3075 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT(), and SCIP_DECL_PRICERINITSOL().

◆ SCIPprobdataGetRoot()

int SCIPprobdataGetRoot ( SCIP scip)

returns root

Parameters
scipSCIP data structure

Definition at line 3090 of file probdata_stp.c.

References NULL, SCIPgetProbData(), and GRAPH::source.

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataGetNorgEdges()

int SCIPprobdataGetNorgEdges ( SCIP scip)

returns numer of original edges

Parameters
scipSCIP data structure

Definition at line 3109 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by abortSlackPruneEarly(), and SCIPintListNodeAppendCopy().

◆ SCIPprobdataGetNEdges()

int SCIPprobdataGetNEdges ( SCIP scip)

returns the number of edges

Parameters
scipSCIP data structure

Definition at line 3030 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT(), and SCIP_DECL_PRICERINITSOL().

◆ SCIPprobdataGetNNodes()

int SCIPprobdataGetNNodes ( SCIP scip)

returns the number of nodes

Parameters
scipSCIP data structure

Definition at line 3045 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIPStpHeurTMBuildTreePcMw(), and solstp_pcGetSolRoot().

◆ SCIPprobdataGetOffset()

SCIP_Real SCIPprobdataGetOffset ( SCIP scip)

returns the offset

returns offset of the problem

Parameters
scipSCIP data structure

Definition at line 3124 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by dualascent_execPcMw(), SCIP_DECL_HEUREXEC(), SCIP_DECL_READERWRITE(), SCIP_DECL_RELAXEXEC(), SCIPStpHeurSlackPruneRun(), and solAddTry().

◆ SCIPprobdataGetPresolUpperBound()

SCIP_Real SCIPprobdataGetPresolUpperBound ( SCIP scip)

returns upper bound from presolving

returns upper bound from presolving NOTE: Mind to call the method in transformed stage!

Parameters
scipSCIP data structure

Definition at line 3141 of file probdata_stp.c.

References GT, NULL, SCIP_Real, SCIPgetProbData(), SCIPgetTransObjoffset(), and SCIPgetTransObjscale().

Referenced by getCutoffbound().

◆ SCIPprobdataGetPresolUpperBoundWithOffset()

SCIP_Real SCIPprobdataGetPresolUpperBoundWithOffset ( SCIP scip)

returns upper bound from presolving

Parameters
scipSCIP data structure

Definition at line 3157 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetedgeVarByIndex()

SCIP_VAR* SCIPprobdataGetedgeVarByIndex ( SCIP scip,
int  idx 
)

returns the edge variable for a given index

returns the variable for a given index

Parameters
scipSCIP data structure
idxindex of the edge

Definition at line 3173 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetXval()

◆ SCIPprobdataGetEdgeConstraints()

SCIP_CONS** SCIPprobdataGetEdgeConstraints ( SCIP scip)

returns all edge constraints

Parameters
scipSCIP data structure

Definition at line 3218 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataGetPathConstraints()

SCIP_CONS** SCIPprobdataGetPathConstraints ( SCIP scip)

returns all path constraints

Parameters
scipSCIP data structure

Definition at line 3232 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataPrintGraph()

SCIP_RETCODE SCIPprobdataPrintGraph ( SCIP scip,
const char *  filename,
SCIP_SOL sol,
SCIP_Bool  printsol 
)

print (undirected) graph

print (undirected) graph in GML format

Parameters
scipSCIP data structure
filenamename of the output file
solsolution to be printed; or NULL for LP solution
printsolshould solution be printed?

Definition at line 3375 of file probdata_stp.c.

References FALSE, graph_writeGml(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetProbData(), SCIPgetSolVal(), SCIPisZero(), and TRUE.

◆ SCIPprobdataIsBigt()

SCIP_Bool SCIPprobdataIsBigt ( SCIP scip)

returns if 'T' model is being used

Parameters
scipSCIP data structure

Definition at line 3292 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataObjIsIntegral()

SCIP_Bool SCIPprobdataObjIsIntegral ( SCIP scip)
Parameters
scipSCIP data structure

Definition at line 3308 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataIsSubproblem()

SCIP_Bool SCIPprobdataIsSubproblem ( SCIP scip)

returns if in subproblem

Parameters
scipSCIP data structure

Definition at line 3359 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataProbIsAdversarial()

SCIP_Bool SCIPprobdataProbIsAdversarial ( SCIP scip)

returns whether problem seems very hard

Parameters
scipSCIP data structure

Definition at line 3324 of file probdata_stp.c.

References FALSE, getEdgeReductionRatio(), graph_pc_isPcMw(), GT, MINREDUCTION_RATIO_PCMW, MINREDUCTION_RATIO_STP, SCIP_Real, SCIPgetProbData(), and TRUE.

Referenced by branchruleGetType(), initSolNumberBounds(), and SCIP_DECL_HEUREXEC().

◆ SCIPprobdataWriteIntermediateSolution()

SCIP_RETCODE SCIPprobdataWriteIntermediateSolution ( SCIP scip)

writes the best solution to the intermediate solution file

Parameters
scipSCIP data structure

Definition at line 3419 of file probdata_stp.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPgetProbData(), and SCIPprobdataWriteSolution().

Referenced by SCIP_DECL_EVENTEXEC().

◆ SCIPprobdataWriteSolution()

◆ SCIPprobdataWriteLogLine()

void SCIPprobdataWriteLogLine ( SCIP scip,
const char *  formatstr,
  ... 
)

writes a line to the log file

Parameters
scipSCIP data structure
formatstrformat string like in printf() function

Definition at line 3659 of file probdata_stp.c.

References SCIP_Messagehdlr::logfile, NULL, SCIPgetMessagehdlr(), SCIPgetProbData(), and SCIPmessageVFPrintInfo().

Referenced by SCIP_DECL_EVENTEXEC(), SCIP_DECL_PROBEXITSOL(), SCIPprobdataWriteLogfileEnd(), SCIPprobdataWriteSolution(), and writeCommentSection().

◆ SCIPprobdataAddNewSol()

◆ SCIPprobdataSetDualBound()

void SCIPprobdataSetDualBound ( SCIP scip,
SCIP_Real  dual 
)

set dual bound by ug

writes end of log file

Parameters
scipSCIP data structure
dualdual bound

Definition at line 4048 of file probdata_stp.c.

References NULL, SCIPgetProbData(), and TRUE.

◆ SCIPprobdataSetNSolvers()

void SCIPprobdataSetNSolvers ( SCIP scip,
int  nSolvers 
)

set the number of solvers

writes end of log file

Parameters
scipSCIP data structure
nSolversthe number of solvers

Definition at line 4063 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetType()

int SCIPprobdataGetType ( SCIP scip)

returns problem type

Parameters
scipSCIP data structure

Definition at line 3972 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_EVENTEXEC(), and SCIPintListNodeAppendCopy().

◆ SCIPprobdataWriteLogfileEnd()

◆ initReceivedSubproblem()

void initReceivedSubproblem ( SCIP scip,
const int  lLinearConsNames,
const char *  linearConsNames,
const int  lSetppcConsNames,
const char *  setppcConsNames 
)