forked from sassoftware/cvrpsep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcnstrmgr.h
119 lines (108 loc) · 4.49 KB
/
cnstrmgr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* SAS modified this file. */
/* (C) Copyright 2003 Jens Lysgaard. All rights reserved. */
/* OSI Certified Open Source Software */
/* This software is licensed under the Common Public License Version 1.0 */
#ifndef _H_CNSTRMGR
#define _H_CNSTRMGR
/* Definition of constants for identification of constraint types. */
#define CMGR_CT_MIN_ROUTES 101
#define CMGR_CT_NODE_DEGREE 102 /* Degree = 2 for each customer. */
#define CMGR_CT_CAP 103 /* Capacity constraint. */
#define CMGR_CT_GENCAP 104 /* Generalized capacity constraint. */
#define CMGR_CT_FCI 104 /* For public version. */
#define CMGR_CT_TWOMATCHING 105
#define CMGR_CT_COMB 106
#define CMGR_CT_STR_COMB 107 /* Strengthened comb. */
#define CMGR_CT_HYPOTOUR 108
#define CMGR_CT_EXT_HYPOTOUR 109
#define CMGR_CT_MSTAR 110 /* Homogeneous multistar. */
#define CMGR_CT_WMSTAR 111 /* Weak multistar. */
#define CMGR_CT_DJCUT 112 /* Disjunctive cut. */
#define CMGR_CT_GOMORY 113 /* By variable numbers */
#define CMGR_CT_TWOEDGES_HYPOTOUR 114 /* 2EH inequality */
#define CMGR_BT_CLIQUE_DOWN 201 /* x(S:S) <= RHS */
#define CMGR_BT_CLIQUE_UP 202 /* x(S:S) >= RHS */
#define CMGR_BT_STAR_DOWN 301 /* x(i:F) <=RHS */
#define CMGR_BT_STAR_UP 302 /* x(i:F) >=RHS */
#define CMGR_CT_SLB 401 /* x(F) >= RHS. Simple lower bound */
typedef struct
{
int CType; /* Constraint Type. */
int Key;
int IntListSize;
int *IntList;
int ExtListSize;
int *ExtList;
int CListSize;
int *CList;
double *CoeffList;
int A,B,L; /* For MSTARs: Lambda=L/B, Sigma=A/B. */
double RHS;
int BranchLevel;
int GlobalNr;
} CnstrRecord;
typedef CnstrRecord *CnstrPointer;
typedef CnstrPointer *CnstrPointerList;
typedef struct
{
CnstrPointerList CPL;
int Dim; /* Vector is zero-based (0..Dim-1). */
int Size;
} CnstrMgrRecord;
typedef CnstrMgrRecord *CnstrMgrPointer;
void CMGR_CreateCMgr(CnstrMgrPointer *CMP, int Dim);
void CMGR_FreeMemCMgr(CnstrMgrPointer *CMP);
void CMGR_AddCnstr(CnstrMgrPointer CMP,
int CType, int Key, int IntListSize, int *IntList,
double RHS);
void CMGR_AddBranchCnstr(CnstrMgrPointer CMP,
int CType, int Key, int IntListSize, int *IntList,
double RHS,
int BranchLevel);
void CMGR_AddExtCnstr(CnstrMgrPointer CMP,
int CType, int Key, int IntListSize, int *IntList,
int ExtListSize, int *ExtList,
double RHS);
void CMGR_AddExplicitCnstr(CnstrMgrPointer CMP,
int CType, int Key,
int ListSize,
int *IntList,
int *ExtList,
double *CoeffList,
double RHS);
void CMGR_AddGomoryCnstr(CnstrMgrPointer CMP,
int CType, int Key,
int ListSize,
int *IntList, /* Variable numbers */
double *CoeffList,
double RHS); /* >= RHS */
void CMGR_AppendCMP(CnstrMgrPointer Sink,
CnstrMgrPointer Source);
void CMGR_SearchCap(CnstrMgrPointer CMP,
int IntListSize, int *IntList,
char *CapExists);
void CMGR_AddMStar(CnstrMgrPointer CMP,
int CType, int Key, int IntListSize, int *IntList,
int ExtListSize, int *ExtList,
int A, int B, int L);
void CMGR_AddPartialMStar(CnstrMgrPointer CMP,
int CType, int Key,
int IntListSize, int *IntList,
int ExtListSize, int *ExtList,
int CListSize, int *CList,
int A, int B, int L);
void CMGR_MoveCnstr(CnstrMgrPointer SourcePtr,
CnstrMgrPointer SinkPtr,
int SourceIndex,
int SinkIndex);
void CMGR_ClearCnstr(CnstrMgrPointer SourcePtr,
int Index);
void CMGR_CompressCMP(CnstrMgrPointer CMP);
void CMGR_ChgRHS(CnstrMgrPointer CMP, int CnstrNr, double NewRHS);
void CMGR_SaveCMP(FILE *f, CnstrMgrPointer CMP,
char MatchType,
int CnstrType,
char WriteLabel,
int Label);
void CMGR_WriteCMP(CnstrMgrPointer CMP, int MinCNr);
#endif