Scippy

SCIP

Solving Constraint Integer Programs

cons_samediff.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file cons_samediff.h
26  * @brief Constraint handler stores the local branching decision data
27  * @author Timo Berthold
28  * @author Stefan Heinz
29  *
30  * This constraint handler is used to store the branching decision of the \ref BINPACKING_BRANCHING "Ryan/Foster branching rule"
31  * which is implemented in \ref branch_ryanfoster.c.
32  *
33  */
34 
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36 
37 #ifndef __SCIP_CONS_SAMEDIFF_H__
38 #define __SCIP_CONS_SAMEDIFF_H__
39 
40 
41 #include "scip/scip.h"
42 
43 /* type of constraint: differ or same */
45 {
46  DIFFER = 0, /**< constraint representing the branching decision differ(i,j) */
47  SAME = 1 /**< constraint representing the branching decision same(i,j) */
48 };
49 typedef enum ConsType CONSTYPE;
50 
51 /** creates the handler for element constraints and includes it in SCIP */
53  SCIP* scip /**< SCIP data structure */
54  );
55 
56 /** creates and captures a samediff constraint */
58  SCIP* scip, /**< SCIP data structure */
59  SCIP_CONS** cons, /**< pointer to hold the created constraint */
60  const char* name, /**< name of constraint */
61  int itemid1, /**< item id one */
62  int itemid2, /**< item id two */
63  CONSTYPE type, /**< stores whether the items have to be in the SAME or DIFFER packing */
64  SCIP_NODE* node, /**< the node in the B&B-tree at which the cons is sticking */
65  SCIP_Bool local /**< is constraint only valid locally? */
66  );
67 
68 /** returns item id one */
70  SCIP* scip, /**< SCIP data structure */
71  SCIP_CONS* cons /**< samediff constraint */
72  );
73 
74 /** returns item id two */
76  SCIP* scip, /**< SCIP data structure */
77  SCIP_CONS* cons /**< samediff constraint */
78  );
79 
80 /** return constraint type SAME or DIFFER */
82  SCIP* scip, /**< SCIP data structure */
83  SCIP_CONS* cons /**< samediff constraint */
84  );
85 
86 #endif
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
ConsType
Definition: cons_samediff.h:44
#define SCIP_Bool
Definition: def.h:93
int SCIPgetItemid2Samediff(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
CONSTYPE SCIPgetTypeSamediff(SCIP *scip, SCIP_CONS *cons)
enum ConsType CONSTYPE
Definition: cons_samediff.h:49
int SCIPgetItemid1Samediff(SCIP *scip, SCIP_CONS *cons)
SCIP callable library.
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)