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 "grph.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPprobdataCreate (SCIP *scip, const char *filename)
 
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 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)
 
SCIP_Real SCIPprobdataGetOffset (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_RETCODE SCIPprobdataPrintGraph2 (const GRAPH *graph, const char *filename, SCIP_Bool *edgemark)
 
SCIP_Bool SCIPprobdataIsBigt (SCIP *scip)
 
SCIP_RETCODE SCIPprobdataWriteIntermediateSolution (SCIP *scip)
 
void SCIPprobdataWriteStp (SCIP *scip, const GRAPH *graph, const char *filename)
 
SCIP_RETCODE SCIPprobdataWriteSolution (SCIP *scip, FILE *file)
 
void SCIPprobdataWriteLogLine (SCIP *scip, const char *formatstr,...)
 
SCIP_RETCODE SCIPprobdataAddNewSol (SCIP *scip, SCIP_Real *nval, SCIP_SOL *sol, 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)
 

Function Documentation

◆ SCIPprobdataCreate()

SCIP_RETCODE SCIPprobdataCreate ( SCIP scip,
const char *  filename 
)

sets up the problem data

Parameters
scipSCIP data structure
filenamefile name

Definition at line 1917 of file probdata_stp.c.

References CENTER_DEG, central_terminal(), CONS_ALWAYS, CONS_SPECIFIC, createConstraints(), createDegreeConstraints(), createHopConstraint(), createPrizeConstraints(), createVariables(), CUT_MAXNEDGES, CUT_MAXNTERMINALS, CUT_MAXTOTNEDGES, CYC_CONS_LIMIT, GRAPH::edges, FALSE, presolve_info::fixed, graph_copy(), graph_load(), graph_mincut_init(), graph_pack(), graph_path_init(), Is_term, GRAPH::knots, GRAPH::layers, MODE_CUT, MODE_FLOW, MODE_PRICE, nnodes, NULL, GRAPH::orgsource, polyscip::global::print(), probdataCreate(), probdataPrintGraph(), reduce(), SCIP_Bool, SCIP_CALL, SCIP_FILECREATEERROR, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPaddCons(), SCIPallocMemoryArray, SCIPcreateConsStp(), SCIPcreateProbBasic(), SCIPdebugMessage, SCIPerrorMessage, SCIPgetBoolParam(), SCIPgetCharParam(), SCIPgetIntParam(), SCIPgetRealParam(), SCIPgetStringParam(), SCIPprintSysError(), SCIPprobdataWriteLogLine(), SCIPreleaseCons(), SCIPsetIntParam(), SCIPsetObjsense(), SCIPsetProbCopy(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbExitsol(), SCIPsetProbInitsol(), SCIPsetProbTrans(), SCIPsetRealParam(), SCIPsnprintf(), SCIPsplitFilename(), SCIPStpDualAscent(), SCIPStpDualAscentPcMw(), SCIPwriteOrigProblem(), GRAPH::source, STP_DCSTP, STP_DHCSTP, STP_GSTP, STP_MWCSP, STP_NWSPG, STP_OARSMT, STP_PCSPG, STP_RMWCSP, STP_RPCSPG, STP_RSMT, STP_SAP, STP_SPG, GRAPH::stp_type, SYM_CONS_LIMIT, GRAPH::term, GRAPH::terms, TRUE, and VERSION_SCIPJACK.

◆ SCIPprobdataSetGraph()

void SCIPprobdataSetGraph ( SCIP_PROBDATA probdata,
GRAPH graph 
)

sets the probdata graph

Parameters
probdataproblem data
graphgraph data structure

Definition at line 2347 of file probdata_stp.c.

References NULL.

◆ SCIPprobdataGetGraph()

◆ SCIPprobdataGetGraph2()

GRAPH* SCIPprobdataGetGraph2 ( SCIP scip)

returns the graph

Parameters
scipproblem data

Definition at line 2369 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSINITSOL(), SCIPStpConshdlrSetGraph(), and selectBranchingVertexBySol().

◆ SCIPprobdataSetOffset()

void SCIPprobdataSetOffset ( SCIP_PROBDATA probdata,
SCIP_Real  offset 
)

sets the offset

Parameters
probdataproblem data
offsetthe offset value

Definition at line 2384 of file probdata_stp.c.

References NULL.

◆ SCIPprobdataGetVars()

SCIP_VAR** SCIPprobdataGetVars ( SCIP scip)

returns the array with all variables

Parameters
scipSCIP data structure

Definition at line 2411 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by consdataCheck(), cut_add(), reduce_boundHopRc(), SCIP_DECL_CONSLOCK(), SCIP_DECL_CONSPROP(), SCIP_DECL_HEUREXEC(), SCIP_DECL_PROPEXEC(), SCIPStpDualAscent(), SCIPStpDualAscentPcMw(), SCIPStpHeurTMRunLP(), sep_2cut(), and sep_flow().

◆ SCIPprobdataGetEdgeVars()

SCIP_VAR** SCIPprobdataGetEdgeVars ( SCIP scip)

returns the array with all edge variables

Parameters
scipSCIP data structure

Definition at line 2625 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 2610 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataGetNLayers()

int SCIPprobdataGetNLayers ( SCIP scip)

returns the number of layers

Parameters
scipSCIP data structure

Definition at line 2426 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 2396 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(), SCIPStpHeurAscendPruneRun(), and selectBranchingVertexBySol().

◆ SCIPprobdataGetNTerms()

int SCIPprobdataGetNTerms ( SCIP scip)

returns the number of terminals

Parameters
scipSCIP data structure

Definition at line 2456 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetRNTerms()

int SCIPprobdataGetRNTerms ( SCIP scip)

returns the number of terminals without the root node

Parameters
scipSCIP data structure

Definition at line 2471 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 2486 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 2505 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIPintListNodeAppendCopy().

◆ SCIPprobdataGetNEdges()

int SCIPprobdataGetNEdges ( SCIP scip)

returns the number of edges

Parameters
scipSCIP data structure

Definition at line 2441 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT(), and SCIP_DECL_PRICERINITSOL().

◆ SCIPprobdataGetOffset()

SCIP_Real SCIPprobdataGetOffset ( SCIP scip)

returns the offset

returns offset of the problem

Parameters
scipSCIP data structure

Definition at line 2520 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by reduce_daSlackPruneMw(), SCIP_DECL_HEUREXEC(), SCIP_DECL_READERWRITE(), SCIPStpDualAscentPcMw(), SCIPStpHeurSlackPruneRun(), and SCIPStpHeurSlackPruneRunPcMw().

◆ 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 2536 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetXval()

SCIP_Real* SCIPprobdataGetXval ( SCIP scip,
SCIP_SOL sol 
)

returns the LP solution values

Parameters
scipSCIP data structure
solsolution to get values from

Definition at line 2553 of file probdata_stp.c.

References NULL, SCIP_CALL_ABORT, SCIP_Real, SCIPgetProbData(), and SCIPgetSolVals().

Referenced by SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_HEUREXEC(), SCIPStpHeurTMRunLP(), sep_2cut(), and sep_flow().

◆ SCIPprobdataGetEdgeConstraints()

SCIP_CONS** SCIPprobdataGetEdgeConstraints ( SCIP scip)

returns all edge constraints

Parameters
scipSCIP data structure

Definition at line 2581 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 2595 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 2655 of file probdata_stp.c.

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

Referenced by pricing().

◆ SCIPprobdataPrintGraph2()

SCIP_RETCODE SCIPprobdataPrintGraph2 ( const GRAPH graph,
const char *  filename,
SCIP_Bool edgemark 
)

print graph (in undirected form) in GML format with given edges highlighted

Parameters
graphGraph to be printed
filenameName of the output file
edgemarkArray of (undirected) edges to highlight

Definition at line 3431 of file probdata_stp.c.

References GRAPH::cost, EAT_FREE, GRAPH::edges, FALSE, GRAPH::head, GRAPH::knots, GRAPH::mark, NULL, GRAPH::oeat, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPgmlWriteClosing(), SCIPgmlWriteEdge(), SCIPgmlWriteNode(), SCIPgmlWriteOpening(), SCIPsnprintf(), GRAPH::source, GRAPH::tail, GRAPH::term, and TRUE.

◆ SCIPprobdataIsBigt()

SCIP_Bool SCIPprobdataIsBigt ( SCIP scip)

returns if 'T' model is being used

Parameters
scipSCIP data structure

Definition at line 2640 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_PRICERINIT().

◆ SCIPprobdataWriteIntermediateSolution()

SCIP_RETCODE SCIPprobdataWriteIntermediateSolution ( SCIP scip)

writes the best solution to the intermediate solution file

Parameters
scipSCIP data structure

Definition at line 2699 of file probdata_stp.c.

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

Referenced by SCIP_DECL_EVENTEXEC().

◆ SCIPprobdataWriteStp()

void SCIPprobdataWriteStp ( SCIP scip,
const GRAPH graph,
const char *  filename 
)

writes SPG (no variant!) to a file

Parameters
scipSCIP data structure
graphgraph data structure
filenamefile name

Definition at line 2715 of file probdata_stp.c.

References GRAPH::cost, GRAPH::edges, GRAPH::head, Is_term, GRAPH::knots, NULL, GRAPH::tail, GRAPH::term, and GRAPH::terms.

◆ 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 3126 of file probdata_stp.c.

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

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

◆ 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 3577 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 3592 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

◆ SCIPprobdataGetType()

int SCIPprobdataGetType ( SCIP scip)

returns problem type

Parameters
scipSCIP data structure

Definition at line 3501 of file probdata_stp.c.

References NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_EVENTEXEC(), and SCIPintListNodeAppendCopy().

◆ SCIPprobdataWriteLogfileEnd()

SCIP_RETCODE SCIPprobdataWriteLogfileEnd ( SCIP scip)

◆ initReceivedSubproblem()

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

branching information from UG

Parameters
scipSCIP data structure
lLinearConsNamesnumber of linear constraints
linearConsNameslinear constraints string
lSetppcConsNamesnumber of setppc constraints
setppcConsNamesnumber of setppc constraints

Definition at line 3606 of file probdata_stp.c.

References BLOCKED, BRANCH_STP_VERTEX_KILLED, BRANCH_STP_VERTEX_TERM, GRAPH::cost, EAT_LAST, FALSE, flipedge, graph_copy(), graph_free(), graph_init_history(), graph_knot_chg(), graph_mincut_exit(), graph_mincut_init(), graph_path_exit(), graph_path_init(), GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::knots, MODE_CUT, nnodes, NULL, SCIP_CALL_ABORT, SCIPallocBufferArray, SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetProbData(), SCIPprobdataGetGraph(), SCIPStpBranchruleInitNodeState(), STPStpBranchruleParseConsname(), GRAPH::term, and TRUE.