Detailed Description
problem data for cycle clustering problem
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_VAR * | getEdgevar (SCIP_VAR ****edgevars, int state1, int state2, int direction) |
SCIP_Bool | edgesExist (SCIP_VAR ****edgevars, int *states, int nstates) |
SCIP_DIGRAPH * | SCIPcycGetEdgeGraph (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) |
Function Documentation
◆ freeMatrix()
SCIP_RETCODE freeMatrix | ( | SCIP_Real ** | matrix, |
int | nbins | ||
) |
free memory allocated for an nxn matrix
- Parameters
-
matrix the matrix to be freed nbins the size
◆ getMinNonZero()
gets the minmal non-zero value in a n x n matrix
- Parameters
-
scip SCIP data structure matrix the matrix size the matrix-size
◆ SCIPcycGetCmatrix()
getter methods for the probdata
Getter methods for the various parts of the probdata Returns the transition matrix
- Parameters
-
scip SCIP data structure
Definition at line 1353 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by runCyckerlin(), SCIP_DECL_HEUREXEC(), and SCIPapplyRedSize().
◆ SCIPcycGetNBins()
int SCIPcycGetNBins | ( | SCIP * | scip | ) |
returns the number of states
Returns the number of states
- Parameters
-
scip SCIP data structure
Definition at line 1369 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by getBranchCands(), getSolutionValues(), runCyckerlin(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), SCIP_DECL_SEPAEXECLP(), SCIPapplyRedSize(), SCIPcycAddIncompleteSol(), and switchNext().
◆ SCIPcycGetNCluster()
int SCIPcycGetNCluster | ( | SCIP * | scip | ) |
returns the number of clusters
Returns the number of clusters
- Parameters
-
scip SCIP data structure
Definition at line 1385 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by addPathCuts(), addSubtourCuts(), branchOnBin(), getBranchCands(), getSolutionValues(), runCyckerlin(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), SCIP_DECL_SEPAEXECLP(), SCIPapplyRedSize(), SCIPcycAddIncompleteSol(), and switchNext().
◆ SCIPcycGetBinvars()
returns the state-variable-matrix
Returns the state-variable-matrix
- Parameters
-
scip SCIP data structure
Definition at line 1401 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by assignVars(), branchOnBin(), getBranchCands(), getSolutionValues(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and SCIPcycAddIncompleteSol().
◆ SCIPcycGetEdgevars()
returns the edge variables
Returns the edge variables
- Parameters
-
scip SCIP data structure
Definition at line 1434 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by addPathCuts(), addSubtourCuts(), addTourCuts(), assignVars(), createPartitionCut(), and SCIP_DECL_SEPAEXECLP().
◆ getEdgevar()
Return one specific edge variable
return one specific edge variable
- Parameters
-
edgevars edgevar data structure state1 first state state2 second state direction direction, 0 = incluster, 1 = forward
Definition at line 1451 of file probdata_cyc.c.
References NULL.
Referenced by addPathCuts(), addSubtourCuts(), addTourCuts(), createPartitionCut(), and SCIP_DECL_SEPAEXECLP().
◆ edgesExist()
check for an array of states, if all possible edge-combinations exist
- Parameters
-
edgevars edgevar data structure states state array nstates size of state array
Definition at line 1467 of file probdata_cyc.c.
References FALSE, NULL, and TRUE.
Referenced by SCIP_DECL_SEPAEXECLP().
◆ SCIPcycGetEdgeGraph()
SCIP_DIGRAPH* SCIPcycGetEdgeGraph | ( | SCIP * | scip | ) |
returns the edge-graph
Returns the edge-graph
- Parameters
-
scip SCIP data structure
Definition at line 1499 of file probdata_cyc.c.
References NULL, and SCIPgetProbData().
Referenced by SCIP_DECL_SEPAEXECLP().
◆ SCIPcycGetScale()
returns the number of scaling parameter
Returns the scaling parameter
- Parameters
-
scip SCIP data structure
Definition at line 1418 of file probdata_cyc.c.
References NULL, 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
-
scip SCIP data structure sol The solution containg the values
Definition at line 1519 of file probdata_cyc.c.
References NULL, phi(), SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_NORMAL, SCIPgetProbData(), SCIPgetSolVal(), and SCIPverbMessage().
◆ 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
-
scip SCIP data structure name problem name nbins number of bins ncluster number of cluster cmatrix The transition matrix
Definition at line 1274 of file probdata_cyc.c.
References createProbOnlyEdge(), createProbQP(), createProbSimplified(), createProbSimplifiedTest(), createVariables(), NULL, SCIP_CALL, SCIP_OKAY, 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
-
k the cluster ncluster the number of clusters
Definition at line 172 of file probdata_cyc.c.
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
-
k the cluster ncluster the number of clusters
Definition at line 184 of file probdata_cyc.c.
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
-
scip SCIP data structure sol the SCIP solution clustering the matrix with the clusterassignment nbins the number of bins ncluster the number of cluster
Definition at line 79 of file probdata_cyc.c.
References NULL, phi(), SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_MULTAGGR, SCIPcycGetBinvars(), SCIPcycGetEdgevars(), SCIPisEQ(), SCIPisGE(), SCIPisIntegral(), SCIPisLE(), SCIPsetSolVal(), SCIPvarGetLbGlobal(), SCIPvarGetStatus(), SCIPvarGetTransVar(), SCIPvarGetUbGlobal(), and SCIPvarIsTransformed().
Referenced by createSwitchSolution(), SCIP_DECL_HEUREXEC(), and SCIPcycAddIncompleteSol().
◆ isPartition()
check if the clustering has exactly one state in every cluster.
Check if the clustering has exactly one state in every cluster.
- Parameters
-
scip SCIP data structure solclustering matrix with the clustering nbins the number of bins ncluster the number of clusters
Definition at line 48 of file probdata_cyc.c.
References FALSE, SCIP_Real, SCIPisEQ(), SCIPisIntegral(), SCIPisZero(), and TRUE.
Referenced by createSwitchSolution(), runCyckerlin(), SCIP_DECL_HEUREXEC(), and switchNext().