Detailed Description
file reader for decompositions in the constraint based dec-file format.
This reader allows to read a file containing decompositions for constraints of the current original problem. The standard line ending for this format is '.dec'. The content of the file should obey the following format
\\ place for comments and statistics NBLOCKS 2 BLOCK 0 consA consB [...] BLOCK 1 consC consD [...] MASTERCONSS linkingcons
A block in a problem decomposition is a set of constraints that are independent from all other blocks after removing the special blocks of linking constraints denoted as MASTERCONSS.
Imagine the following example, which involves seven variables and the five constraints from the file above. The asterisks (*) indicate that the variable affects the feasibility of the constraint. In the special case of a linear optimization problem, the asterisks correspond to the nonzero entries of the constraint matrix.
x1 x2 x3 x4 x5 x6 x7 consA * * \ BLOCK 0 consB * * / consC * * \ BLOCK 1 consD * * / linkingconss * * * * * * * > MASTERCONSS
The nonzero pattern has been chosen in a way that after the removal of the last constraint 'linkingcons', the remaining problem consists of two independent parts, namely the blocks '0' and '1'.
The corresponding variable labels are inferred from the constraint labels. A variable is assigned the label
- of its unique block, if it only occurs in exactly 1 named block, and probably in MASTERCONSS.
- the special label of a linking variable if it occurs only in the master constraints or in 2 or even more named blocks.
- Note
- A trivial decomposition is to assign all constraints of a problem to the MASTERCONSS.
- The number of blocks is the number of named blocks: a trivial decomposition should have 0 blocks
Definition in file reader_dec.c.
#include "scip/pub_dcmp.h"
#include "scip/pub_fileio.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_reader.h"
#include "scip/pub_var.h"
#include "scip/reader_dec.h"
#include "scip/scip_dcmp.h"
#include "scip/scip_general.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_reader.h"
#include "scip/scip_solve.h"
#include "scip/scip_var.h"
#include "scip/scip_mem.h"
#include "scip/type_dcmp.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | READER_NAME "decreader" |
#define | READER_DESC "file reader for constraint decompositions" |
#define | READER_EXTENSION "dec" |
Typedefs | |
typedef enum Dec_Section | DEC_SECTION |
Enumerations | |
enum | Dec_Section { DEC_SECTION_INIT = 0, DEC_SECTION_NBLOCKS = 1, DEC_SECTION_BLOCK = 2, DEC_SECTION_MASTER = 3 } |
Functions | |
static SCIP_RETCODE | readDecomposition (SCIP *scip, const char *filename) |
static | SCIP_DECL_READERCOPY (readerCopyDec) |
static | SCIP_DECL_READERREAD (readerReadDec) |
SCIP_RETCODE | SCIPincludeReaderDec (SCIP *scip) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "decreader" |
Definition at line 96 of file reader_dec.c.
Referenced by SCIP_DECL_READERCOPY(), SCIP_DECL_READERREAD(), and SCIPincludeReaderDec().
◆ READER_DESC
#define READER_DESC "file reader for constraint decompositions" |
Definition at line 97 of file reader_dec.c.
Referenced by SCIPincludeReaderDec().
◆ READER_EXTENSION
#define READER_EXTENSION "dec" |
Definition at line 98 of file reader_dec.c.
Referenced by SCIPincludeReaderDec().
Typedef Documentation
◆ DEC_SECTION
typedef enum Dec_Section DEC_SECTION |
Definition at line 111 of file reader_dec.c.
Enumeration Type Documentation
◆ Dec_Section
enum Dec_Section |
Enumerator | |
---|---|
DEC_SECTION_INIT | initial section before the number of blocks is specified |
DEC_SECTION_NBLOCKS | section that contains the number of |
DEC_SECTION_BLOCK | |
DEC_SECTION_MASTER |
Definition at line 105 of file reader_dec.c.
Function Documentation
◆ readDecomposition()
|
static |
reads the given decomposition file
- Parameters
-
scip SCIP data structure filename name of the input file
Definition at line 115 of file reader_dec.c.
References DEC_SECTION_BLOCK, DEC_SECTION_INIT, DEC_SECTION_MASTER, DEC_SECTION_NBLOCKS, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_TERMINATE, SCIP_DECOMP_LINKCONS, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PROBLEM, SCIP_VERBLEVEL_NORMAL, SCIPaddDecomp(), SCIPallocBufferArray, SCIPcomputeDecompStats(), SCIPcomputeDecompVarsLabels(), SCIPcreateDecomp(), SCIPdebugMsg, SCIPdecompPrintStats(), SCIPdecompSetConsLabels(), SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfindCons(), SCIPfopen(), SCIPfreeBufferArray, SCIPgetBoolParam(), SCIPgetConss(), SCIPgetNConss(), SCIPgetStage(), SCIPprintSysError(), SCIPverbMessage(), SCIPwarningMessage(), and TRUE.
Referenced by SCIP_DECL_READERREAD().
◆ SCIP_DECL_READERCOPY()
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 342 of file reader_dec.c.
References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderDec(), and SCIPreaderGetName().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 356 of file reader_dec.c.
References NULL, readDecomposition(), READER_NAME, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PROBLEM, SCIP_SUCCESS, SCIPerrorMessage, SCIPgetStage(), and SCIPreaderGetName().