SCIP Doxygen Documentation
Loading...
Searching...
No Matches
probdata_cyc.h File Reference

Detailed Description

problem data for cycle clustering problem

Author
Leon Eifler

This file implements the problem data for the cycle clustering problem.

The problem data contains original transition matrix, the scaling parameter that appears in the objective function, and all variables that appear in the problem.

Definition in file probdata_cyc.h.

#include "scip/scip.h"
#include "tclique/tclique.h"
#include "scip/cons_setppc.h"
#include "scip/type_cons.h"
#include "scip/def.h"

Go to the source code of this file.

Functions

SCIP_RETCODE freeMatrix (SCIP_Real **matrix, int nbins)
SCIP_Real getMinNonZero (SCIP *scip, SCIP_Real **matrix, int size)
SCIP_Real ** SCIPcycGetCmatrix (SCIP *scip)
int SCIPcycGetNBins (SCIP *scip)
int SCIPcycGetNCluster (SCIP *scip)
SCIP_VAR *** SCIPcycGetBinvars (SCIP *scip)
SCIP_VAR **** SCIPcycGetEdgevars (SCIP *scip)
SCIP_VARgetEdgevar (SCIP_VAR ****edgevars, int state1, int state2, EDGETYPE edgetype)
SCIP_Bool edgesExist (SCIP_VAR ****edgevars, int *states, int nstates)
SCIP_DIGRAPHSCIPcycGetEdgeGraph (SCIP *scip)
SCIP_Real SCIPcycGetScale (SCIP *scip)
SCIP_RETCODE SCIPcycPrintSolutionValues (SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateProbCyc (SCIP *scip, const char *name, int nbins, int ncluster, SCIP_Real **cmatrix)
int phi (int k, int ncluster)
int phiinv (int k, int ncluster)
SCIP_RETCODE assignVars (SCIP *scip, SCIP_SOL *sol, SCIP_Real **clustering, int nbins, int ncluster)
SCIP_Bool isPartition (SCIP *scip, SCIP_Real **solclustering, int nbins, int ncluster)

Typedef Documentation

◆ EDGETYPE

typedef enum EdgeType EDGETYPE

Definition at line 54 of file probdata_cyc.h.

Enumeration Type Documentation

◆ EdgeType

enum EdgeType

edge type

Enumerator
INCLUSTER 

edge inside a single cluster

CONSECUTIVE_CLUSTER 

edge connecting two consecutive cluster

NON_CONSECUTIVE_CLUSTER 

edge connecting two non-consecutive cluster

Definition at line 48 of file probdata_cyc.h.

Function Documentation

◆ freeMatrix()

SCIP_RETCODE freeMatrix ( SCIP_Real ** matrix,
int nbins )

free memory allocated for an nxn matrix

Parameters
matrixthe matrix to be freed
nbinsthe size

References SCIP_Real.

◆ getMinNonZero()

SCIP_Real getMinNonZero ( SCIP * scip,
SCIP_Real ** matrix,
int size )

gets the minmal non-zero value in a n x n matrix

Parameters
scipSCIP data structure
matrixthe matrix
sizethe matrix-size

References SCIP_Bool, SCIP_Real, and sol.

◆ SCIPcycGetCmatrix()

SCIP_Real ** SCIPcycGetCmatrix ( SCIP * scip)

getter methods for the probdata

Getter methods for the various parts of the probdata Returns the transition matrix

Parameters
scipSCIP data structure

Definition at line 1382 of file probdata_cyc.c.

References assert(), NULL, SCIP_Real, and SCIPgetProbData().

Referenced by runCyckerlin(), SCIP_DECL_HEUREXEC(), and SCIPapplyRedSize().

◆ SCIPcycGetNBins()

int SCIPcycGetNBins ( SCIP * scip)

◆ SCIPcycGetNCluster()

int SCIPcycGetNCluster ( SCIP * scip)

◆ SCIPcycGetBinvars()

SCIP_VAR *** SCIPcycGetBinvars ( SCIP * scip)

returns the state-variable-matrix

Returns the state-variable-matrix

Parameters
scipSCIP data structure

Definition at line 1430 of file probdata_cyc.c.

References assert(), NULL, and SCIPgetProbData().

Referenced by assignVars(), branchOnBin(), getBranchCands(), getSolutionValues(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), and SCIPcycAddIncompleteSol().

◆ SCIPcycGetEdgevars()

SCIP_VAR **** SCIPcycGetEdgevars ( SCIP * scip)

returns the edge variables

Returns the edge variables

Parameters
scipSCIP data structure

Definition at line 1463 of file probdata_cyc.c.

References assert(), NULL, and SCIPgetProbData().

Referenced by addPathCuts(), addSubtourCuts(), addTourCuts(), assignVars(), createPartitionCut(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().

◆ getEdgevar()

SCIP_VAR * getEdgevar ( SCIP_VAR **** edgevars,
int state1,
int state2,
EDGETYPE edgetype )

Return one specific edge variable

return one specific edge variable

Parameters
edgevarsedgevar data structure
state1first state
state2second state
edgetypeposition in clustering

Definition at line 1480 of file probdata_cyc.c.

References assert(), and NULL.

Referenced by addPathCuts(), addSubtourCuts(), addTourCuts(), createPartitionCut(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().

◆ edgesExist()

SCIP_Bool edgesExist ( SCIP_VAR **** edgevars,
int * states,
int nstates )

check for an array of states, if all possible edge-combinations exist

Parameters
edgevarsedgevar data structure
statesstate array
nstatessize of state array

Definition at line 1496 of file probdata_cyc.c.

References assert(), FALSE, i, NULL, SCIP_Bool, and TRUE.

Referenced by SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().

◆ SCIPcycGetEdgeGraph()

SCIP_DIGRAPH * SCIPcycGetEdgeGraph ( SCIP * scip)

returns the edge-graph

Returns the edge-graph

Parameters
scipSCIP data structure

Definition at line 1528 of file probdata_cyc.c.

References assert(), NULL, and SCIPgetProbData().

Referenced by SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().

◆ SCIPcycGetScale()

SCIP_Real SCIPcycGetScale ( SCIP * scip)

returns the number of scaling parameter

Returns the scaling parameter

Parameters
scipSCIP data structure

Definition at line 1447 of file probdata_cyc.c.

References assert(), NULL, SCIP_Real, and SCIPgetProbData().

Referenced by assignNextBin(), createSwitchSolution(), getTempObj(), SCIP_DECL_HEUREXEC(), SCIPapplyRedSize(), and switchNext().

◆ SCIPcycPrintSolutionValues()

SCIP_RETCODE SCIPcycPrintSolutionValues ( SCIP * scip,
SCIP_SOL * sol )

print all the relevant solution data

print the model-values like coherence in the clusters and transition-probabilities between clusters that are not evident from the scip-solution

Parameters
scipSCIP data structure
solThe solution containg the values

Definition at line 1548 of file probdata_cyc.c.

References assert(), i, NULL, phi(), SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_NORMAL, SCIPgetProbData(), SCIPgetSolVal(), SCIPverbMessage(), and sol.

◆ SCIPcreateProbCyc()

SCIP_RETCODE SCIPcreateProbCyc ( SCIP * scip,
const char * name,
int nbins,
int ncluster,
SCIP_Real ** cmatrix )

create the probdata for a cycle clustering problem

Create the probdata for an cyc-clustering problem

add callback methods to scip

Parameters
scipSCIP data structure
nameproblem name
nbinsnumber of bins
nclusternumber of cluster
cmatrixThe transition matrix

Definition at line 1303 of file probdata_cyc.c.

References assert(), createProbOnlyEdge(), createProbQP(), createProbSimplified(), createProbSimplifiedTest(), createVariables(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_NORMAL, SCIPABORT, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPcreateDigraph(), SCIPcreateProbBasic(), SCIPgetCharParam(), SCIPsetProbCopy(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbTrans(), and SCIPverbMessage().

Referenced by readCyc(), and SCIPapplyRedSize().

◆ phi()

int phi ( int k,
int ncluster )

function that returns the successive cluster along the cycle

Parameters
kthe cluster
nclusterthe number of clusters

Definition at line 181 of file probdata_cyc.c.

References assert().

Referenced by assignVars(), createProbQP(), createProbSimplified(), and SCIPcycPrintSolutionValues().

◆ phiinv()

int phiinv ( int k,
int ncluster )

function that returns the previous cluster along the cycle

function that returns the predecessor-cluster along the cycle

Parameters
kthe cluster
nclusterthe number of clusters

Definition at line 193 of file probdata_cyc.c.

References assert().

Referenced by createProbSimplified(), and getTempObj().

◆ assignVars()

SCIP_RETCODE assignVars ( SCIP * scip,
SCIP_SOL * sol,
SCIP_Real ** clustering,
int nbins,
int ncluster )

assign the variables in scip according to the found clustering.

Assign the variables in scip according to the found clustering.

Parameters
scipSCIP data structure
solthe SCIP solution
clusteringthe matrix with the clusterassignment
nbinsthe number of bins
nclusterthe number of cluster

Definition at line 88 of file probdata_cyc.c.

References assert(), c, CONSECUTIVE_CLUSTER, i, INCLUSTER, NULL, phi(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPcycGetBinvars(), SCIPcycGetEdgevars(), SCIPisEQ(), SCIPisGE(), SCIPisIntegral(), SCIPisLE(), SCIPsetSolVal(), SCIPvarGetLbGlobal(), SCIPvarGetStatus(), SCIPvarGetTransVar(), SCIPvarGetUbGlobal(), SCIPvarIsTransformed(), sol, and var.

Referenced by createSwitchSolution(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), and SCIPcycAddIncompleteSol().

◆ isPartition()

SCIP_Bool isPartition ( SCIP * scip,
SCIP_Real ** solclustering,
int nbins,
int ncluster )

check if the clustering has exactly one state in every cluster.

Check if the clustering has exactly one state in every cluster.

Parameters
scipSCIP data structure
solclusteringmatrix with the clustering
nbinsthe number of bins
nclusterthe number of clusters

Definition at line 57 of file probdata_cyc.c.

References FALSE, i, SCIP_Bool, SCIP_Real, SCIPisEQ(), SCIPisIntegral(), SCIPisZero(), and TRUE.

Referenced by createSwitchSolution(), runCyckerlin(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), and switchNext().