Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SCIP 9.2.0
SCIP 8.1.0
SCIP 7.0.3
SCIP 6.0.2
SCIP 5.0.1
SCIP 4.0.1
SCIP 3.2.1
SCIP
Solving Constraint Integer Programs
examples
Binpacking
src
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-2017 Konrad-Zuse-Zentrum */
7
/* fuer Informationstechnik Berlin */
8
/* */
9
/* SCIP is distributed under the terms of the ZIB Academic License. */
10
/* */
11
/* You should have received a copy of the ZIB Academic License */
12
/* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13
/* */
14
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15
16
/**@file cons_samediff.h
17
* @brief Constraint handler stores the local branching decision data
18
* @author Timo Berthold
19
* @author Stefan Heinz
20
*
21
* This constraint handler is used to store the branching decision of the \ref BINPACKING_BRANCHING "Ryan/Foster branching rule"
22
* which is implemented in \ref branch_ryanfoster.c.
23
*
24
*/
25
26
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
27
28
#ifndef __SCIP_CONS_SAMEDIFF_H__
29
#define __SCIP_CONS_SAMEDIFF_H__
30
31
32
#include "
scip/scip.h
"
33
34
/* type of constraint: differ or same */
35
enum
ConsType
36
{
37
DIFFER
= 0,
/**< constraint representing the branching decision differ(i,j) */
38
SAME
= 1
/**< constraint representing the branching decision same(i,j) */
39
};
40
typedef
enum
ConsType
CONSTYPE
;
41
42
/** creates the handler for element constraints and includes it in SCIP */
43
extern
44
SCIP_RETCODE
SCIPincludeConshdlrSamediff
(
45
SCIP
*
scip
/**< SCIP data structure */
46
);
47
48
/** creates and captures a samediff constraint */
49
extern
50
SCIP_RETCODE
SCIPcreateConsSamediff
(
51
SCIP
*
scip
,
/**< SCIP data structure */
52
SCIP_CONS
** cons,
/**< pointer to hold the created constraint */
53
const
char
* name,
/**< name of constraint */
54
int
itemid1,
/**< item id one */
55
int
itemid2,
/**< item id two */
56
CONSTYPE
type,
/**< stores whether the items have to be in the SAME or DIFFER packing */
57
SCIP_NODE
* node,
/**< the node in the B&B-tree at which the cons is sticking */
58
SCIP_Bool
local
/**< is constraint only valid locally? */
59
);
60
61
/** returns item id one */
62
extern
63
int
SCIPgetItemid1Samediff
(
64
SCIP
*
scip
,
/**< SCIP data structure */
65
SCIP_CONS
* cons
/**< samediff constraint */
66
);
67
68
/** returns item id two */
69
extern
70
int
SCIPgetItemid2Samediff
(
71
SCIP
*
scip
,
/**< SCIP data structure */
72
SCIP_CONS
* cons
/**< samediff constraint */
73
);
74
75
/** return constraint type SAME or DIFFER */
76
extern
77
CONSTYPE
SCIPgetTypeSamediff
(
78
SCIP
*
scip
,
/**< SCIP data structure */
79
SCIP_CONS
* cons
/**< samediff constraint */
80
);
81
82
#endif
Scip
Definition:
struct_scip.h:58
CONSTYPE
CONSTYPE
Definition:
reader_osil.c:50
SCIP_RETCODE
enum SCIP_Retcode SCIP_RETCODE
Definition:
type_retcode.h:53
ConsType
ConsType
Definition:
cons_samediff.h:35
SCIP_Node
Definition:
struct_tree.h:130
SCIP_Cons
Definition:
struct_cons.h:37
SCIP_Bool
#define SCIP_Bool
Definition:
def.h:61
DIFFER
Definition:
cons_samediff.h:37
SCIPgetItemid2Samediff
int SCIPgetItemid2Samediff(SCIP *scip, SCIP_CONS *cons)
Definition:
cons_samediff.c:604
SAME
Definition:
cons_samediff.h:38
SCIPincludeConshdlrSamediff
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
Definition:
cons_samediff.c:526
SCIPgetTypeSamediff
CONSTYPE SCIPgetTypeSamediff(SCIP *scip, SCIP_CONS *cons)
Definition:
cons_samediff.c:620
scip
Definition:
objbranchrule.h:33
CONSTYPE
enum ConsType CONSTYPE
Definition:
cons_samediff.h:40
SCIPgetItemid1Samediff
int SCIPgetItemid1Samediff(SCIP *scip, SCIP_CONS *cons)
Definition:
cons_samediff.c:588
scip.h
SCIP callable library.
SCIPcreateConsSamediff
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)
Definition:
cons_samediff.c:552