scip-sys 0.1.21

Bindings for the C SCIP solver.
Documentation
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*                                                                           */
/*                  This file is part of the program                         */
/*          GCG --- Generic Column Generation                                */
/*                  a Dantzig-Wolfe decomposition based extension            */
/*                  of the branch-cut-and-price framework                    */
/*         SCIP --- Solving Constraint Integer Programs                      */
/*                                                                           */
/* Copyright (C) 2010-2022 Operations Research, RWTH Aachen University       */
/*                         Zuse Institute Berlin (ZIB)                       */
/*                                                                           */
/* This program is free software; you can redistribute it and/or             */
/* modify it under the terms of the GNU Lesser General Public License        */
/* as published by the Free Software Foundation; either version 3            */
/* of the License, or (at your option) any later version.                    */
/*                                                                           */
/* This program is distributed in the hope that it will be useful,           */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
/* GNU Lesser General Public License for more details.                       */
/*                                                                           */
/* You should have received a copy of the GNU Lesser General Public License  */
/* along with this program; if not, write to the Free Software               */
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/**@file   class_partialdecomp.h
 * @brief  class storing (potentially incomplete) decompositions
 * @note   formerly called "Seeed"
 * @author Michael Bastubbe
 * @author Hannah Hechenrieder
 * @author Hanna Franzen
 */

/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/

#ifndef GCG_CLASS_PARTIALDECOMP_H__
#define GCG_CLASS_PARTIALDECOMP_H__

#include "objscip/objscip.h"
#include "struct_detector.h"

#include <vector>
#include <string>

#include "class_conspartition.h"
#include "class_varpartition.h"
#include "graph/graph_gcg.h"
#include "graph/graph.h"
#include "type_scoretype.h"

#include "reader_gp.h"

namespace gcg {


/**
 * @brief enumeration to display if a decomposition was given by the user and if so, how it was processed after adding
 */
enum USERGIVEN
{
   NOT = 0,                            /**< this partialdec was not given by the user */
   PARTIAL = - 1,                      /**< this partial partialdec was given by the user as it is*/
   COMPLETE = - 2,                     /**< this complete partialdec was given by the user as it is*/
   COMPLETED_CONSTOMASTER = - 3        /**< this partialdec was partially given by the user and then completed by setting all missing constraints to the master*/
};

class DETPROBDATA;


/*!
 * @brief class to manage partial decompositions
 *
 * each partialdec corresponds to one detprobdata which contains the problem information,
 * there is one detprobdata for the original and the transformed problem.
 */
class PARTIALDECOMP
{
private:
   SCIP* scip;                                                 /**< SCIP data structure */
   int id;                                                     /**< unique id of the partialdec, unique */
   int nblocks;                                                /**< number of blocks the partial decomposition currently has */
   int nvars;                                                  /**< number of variables */
   int nconss;                                                 /**< number of constraints */
   std::vector<int> masterconss;                               /**< vector containing indices of master constraints */
   std::vector<int> mastervars;                                /**< vector containing indices of master variables (these variables are supposed to have all nonzero entries in master constraints) */
   std::vector<std::vector<int>> conssforblocks;               /**< conssforblocks[k] contains a vector of indices of all
                                                                 *< constraints assigned to block k */
   std::vector<std::vector<int>> varsforblocks;                /**< varsforblocks[k] contains a vector of indices of all
                                                                 *< variables assigned to block k */
   std::vector<int> linkingvars;                               /**< vector containing indices of linking variables */
   std::vector<std::vector<int>> stairlinkingvars;             /**< vector containing indices of staircase linking variables
                                                                 *< of the blocks (stair-linking variables are registered only
                                                                 *< in their first block) */
   std::vector<int> openvars;                                  /**< vector containing indices of variables that are not
                                                                 *< assigned yet*/
   std::vector<int> openconss;                                 /**< vector containing indices of constraints that are not
                                                                 *< assigned yet*/
   std::vector<bool> isvaropen;                                /**< whether ith variable is still open */
   std::vector<bool> isconsopen;                               /**< whether ith constraint is still open */
   std::vector<bool> isvarmaster;                              /**< whether ith variable is assigned to be a only-master variable */
   std::vector<bool> isconsmaster;                             /**< whether ith constraint is assigned to be a master constraint */

   std::vector<int>  ncoeffsforblock;                          /**< number of coeffs per block */

   SCIP_Bool         calculatedncoeffsforblock;                /**< is the number of coeff per block already calculated*/
   int               ncoeffsformaster;                         /**< number of master coefficients */
   std::vector<std::vector<int>> ncoeffsforblockformastercons; /**< number of coeffs a block has in a certain master constraint */

   bool varsforblocksorted;                                    /**< bool to store if the varsforblocks datastructure is sorted atm */
   bool stairlinkingvarsforblocksorted;                        /**< bool to store if the stairlinkingvarsforblock datastructure is sorted atm */
   bool conssforblocksorted;                                   /**< bool to store if the conssforblock datastructure is sorted atm */
   bool linkingvarssorted;                                     /**< bool to store if the linkingvars datastructure is sorted atm */
   bool mastervarssorted;                                      /**< bool to store if the mastervars datastructure is sorted atm */
   bool masterconsssorted;                                     /**< bool to store if the masterconsssorted datastructure is sorted atm */

   unsigned long hashvalue;                                    /**< hash value of this partial decomposition, decompositions with same has value are considered to be identical */
   bool hvoutdated;                                            /**< true if the internal structure changed such that the hash value needs to be recalculated */

   bool isselected;                                            /**< is this partialdec selected */

   bool isagginfoalreadytoexpensive;                            /**< is agginfo already known to be to expensive to calculate*/

   const static int primes[];                                   /**< an array of prime numbers to calculate the hash value */
   const static int nprimes;                                    /**< size of the array of prime numbers */

   bool isfinishedbyfinisher;                                   /**< was this partialdec finished by the finishpartialdec() method of a detector */

   /* aggregation information */
   int                  nrepblocks;                                    /**< number of block representatives */
   std::vector<std::vector<int>> reptoblocks;                          /**< translation of the block representatives to (old) blocks */
   std::vector<int>     blockstorep;                                   /**< translation of the (old) blocks to the block representatives */
   std::vector<std::vector<std::vector<int> > > pidtopidvarmaptofirst; /**< [nrepblocks][blockstorep[k].size()][nvarsforprob] collection of varmaps of probindices from k-th subproblem to the zeroth block that is represented */

   /* statistic information */
   std::vector<DEC_DETECTOR*> detectorchain;          /**< vector containing detectors that worked on that partialdec */
   std::vector<std::string> detectorchaininfo;        /**< vector containing information about the detector call */
   std::vector<SCIP_Real> detectorclocktimes;         /**< vector containing detector times in seconds  */
   std::vector<SCIP_Real> pctvarstoborder;            /**< vector containing the fraction of variables assigned to the
                                                        *< border for each detector working on that partialdec*/
   std::vector<SCIP_Real> pctvarstoblock;             /**< vector containing the fraction of variables assigned to a block
                                                        *< for each detector working on that partialdec*/
   std::vector<SCIP_Real> pctvarsfromfree;            /**< vector containing the fraction of variables that are not longer
                                                        *< open for each detector working on that partialdec*/
   std::vector<SCIP_Real> pctconsstoborder;           /**< vector containing the fraction of constraints assigned to the
                                                        *< border for each detector working on that partialdec*/
   std::vector<SCIP_Real> pctconsstoblock;            /**< vector containing the fraction of constraints assigned to a block
                                                        *< for each detector working on that partialdec*/
   std::vector<SCIP_Real> pctconssfromfree;           /**< vector containing the fraction of constraints that are not longer
                                                         *< open for each detector working on that partialdec*/
   std::vector<int> nnewblocks;                       /**< vector containing information how many new blocks a detector has assigned */

   std::vector<IndexPartition*> usedpartition;      /**< vector containing pointer to the cons- or varpartitions
                                                         *< a detector made use of for each detector working on that partialdec
                                                         *< (NULL if no partition was used) */
   std::vector<std::vector<int>> classestomaster;     /**< vector containing the vector of classindices that were assigned
                                                         *< to master by the partition used by a detector
                                                         *< (empty vector if no partition was used) */
   std::vector<std::vector<int>> classestolinking;    /**< vector containing the vector of classindices that were assigned
                                                         *< to linking by the partition used by a detector
                                                         *< (empty vector if no partition was used) */

   std::vector<int> listofancestorids;                /**< vector containing decomposition indices that are ancestors of this partialdec */

   USERGIVEN usergiven;                               /**< is this partialdec partially or completely given by user */

   /* score values (or -1 iff nott computed yet) */

   SCIP_Real maxwhitescore;                           /**< score corresponding to the max white measure */
   SCIP_Real borderareascore;                         /**< 1 - fraction of border area to complete area */
   SCIP_Real classicscore;                            /**< classic score to evaluate the partial */
   SCIP_Real maxforeseeingwhitescore;                 /**< maximum foreseeing white area score (i.e. maximize fraction of white area score considering problem with copied linking variables and corresponding master constraints; white area is nonblock and nonborder area, stairlinking variables count as linking) */
   SCIP_Real setpartfwhitescore;                      /**< setpartitioning maximum foreseeing white area score (i.e. convex combination of maximum foreseeing white area score and a boolean score rewarding a master containing only setppc and cardinality constraints )*/
   SCIP_Real maxforeseeingwhitescoreagg;              /**< maximum foreseeing white area score with respect to aggregatable blocks (i.e. maximize fraction of white area score considering problem with copied linking variables and corresponding master constraints; white area is nonblock and nonborder area, stairlinking variables count as linking) */
   SCIP_Real setpartfwhitescoreagg;                   /**< setpartitioning maximum foreseeing white area score with respect to aggregateable (i.e. convex combination of maximum foreseeing white area score and a boolean score rewarding a master containing only setppc and cardinality constraints )*/
   SCIP_Real bendersscore;                            /**< score to evaluate the partialdecs */
   SCIP_Real strongdecompositionscore;                /**< strong decomposition score  */

   /* datastructure to store information if this partialdec stems from a partialdec concerning the orig problem */
   bool stemsfromorig;                    /**< partialdec has at least one ancestor that is a partialdec from orig problem */
   bool original;                        /**< indicates whether partialdec is from original problem */
   bool isfinishedbyfinisherorig;         /**< was the ancestor partialdec for the unpresolved problem finished by the
                                            *< finishpartialdec() method of a detector */
   DEC_DETECTOR* finishedorigby;          /**< index of finishing detector of orig ancestor partialdec */

   int translatedpartialdecid;

private:
   /**< id of the translated partialdec */

   /**
    *
    * @brief simple bliss automorphism check for blocks
    *
    * Checks blocks for equality by graph automorphism check, done by bliss
    * @note equality is only found if variables are in correct order
    */
   void checkIdenticalBlocksBliss(
      int                  b1,         /**< block id of first block */
      int                  b2,         /**< block id of second block */
      std::vector<int>&    varmap,     /**< maps variable indices (corresponding to  detprobdata indices) of block 2 to block 1 */
      SCIP_HASHMAP*        varmap2,    /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
      SCIP_Bool*           identical,  /**< pointer to store if the subproblems are identical  */
      unsigned int         searchnodelimit,    /**< bliss search node limit (requires patched bliss version) */
      unsigned int         generatorlimit      /**< bliss generator limit (requires patched bliss version) */

   );


   /**
    * @brief brute force equality check for blocks
    *
    * Checks blocks for equality by brute force
    * @note equality is only found if variables are in correct order
    */
   void checkIdenticalBlocksBrute(
      int                  b1,         /**< block id of first block */
      int                  b2,         /**< block id of second block */
      std::vector<int>&    varmap,     /**< maps variable indices (corresponding to  detprobdata indices) of prob2 to prob1 */
      SCIP_HASHMAP*        varmap2,    /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
      SCIP_Bool*           identical   /**< pointer to store if the subproblems are identical  */
      );


   /**
    * @brief plausibility check whether two blocks could be identical
    *
    * Check some necessary conditions for two blocks to be identical
    */
   void checkIdenticalBlocksTrivial(
      int                  b1,                     /**< block id of first block */
      int                  b2,                     /**< block id of second block */
      SCIP_Bool*           notidentical            /**< pointer to store whether or not the non-equality is proven */
      );

public:

   /**
    * @brief Standard constructor, creates empty partialdec with unique id
    * @note initially, all conss and vars are open
    */
   PARTIALDECOMP(
      SCIP* scip,                                  /**< scip data structure */
      bool originalProblem                             /**< true iff partialdec is for presolved problem (else for original problem) */
      );

   /**
    * @brief copy constructor
    */
   PARTIALDECOMP(
      const PARTIALDECOMP *partialdecToCopy /**< partialdec to be copied */
      );

   /**
    * Standard destructor
    */
   ~PARTIALDECOMP();

    /**
     * @brief adds a block
     * @returns the number (id) of the new block
     * */
   int addBlock();

   /**
    * @brief adds detection time of one detector
    *
    * incorporates the needed time of some detector in the detector chain
    */
   void addClockTime(
      SCIP_Real clocktime /**< time to be added */
      );

   /**
    * @brief adds the statistical differences to an ancestor
    *
    * incorporates the changes from ancestor partialdec into the statistical data structures
    */
   void addDecChangesFromAncestor(
      PARTIALDECOMP* ancestor    /**< partialdec whose propagation yielded to the current partialdec */
      );

   /**
    * @brief add information about the detector chain
    *
    * adds a detectorchain information string to the corresponding vector
    * (that carries information for each detector call)
    * */
   void addDetectorChainInfo(
      const char* decinfo              /**< information string (about the detector call) to add  */
      );

   /**
    * @brief adds how many new blocks were introduced
    *
    * bookkeeping information: adds number of new blocks created by a detector added to detector chain
    */
   void addNNewBlocks(
      int nnewblocks                   /**< number of new added blocks by latest detector call */
      );

   /**
    * @brief adds percentage of closed constraints
    *
    * bookkeeping information: fraction of constraints that are not longer open for a detector added to detector chain
    */
   void addPctConssFromFree(
      SCIP_Real pct                    /**< fraction of constraints that are not longer open */
      );

   /**
    * @brief adds percentage of constraints assigned to blocks
    *
    * bookkeeping information: adds fraction of constraints assigned to a block for a detector added to detector chain
    *  */
   void addPctConssToBlock(
      SCIP_Real pct                    /**< fraction of constraints assigned to a block */
      );

   /**
    * @brief adds percentage of constraints assigned to border
    *
    * bookkeeping information: adds fraction of constraints assigned to the border for a detector added to detector chain
    */
   void addPctConssToBorder(
      SCIP_Real pct                    /**< fraction constraints assigned to the border */
      );

   /**
    *  @brief adds percentage of closed variables
    *
    *  bookkeeping information: adds fraction of variables that are not longer open for a detector added to detector chain
    */
   void addPctVarsFromFree(
      SCIP_Real pct                    /**< fraction of variables that are not longer open */
      );


   /**
    *  @brief adds percentage of variables assigned to blocks
    *
    *  bookkeeping information: adds fraction of variables assigned to a block for a detector added to detector chain
    *  */
   void addPctVarsToBlock(
      SCIP_Real pct                     /**< fraction of variables assigned to a block */
      );

   /**
    * @brief adds percentage of variables assigned to border
    *
    * bookkeeping information: adds fraction of variables assigned to the border for a detector added to detector chain
    */
   void addPctVarsToBorder(
      SCIP_Real pct                    /**< fraction of variables assigned to the border */
      );

   /**
    * @brief method to check if at least one constraint is assigned to some block
    * @returns true iff at least one constraint is assigned to a block
    *  */
   bool alreadyAssignedConssToBlocks();

   /**
    * @brief assigns open conss to master
    *
    * assigns open constraints to master according to the cons assignment information given in constoblock hashmap
    * @returns scip return code
    * @note for conss assigned to blocks according to constoblock there is no assignment \see assignPartialdecFromConstoblock
    * @note master assignment is indicated by assigning cons to index additionalNBlocks
    * */
   SCIP_RETCODE assignBorderFromConstoblock(
      SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
      int givenNBlocks           /**< number of blocks the hashmap contains */
       );

   /**
    * @brief assigns open vars to stairlinking if appropriate
    *
    * assigns open vars to stairlinking if they can be found in exactly two consecutive blocks
    * @returns true iff at least one stairlinkingvar was assigned
    */
   bool assignCurrentStairlinking(
      );

   /**
    * @brief assigns open conss to master
    */
   void assignOpenConssToMaster(
      );

   /**
    * @brief assigns conss structure according to given hashmap
    *
    *  adds blocks and assigns open conss to a new block or to master
    *  according to the cons assignment information given in constoblock hashmap
    *  @returns scip return code
    *  \see assignPartialdecFromConstoblockVector()
    *  @note master assignment is indicated by assigning cons to index additionalNBlocks
    *  */
   SCIP_RETCODE assignPartialdecFromConstoblock(
      SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
      int additionalNBlocks      /**< number of (additional) blocks the hashmap contains */
       );

   /*!
    * @brief assigns conss structure according to given vector
    *
    *  adds blocks and assigns open conss to a new block or to master
    *  according to the cons assignment information given in constoblock vector
    *  @returns scip return code
    *  \see  assignPartialdecFromConstoblock()
    *  @note master is indicated by assigning cons to index additionalNBlocks */
   SCIP_RETCODE assignPartialdecFromConstoblockVector(
      std::vector<int> constoblock, /**< vector containing an assignment of conss to a block or to master */
      int additionalNBlocks         /**< number of (additional) blocks the vector contains */
      );

   /**
    * @brief computes components by connectedness of conss and vars
    *
    * computes components corresponding to connectedness of conss and vars
    * and assigns them accordingly (all but one of largest components)
    *
    * strategy: assigns all conss same block if they are connected
    * two constraints are adjacent if there is a common variable
    *
    * @note this relies on the consadjacency structure of the detprobdata
    *  hence it cannot be applied in presence of linking variables
    */
   void assignSmallestComponentsButOneConssAdjacency(
      );

   /**
    * @brief reassigns linking vars to stairlinkingvars if possible
    *
    *  potentially reorders blocks for making a maximum number of linking vars stairlinking
    *  if all vars that connect exactly two blocks have a staircase structure, all of them become stairlinkingvars
    *  otherwise, the stairlinking assignment is done greedily
    *  @note precondition: partialdec does not have any stairlinking vars
    */
   void calcStairlinkingVars(
        );

   /**
    * @brief checks if all conss are assigned
    *
    * returns true iff all constraints are assigned and deletes the vector open conss if so
    * @return true iff all constraints are assigned
    * */
   bool checkAllConssAssigned();

   /**
    * @brief Checks whether the assignments in the partialdec are consistent
    *
    * The following checks are performed:
    * - check if nblocks is set appropriately
    * - check for empty (row- and col-wise) blocks
    * - every variable is assigned at most once
    * - check if all not assigned variables are open vars
    * - check if all open vars are not assigned
    * - every constraint is assigned at most once
    * - check if all not assigned constraints are open cons
    * - check if all open conss are not assigned
    * - check if the data structures are sorted
    * - check if variables hitting a cons are either in the cons's block or border or still open
    * @returns true iff the partialdec seems to be consistent
    * */
   bool checkConsistency(
      );

   /**
    * @brief assigns all open constraints and open variables trivially
    *
    *  strategy: assigns all open conss and vars to blocks if they can be refined there, otherwise to the master
    *
    *  @note partialdecomps should usually be completed by a detector, only use this function if you know what you are doing.
    */
   void complete(
      );

   /**
    * @brief assigns all open constraints and open variables
    *
    *  strategy: assigns all conss and vars to the same block if they are connected,
    *  a cons and a var are adjacent if the var appears in the cons
    */
   void completeByConnected(
      );

   /**
    * @brief assigns all open constraints and open variables
    *
    *  strategy: assigns all conss and vars to the same block if they are connected
    *  a cons and a var are adjacent if the var appears in the cons
    *  \note this relies on the consadjacency structure of the detprobdata
    *  hence it cannot be applied in presence of linking variables
    */
   void completeByConnectedConssAdjacency(
      );

   /**
    * @brief assigns all open constraints and open variables
    *
    *  strategy: assigns a cons (and related vars) to a new block if possible,
    *  if not to an existing block if possible (by means of prior var assignments)
    *  and finally to master, if there does not exist such a block
    */
   void completeGreedily(
      );

   /** @brief removes the given cons from master
    */
   void removeMastercons(
      int consid      /**< id of cons */
      );

   /**
    * @brief: assigns every open cons/var
    *
    * Assignments happen as follows:
    *  - to the respective block if it hits exactly one blockvar/blockcons and no open vars/conss
    *  - to master/linking if it hits blockvars/blockconss assigned to different blocks
    *  - and every cons to master that hits a master var
    *  - and every var to master if it does not hit any blockcons and has no open cons
    *  - leave the cons/variableopen if nothing from the above holds
    *  */
   void considerImplicits(
      );

   /**
    * @brief copies the given partialdec's partition statistics
    *
    * @param otherpartialdec partialdec whose partition statistics are to be copied
    */
   void copyPartitionStatistics(
      const PARTIALDECOMP* otherpartialdec
      );

   /**
    * @brief deletes empty blocks and sets nblocks accordingly
    *
    *  A block is considered to be empty if no constraint is assigned to it,
    *  variables in blocks with no constraints become open
    *
    * @param variables if true, then blocks with no constraints but at least one variable are considered to be nonempty
    */
   void deleteEmptyBlocks(
      bool variables
   );

   /**
    * @brief deletes a cons from list of open conss
    *
    * @param opencons id of the cons that is not considered open anymore
    */
   void deleteOpencons(
      int opencons
      );

   /**
    * @brief deletes a cons from list of open conss
    *
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openconss
    */
   std::vector<int>::const_iterator deleteOpencons(
      std::vector<int>::const_iterator itr
   );

   /**
    * @brief deletes a var from the list of open vars
    *
    * @param openvar id of the var that is not considered open anymore
    */
   void deleteOpenvar(
      int openvar
      );

   /**
    * @brief deletes a var from the list of open vars
    *
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openvars
    */
   std::vector<int>::const_iterator deleteOpenvar(
      std::vector<int>::const_iterator itr
   );

   /**
    * @brief displays the relevant information of the partialdec
    *
    * @param detailLevel pass a value that indicates how detailed the output should be:
    *                         0: brief overview
    *                         1: block and detector info
    *                         2: cons and var assignments
    */
   void displayInfo(
      int detailLevel
      );

   /**
    * @brief every constraint is either assigned to master or open
    *
    *  Assignment happens according to the cons assignment information given in constoblock hashmap,
    *  variables are set accordingly
    * @note precondition: no constraint or variable is already assigned to a block
    * @return scip return code
    */
   SCIP_RETCODE filloutBorderFromConstoblock(
      SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
                                   *< (master assignment is indicated by assigning cons to index additionalNBlocks) */
      int givenNBlocks          /**< number of blocks the hashmap contains */
      );

   /**
    * @brief assigns all conss to master or a block
    *
    *  Assignment happens according to the cons assignment information given in constoblock hashmap
    *
    * @return scip return code
    *  calculates implicit variable assignment through cons assignment
    * @note precondition: no cons or var is already assigned to a block and constoblock contains information for every cons */

   SCIP_RETCODE filloutPartialdecFromConstoblock(
      SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
                                   *< (master assignment is indicated by assigning cons to index additionalNBlocks) */
      int givenNBlocks          /**< number of blocks the hashmap contains */
      );

   /**
    * @brief reassigns linking variables to master if appropriate
    *
    * Variables are reassigned as master if the variable only hits master conss
    */
   void findVarsLinkingToMaster(
      );

   /**
    * @brief reassigns variables classified as linking to stairlinking if appropriate
    *
    * Variables are reassigned as master if the variable hits conss in exactly two consecutive
    * blocks
    */
   void findVarsLinkingToStairlinking(
      );

   /**
    * @brief gets partialdec id of given ancestor id
    * @return partialdec id of given ancestor id
    */
   int getAncestorID(
      int ancestorindex /**< index of ancestor in list of ancestor ids data structure */
      );

   /**
    * @brief get ancestor ids as vector
    * @return vector of ids of all ancestors id
    */
   std::vector<int>& getAncestorList(
      );

   /**
    * set ancestor list directly
    * @param newlist new list of ancestor ids
    */
   void setAncestorList(
      std::vector<int>& newlist
      );

   /** removes ancestor id from list */
   void removeAncestorID(
      int ancestorid    /**< id to remove */
   );

   /**
    * adds ancestor id to back of list
    * @param ancestor id of ancestor that is to be added
    */
   void addAncestorID(
      int ancestor
      );

   /**
    * @brief get a vector of block ids that are identical to block with id repid
    * @param repid id of the representative block
    * @return vector of block ids that are identical to block with id repid
    */
   const std::vector<int> & getBlocksForRep(
      int  repid
      );

   /**
    * @brief returns the time that the detector related to the given detectorchainindex needed for detecting
    * @return the clock time for the corresponding detector in the chain
    */
   SCIP_Real getDetectorClockTime(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief returns a vector of the clock times that each detector needed that was involved in this partialdec
    * @return vector of the clock times
    */
   std::vector<SCIP_Real>& getDetectorClockTimes();

   /**
    * @brief returns array containing constraints assigned to a block
    * @param block id of the block the constraint indices are returned
    * @return array containing constraints assigned to a block
    */
   std::vector<int>& getConssForBlock(
      int block
      );

   /**
    * @brief returns detector chain as vector of detector pointers
    * @return detector chain as array of detector pointers
    */
   std::vector<DEC_DETECTOR*>& getDetectorchain();

   /**
    * @brief returns true iff this partialdec was finished by finishPartialdec() method of a detector
    * @return true iff this partialdec was finished by finishPartialdec() method of a detector
    */
   bool getFinishedByFinisher();

   /**
    * @brief returns the calculated hash value of this partialdec
    * @return the calculated hash value of this partialdec
    */
   unsigned long getHashValue();

   /**
    * @brief returns the unique id of the partialdec
    * @return the unique id of the partialdec
    */
   int getID();

   /**
    * @brief returns array containing all linking vars indices
    * @return vector containing all linking vars indices
    * @note when accessed it is supposed to be sorted
    */
   std::vector<int>& getLinkingvars();

   /**
    * @brief Gets array containing all master conss indices
    * @return array containing all master conss indices
    * @note when accessed it is supposed to be sorted
    */
   std::vector<int>& getMasterconss();

   /**
    * @brief Gets array containing all master vars indices
    *
    * master vars hit only constraints in the master, aka static variables
    * @return array containing all master vars indices
    */
   std::vector<int>& getMastervars();

   /**
    * @brief Gets the number of nonzero coeffs in a certain block
    * @param blockid of the block the number of nozerors are requested for
    * @return number of nonzero coeffs in a certain block
    */
   int getNCoeffsForBlock(
      int blockid
      );

   /**
    * Gets the number of nonzero coeffs in master
    * @return the number of nonzero coeffs in master
    */
   int getNCoeffsForMaster(
      );

   /**
    * @brief returns the score of the partialdec (depending on used scoretype)
    * @param type the scoretype
    * @return the score
    * @see enum scoretype in cons_decomp.h
    */
   SCIP_Real getScore(
      SCORETYPE type
      );

   /**
    * @brief checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
    * @return TRUE iff all master constraints set partitioning, set packing, set cover, or cardinality constraints
    */
   SCIP_Bool hasSetppccardMaster(
   );

   /**
    * @brief checks iff all master constraints set partitioning, set packing, or set cover constraints
    * @return TRUE iff all master constraints set partitioning, set packing, or set cover
    */
   SCIP_Bool hasSetppcMaster(
   );

   /**
    * @brief checks iff all master constraints set partitioning, or set packing constraints
    * @return TRUE iff all master constraints set partitioning, or set packing constraints
    */
   SCIP_Bool hasSetppMaster(
   );

   /**
    * @brief Gets the USERGIVEN status of this partialdecs
    * @return the USERGIVEN status of this partialdecs
    * @see enum USERGIVEN
    */
   USERGIVEN getUsergiven();

   /**
    * @brief Gets number of ancestor partialdecs
    * @return number of ancestor partialdecs
    */
   int getNAncestors();

   /**
    * @brief Gets the number of blocks
    * @return number of blocks
    */
   int getNBlocks();

   /**
    * @brief Gets the number of constraints
    * @return number of constraints
    */
   int getNConss();

   /**
    * @brief Gets size of the vector containing conss assigned to a block
    * @param block id of the block the number of constraints is asked for
    * @return size of the vector containing conss assigned to a block
    */
   int getNConssForBlock(
      int block
      );

   /**
    * @brief Gets the detectorchain info vector
    * @return detectorchain info vector
    */
   std::vector<std::string>& getDetectorchainInfo();

   /**
    * @brief Gets the number of detectors the partialdec is propagated by
    * @return number of detectors the partialdec is propagated by
    */
   int getNDetectors();

   /**
    * @brief Gets size of the vector containing linking vars
    * @return size of the vector containing linking vars
    */
   int getNLinkingvars();

   /**
    * @brief Gets size of the vector containing master conss
    * @returns size of the vector containing master conss
    */
   int getNMasterconss();

   /**
    * @brief Gets size of the vector containing master vars
    *
    * master vars hit only constraints in the master
    * @return size of the vector containing master vars
    */
   int getNMastervars();

   /**
    * @brief Gets number of blocks a detector added
    *
    * @return number of blocks a detector added
    */
   int getNNewBlocks(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief gets number of blocks the detectors in the detectorchain added
    * @return number of blocks the detectors in the detectorchain added
    */
   std::vector<int> getNNewBlocksVector();

   /**
    * @brief Gets total number of stairlinking vars
    * @return total number of stairlinking vars
    */
   int getNTotalStairlinkingvars();

   /**
    * @brief Gets size of vector containing constraints not assigned yet
    * @return returns size of vector containing constraints not assigned yet
    */
   int getNOpenconss();

   /**
    * @brief Gets size of vector containing variables not assigned yet
    * @return size of vector containing variables not assigned yet
    */
   int getNOpenvars();

   /**
    * @brief Gets the number of blockrepresentatives
    * @return the number of blockrepresentatives
    */
   int getNReps();

   /**
    * @brief Gets size of the vector containing stairlinking vars
    * @param block id of the block the size of the stairlinking vector is asked for
    * @return size of the vector containing stairlinking vars
    */
   int getNStairlinkingvars(
      int block
      );

   /**
    * @brief Gets number of vars
    * @return number of vars
    */
   int getNVars();

   /**
    * @brief Gets size of the vector containing vars assigned to a block
    * @param block id of the block the number of variables is asked for
    * @return size of the vector containing vars assigned to a block
    */
   int getNVarsForBlock(
      int block
      );

   /**
    * @brief Gets overall number of vars assigned to a block
    * @return number of vars that are assigned to any block
    */
   int getNVarsForBlocks(
      );

   /**
    * @brief Gets array containing constraints not assigned yet
    * @return array containing constraints not assigned yet
    */
   const int* getOpenconss();

   /**
    * @brief Gets a vector containing constraint ids not assigned yet as vector
    * @return returns a vector containing constraint ids not assigned yet as vector
    */
   std::vector<int>& getOpenconssVec();

   /**
    * @brief Gets array containing variables not assigned yet
    * @return returns array containing variables not assigned yet
    */
   const int* getOpenvars();

   /**
    * Gets array containing variables not assigned yet as vector
    * @return array containing variables not assigned yet as vector
    */
   std::vector<int>& getOpenvarsVec();

   /**
    * @brief Gets fraction of variables assigned to the border for a detector
    *
    * @return fraction of variables assigned to the border for a detector
    */
   SCIP_Real getPctVarsToBorder(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief Gets fraction of variables assigned to the border for detectors in detectorchain
    * @return vector of fractions of variables assigned to the border for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctVarsToBorderVector();

   /**
    * @brief Gets fraction of variables assigned to a block for a detector
    *
    * @return fraction of variables assigned to a block for a detector
    */
   SCIP_Real getPctVarsToBlock(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief returns fraction of variables assigned to a block for detectors in detectorchain
    * @return vector of fractions of variables assigned to a block for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctVarsToBlockVector();

   /**
    * @brief Gets fraction of variables that are not longer open for a detector
    *
    * @return index of the detector in the detectorchain
    */
   SCIP_Real getPctVarsFromFree(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief Gets fraction of variables that are not longer open for detectors in detectorchain
    * @return vector or fractions of variables that are not longer open for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctVarsFromFreeVector();

   /**
    * @brief Gets fraction of constraints assigned to the border for a detector
    * @return returns fraction of constraints assigned to the border for a detector
    */
   /**  */
   SCIP_Real getPctConssToBorder(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief Gets fraction of constraints assigned to the border for detectors in detectorchain
    * @return vector of fractions of constraints assigned to the border for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctConssToBorderVector();

   /**
    * @brief Gets fraction of constraints assigned to a block for a detector
    * @return fraction of constraints assigned to a block for a detector
    */
   SCIP_Real getPctConssToBlock(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief Gets fraction of constraints assigned to a block for detectors in detectorchain
    * @return vector of fractions of constraints assigned to a block for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctConssToBlockVector();

   /**
    * @brief Gets fraction of constraints that are not longer open for a detector
    * @return fraction of constraints that are not longer open for a detector
    */
   SCIP_Real getPctConssFromFree(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief Gets fraction of constraints that are not longer open for detectors in detectorchain
    * @return vector of fractions of constraints that are not longer open for detectors in detectorchain
    */
   std::vector<SCIP_Real>& getPctConssFromFreeVector();

   /**
    * @brief Gets index of the representative block for a block, this might be blockid itself
    * @param blockid id of the block the representative is asked for
    * @return index of the representative block for a block, this might be blockid itself
    */
   int getRepForBlock(
      int blockid
      );

   /**
    * @brief Gets the represenation varmap
    *
    * Var map is vector for represenative repid and the blockrepid-th block that is represented by repid
    * @param repid id of representative
    * @param blockrepid id of block
    * @return the represenation varmap as vector for represenative repid and the blockrepid-th block that is represented by repid
    */

   std::vector<int> & getRepVarmap(
      int repid,
      int blockrepid
      );

   /**
    * @brief Gets the corresponding detprobdata
    * @return corresponding detprobdata
    */
   DETPROBDATA* getDetprobdata();

   /**
    * @brief Gets array containing stairlinking vars,
    * @note if a stairlinking variable links block i and i+1 it is only stored in vector of block i
    * @param block id of the block the stairlinking variable varctor is asked for
    * @return array containing stairlinking vars,
    */
   const int* getStairlinkingvars(
      int block
      );

   /**
    * @brief Gets array containing vars of a block
    * @param block id of the block the vars are requested for
    * @return returns array containing vars of a block
    */
   std::vector<int>& getVarsForBlock(
      int block
      );

   /**
    * @brief  Gets index in variables array of a block for a variable
    * @param varid the id of the variable the index
    * @param block the corresponding block id
    * @return  returns index in variables array of a block for a variable
    */
   int getVarProbindexForBlock(
      int varid,
      int block
   );

   /**
    * @brief Gets whether this partialdec is complete,
    *  i.e. it has no more open constraints and variables
    * @return TRUE iff this partialdec is complete
    */
   bool isComplete();

   /**
    * @brief Gets whether the cons is a master cons
    * @param cons id of ccons to check if it is master constraint
    * @return true iff the cons is a master cons
    */
   bool isConsMastercons(
      int cons
      );

   /**
    * @brief Gets whether the cons is an open cons
    * @param cons id of cons to check
    * @return true iff the cons is an open cons
    */
   bool isConsOpencons(
      int cons
      );

   /**
    * @brief Gets whether the partialdec is from the presolved problem
    * @return true iff the partialdec is from the presolved problem
    */
   bool isAssignedToOrigProb();

   /**
    * Gets whether the partialdec is currently selected in explore menue
    * @return true iff the partialdec is currently selected in explore menue
    */
   bool isSelected();

   /**
    * @brief method to check whether this partialdec is equal to a given other partialdec ( \see  isEqual(PARTIALDECOMP*))

    * @return scip return code
    */
   SCIP_RETCODE isEqual(
      PARTIALDECOMP* otherpartialdec,   /**< other partialdec */
      SCIP_Bool* isequal,  /**< pointer to store whether partialdecs are identical */
      bool sortpartialdecs      /**< should conss and vars be sorted before comparing the partialdecs? */
      );

   /**
    * @brief method to check whether this partialdec is equal to a given other partialdec
    *
    * @return true iff partialdecs are equal
    */
   bool isEqual(
      PARTIALDECOMP* other /**< other partialdec to check equality with */
      );

   /**
    * @brief Gets whether this partialdec was propagated by specified detector
    * @param detector pointer to detector to check for
    * @return true iff this partialdec was propagated by detectorID
    */
   bool isPropagatedBy(
      DEC_DETECTOR* detector
      );

   /**
    * @brief Gets whether this partialdec is considered to be trivial
    *
    *  PARTIALDECOMP is considered trivial if all conss are in one block, all conss are in border,
    *  all variables linking or mastervars, or all constraints and variables are open
    * @return true iff this partialdec is considered to be trivial
    */
   bool isTrivial();

   /**
    * @brief Checks whether the var is assigned to the block
    * @param var id of var to check
    * @param block id of block to check
    * @return true iff the var is assigned to the block
    */
   bool isVarBlockvarOfBlock(
      int var,
      int block
      );

   /**
    * @brief Checks whether the var is a linking var
    * @param var id of var to check
    * @return true iff the var is a linking var
    */
   bool isVarLinkingvar(
      int var
      );

   /**
    * @brief Checks whether the var is a master var
    * @param var id of var to check
    * @return true iff the var is a master var
    */
   bool isVarMastervar(
      int var
      );

   /**
    * @brief Checks whether the var is an open var
    * @param var id of var to check
    * @return true iff the var is an open var
    */
   /**  */
   bool isVarOpenvar(
      int var
      );

   /**
    * @brief Checks whether the var is a stairlinking var
    * @param var id of var to check
    * @return true iff the var is a stairlinking var
    */
   bool isVarStairlinkingvar(
      int var
      );

   /**
    * @brief Checks whether the var is a stairlinkingvar of a specified block
    * @param var id of var to check if it is a stairlinking variable hitting specified block
    * @param block id of block to check
    * @return true iff the var is a stairlinkingvar of a specified block
    */
   bool isVarStairlinkingvarOfBlock(
      int var,
      int block
      );

   /**
    * @brief prints partition information as described in \see cls reader
    * @param givenscip scip data structure
    * @param file output file
    */
   void printPartitionInformation(
      SCIP*                givenscip,
      FILE*                file
      );

   /**
    * @brief refine partialdec with focus on blocks
    *
    * strategy: assigns open conss and vars if they can be found in blocks
    * (without respect to open vars and conss  @see assignHittingOpenconss(), @see assignHittingOpenvars())
    * @note partialdec might be not complete
    */
   void refineToBlocks(
      );

   /**
    * @brief refine partialdec with focus on master
    *
    * strategy: do obvious ( @see considerImplicits()) assignments and
    *  assign other conss and vars to master if possible (@see assignOpenPartialHittingToMaster())
    */
   void refineToMaster(
      );

   /**
    * @brief registers statistics for a used conspartition
    */
   void setConsPartitionStatistics(
      int detectorchainindex, /**< index of the detector in the detectorchain */
      ConsPartition* partition, /**< the used conspartition */
      std::vector<int>& consclassesmaster /**< vector of classindices that were assigned to master */
      );

   /**
    * @brief adds a constraint to a block, does not delete this cons from list of open conss
    * @param consToBlock id of cons to add
    * @param block id of block to add
    */
   void setConsToBlock(
      int consToBlock,
      int block
      );

   /**
    * @brief adds a constraint to a block
    * @param cons id of cons to add
    * @param block id of block to add
    */
   void fixConsToBlock(
      int cons,
      int block
      );

   /**
    * @brief adds a constraint to a block
    * @param cons pointer of cons to add
    * @param block id of block to add
    * @returns true iff successful
    */
   bool fixConsToBlock(
      SCIP_CONS* cons,
      int block
      );

   /**
    * @brief adds a constraint to the master constraints, does not delete this cons from list of open conss
    * @param consToMaster id of cons to add
    */
   void setConsToMaster(
      int consToMaster
      );

   /**
    * @brief fixes a constraint to the master constraints
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openconss
    * @return iterator that points to the next element of PARTIALDECOMP::openconss
    * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
    */
   std::vector<int>::const_iterator fixConsToMaster(
         std::vector<int>::const_iterator itr
   );

   /**
    * @brief fixes a constraint to the master constraints
    * @param cons id of cons to add
    * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
    */
   void fixConsToMaster(
      int cons
      );

   /**
    * @brief fixes a constraint to the master constraints
    * @param cons pointer of cons to add
    * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
    * @returns true iff successful
    */
   bool fixConsToMaster(
      SCIP_CONS* cons
      );

   /**
    * @brief sets the detectorchain with the given vector of detector pointers
    * @param givenDetectorChain vector of detector pointers
    */
   void setDetectorchain(
      std::vector<DEC_DETECTOR*>& givenDetectorChain
      );

   /**
    * @brief sets partialdec to be propagated by a detector
    * @param detector pointer to detector that is registered for this partialdec
    */
   void setDetectorPropagated(
      DEC_DETECTOR* detector
      );

   /**
    * @brief sets detector that finished the partialdec
    * @param detector pointer to detector that has finished this partialdecs
    */
   void setDetectorFinished(
      DEC_DETECTOR* detector
      );

   /**
    * @brief sets detector that finished the partialdec in the original problem
    * @param detectorID pointer to detector that has finished this partialdecs
    * @note does not add the detector to the detectorchain and does not modify partition statistics
    */
   void setDetectorFinishedOrig(
      DEC_DETECTOR* detectorID
      );

   /**
    * @brief sets whether this partialdec was finished by a finishing detector
    * @param finished is this partialdecs finished by a finishing detector
    */
   void setFinishedByFinisher(
      bool finished
      );

   /**
    * @brief sets whether this partialdec was finished by a finishing detector in the original problem
    *
    * (in case this partialdec was translated)
    * @param finished was this partialdecs finished by a finishing detector in orig
    */
   void setFinishedByFinisherOrig(
      bool finished
      );

   /**
    * @brief sets number of blocks, only increasing number allowed
    * @param nblocks new number of blocks
    */
   void setNBlocks(
      int nblocks
      );

   /**
    * @brief set the selection status of this partialdecs
    * @param selected whether the partialdec is selected
    */
   void setSelected(
      bool selected
      );

   /**
    * @brief sets whether this partialdec stems from an orig problem partialdec
    * @param fromorig has this partialdec ancestors from the orig problem
    */
   void setStemsFromOrig(
      bool fromorig
      );

   /**
    * @brief sets whether this partialdec is user given
    * @param usergiven is this partialdec user given
    */
   void setUsergiven(
      USERGIVEN usergiven
      );

   /**
    * @brief registers statistics for a used varpartition
    */
   void setVarPartitionStatistics(
      int detectorchainindex, /**< index of the detector in the detectorchain */
      VarPartition* partition, /**< the used varpartition */
      std::vector<int>& varclasseslinking, /**< vector of classindices that were assigned to linking */
      std::vector<int>& varclassesmaster /**< vector of classindices that were assigned to master */
      );

   /**
    * @brief adds a variable to the linking variables, does not delete this var from list of open vars
    * @param varToBlock id of var to be added
    * @param block id of block to be added
    */
   void setVarToBlock(
      int varToBlock,
      int block
      );

   /**
    * @brief adds a variable to the linking variables
    * @param var id of var to be added
    * @param block id of block to be added
    */
   void fixVarToBlock(
      int var,
      int block
      );

   /**
    * @brief adds a variable to the linking variables
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openvars
    * @param block id of block to be added
    * @return iterator that points to the next element of PARTIALDECOMP::openvars
    * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
    */
   std::vector<int>::const_iterator fixVarToBlock(
      std::vector<int>::const_iterator itr,
      int block
   );

   /**
    * @brief adds a variable to the linking variables, does not delete this var from list of open vars
    * @param varToLinking var to be set to linking
    */
   void setVarToLinking(
      int varToLinking
      );

   /**
    * @brief adds a variable to the linking variables
    * @param var var to be set to linking
    */
   void fixVarToLinking(
      int var
      );

   /**
    * @brief adds a variable to the linking variables
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openvars
    * @return iterator that points to the next element of PARTIALDECOMP::openvars
    * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
    */
   std::vector<int>::const_iterator fixVarToLinking(
      std::vector<int>::const_iterator itr
   );

   /** @brief adds a variable to the master variables, does not delete this var from list of open vars
    *
    *  master variables hit only constraints in the master
    */
   void setVarToMaster(
      int varToMaster   /**< var to be set to master */
      );

   /** @brief adds a variable to the master variables
    *
    *  master variables hit only constraints in the master
    */
   void fixVarToMaster(
      int var     /**< var to be set to master */
      );

   /** @brief adds a variable to the master variables
    *
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openvars
    * @return iterator that points to the next element of PARTIALDECOMP::openvars
    * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
    */
   std::vector<int>::const_iterator fixVarToMaster(
      std::vector<int>::const_iterator itr     /**< var to be set to master */
   );

   /**
    * @brief adds a variable to the stairlinking variables, does not delete this var from list of open vars
    * @param varToStairLinking id of variable to be added
    * @param block1 id of block one
    * @param block2 id of block two
    * @note stairlinking variables are only registered in block with smaller index
    */
   void setVarToStairlinking(
      int varToStairLinking,
      int block1,
      int block2
      );

   /**
    * @brief adds a variable to the stairlinking variables
    * @param var id of variable to be added
    * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
    * @note stairlinking variables are only registered in block with smaller index
    */
   void fixVarToStairlinking(
      int var,
      int firstblock
      );

   /**
    * @brief adds a variable to the stairlinking variables
    * @param itr valid iterator pointing to elements of PARTIALDECOMP::openvars
    * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
    * @return iterator that points to the next element of PARTIALDECOMP::openvars
    * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
    * @note stairlinking variables are only registered in block with smaller index
    */
   std::vector<int>::const_iterator fixVarToStairlinking(
      std::vector<int>::const_iterator itr,
      int firstblock
   );

   /**
    * @brief assigns a constraint by name to a block
    * @see fixConsToBlock
    * @returns true iff successful
    */
   bool fixConsToBlockByName(
      const char*           consname,            /**< name of the constraint */
      int                   blockid              /**< block index (counting from 0) */
      );

   /**
    * @brief assigns a variable by name to a block
    * @see fixVarToBlock
    * @returns true iff successful
    */
   bool fixVarToBlockByName(
      const char*           varname,             /**< name of the variable */
      int                   blockid              /**< block index (counting from 0) */
      );

   /**
    * @brief assgins a constraint by name as master
    * @see fixConsToMaster
    * @returns true iff successful
    */
   bool fixConsToMasterByName(
      const char*           consname   /**< name of cons to fix as master cons */
      );

   /**
    * @brief assigns a variable with given name as master
    * @see fixVarToMaster
    * @returns true iff successful
    */
   bool fixVarToMasterByName(
      const char*           varname              /**< name of the variable */
      );

   /**
    * @brief assigns a variable by name to the linking variables
    * @see fixVarToLinking
    * @returns true iff successful
    */
   bool fixVarToLinkingByName(
      const char*           varname              /**< name of the variable */
      );

   /**
    * @brief generates and opens a gp visualization of the partialdec
    * @see visual/pdfreader and
    * @note linux only
    */
   void showVisualization();

   /**
    * @brief generates a visualization of the partialdec using gnuplot
    * @param filename Path where to store the gp file
    * @param outname Path at which gnuplot will output its result
    * @param outputformat The format of the gnuplot output. Should match the file extension of outname
    * @note linux only, requires gnuplot
    */
   void generateVisualization(
      char* filename,
      char* outname,
      GP_OUTPUT_FORMAT outputformat = GP_OUTPUT_FORMAT_PDF
      );

   /**
    * @brief writes a gp visualization of the partialdec to a file
    * @param filename Path where to store the gp file
    * @param outname Path at which gnuplot will output its result
    * @param outputformat The format of the gnuplot output. Should match the file extension of outname
    */
   void writeVisualizationFile(
      char* filename,
      char* outname,
      GP_OUTPUT_FORMAT outputformat = GP_OUTPUT_FORMAT_PDF
      );
   
   /**
    * @brief generates a gp visualization of the partialdec without compilation or opening
    */
   void exportVisualization();

   /**
    * @brief Checks whether this partialdec is a userpartialdec that should be completed
    *
    * the completion should be done by setting unspecified constraints to master
    * @return TRUE iff this partialdec is a userpartialdec that should be completed
    */
   SCIP_Bool shouldCompletedByConsToMaster();

   /**
    * @brief sorts the vars and conss data structures by their indices
    * @returns true if the internal order of variables or constraints changed
    */
   bool sort();

   /**
    * @brief set statistical vector of fractions of constraints set to blocks per involved detector
    * @param newvector vector of fractions of constraints set to blocks per involved detector
    */
   void setPctConssToBlockVector(
      std::vector<SCIP_Real>& newvector
      );

   /**
    * @brief set statistical vector of fractions of constraints that are not longer open per involved detector
    * @param newvector vector of fractions of constraints that are not longer open per involved detector
    */
   void setPctConssFromFreeVector(
      std::vector<SCIP_Real>& newvector
   );

   /**
    * @brief set statistical vector of fractions of constraints assigned to the border per involved detector
    * @param newvector vector of fractions of constraints assigned to the border per involved detector
    */
   void setPctConssToBorderVector(
      std::vector<SCIP_Real>& newvector
      );

   /**
    * @brief set statistical vector of fraction of variables assigned to the border per involved detector
    * @param newvector vector of fractions of variables assigned to the border per involved detector
    */
   void setPctVarsToBorderVector(
      std::vector<SCIP_Real>& newvector
      );

   /**
    * @brief set statistical vector of fractions of variables assigned to a block per involved detector
    * @param newvector vector of fractions of variables assigned to a block per involved detector
    */
   void setPctVarsToBlockVector(
      std::vector<SCIP_Real>& newvector
   );

   /**
    * @brief set statistical vector of variables that are not longer open per involved detector
    * @param newvector vector of fractions of variables that are not longer open per involved detector
    */
   void setPctVarsFromFreeVector(
      std::vector<SCIP_Real>& newvector
      );

   /**
    * @brief set statistical vector of the times that the detectors needed for detecting per involved detector
    * @param newvector vector of the times that the detectors needed for detecting per involved detector
    */
   void setDetectorClockTimes(
      std::vector<SCIP_Real>& newvector
      );

   /** @brief gets the classic score
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcClassicScore
    * @returns border area score
    */
   SCIP_Real getClassicScore();

   /** @brief set the classic score
    */
   void setClassicScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the border area score
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcBorderAreaScore
    * @returns border area score
    */
   SCIP_Real getBorderAreaScore();

   /** @brief set the border area score
    */
   void setBorderAreaScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

    /** @brief gets the maximum white area score
    *
    * "maximum white score" is fraction of the area of the decomposed matrix that is neither block or border
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcMaxWhiteScore
    * @returns maximum  white area score
    * */
   SCIP_Real getMaxWhiteScore();

   /** @brief set the maximum white area score
    */
   void setMaxWhiteScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the maximum foreseeing white area score
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcMaxForseeingWhiteScore
    * @returns maximum foreseeing white area score
    * */
   SCIP_Real getMaxForWhiteScore();

   /** @brief set the maximum foreseeing white area score
    */
   void setMaxForWhiteScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the setpartitioning maximum foreseeing white area score
    *
    * @note -1 iff not calculated yet, \see GGCGconshdlrDecompCalcSetPartForseeingWhiteScore
    * @returns setpartitioning maximum foreseeing white area score
    * */
   SCIP_Real getSetPartForWhiteScore();

   /** @brief set the setpartitioning maximum foreseeing white area score
    */
   void setSetPartForWhiteScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the maximum foreseeing white area score with respect to aggregatable blocks
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcMaxForeseeingWhiteAggScore
    * @returns maximum foreseeing white area score with respect to aggregatable blocks
    * */
   SCIP_Real getMaxForWhiteAggScore();

   /** @brief set the maximum foreseeing white area score with respect to aggregatable blocks
    */
   void setMaxForWhiteAggScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the setpartitioning maximum foreseeing white area score with respect to aggregateable
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcSetPartForWhiteAggScore
    * @returns setpartitioning maximum foreseeing white area score with respect to aggregateable
    */
   SCIP_Real getSetPartForWhiteAggScore();

   /** @brief set the setpartitioning maximum foreseeing white area score with respect to aggregateable
    */
   void setSetPartForWhiteAggScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the benders score
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcBendersScore
    * @returns benders score
    */
   SCIP_Real getBendersScore();

   /** @brief set the benders score
    */
   void setBendersScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** @brief gets the strong decomposition score
    *
    * @note -1 iff not calculated yet, \see GCGconshdlrDecompCalcStrongDecompositionScore
    * @returns strong decomposition score
    */
   SCIP_Real getStrongDecompScore();

   /** @brief set the strong decomposition score
    */
   void setStrongDecompScore(
      SCIP_Real score   /**< new score value in [0,1] */
   );

   /** sorts the partialdec and calculates a its implicit assignments, hashvalue and evaluation
    *
    * @returns SCIP_OKAY if the result is consistent, SCIP_ERROR if there was an inconsistency
   */
   void prepare();

   /**
    * @brief Checks if the aggregation information was already calculated
    * @return true iff the aggregation information was already calculated
    */
   bool aggInfoCalculated();

   /**
    * @brief computes if aggregation of sub problems is possible
    *
    * checks if aggregation of sub problems is possible and stores the corresponding aggregation information
    *
    * @param ignoreDetectionLimits Set to true if computation should ignore detection limits. This parameter is ignored if the patched bliss version is not present.
   */
   void calcAggregationInformation(
      bool ignoreDetectionLimits
      );

   /**< @brief gets vector of indices of all constraints assigned to blocks
    *
    * @note conssforblocks[k] contains a vector of indices of all constraints assigned to block k
    * @returns vector of a vector of indices for each block */
   std::vector<std::vector<int>>& getConssForBlocks(
   );

   int getTranslatedpartialdecid() const;

   void setTranslatedpartialdecid(
      int decid
      );

   /**
   * @brief creates a detector chain short string for this partialdec, is built from detector chain
   */
   void buildDecChainString(
      char* buffer /**< will contain string of detector chars in chronological order afterwards*/
      );

private:

   /**
    * @brief adds empty entries for all partition statistics for a detector added to the detector chain
    */
   void addEmptyPartitionStatistics();

   /** @brief assigns open cons
    *
    * Assignments as follows:
    *  - to master if it hits blockvars of different blocks
    *  - to the respective block if it hits a blockvar of exactly one block and no stairlinking var
    *  - to master if it hits a stairlinking var but there is no block the cons may be assigned to
    *  - to the block with the lowest number of conss if it hits a stairlinking var and there are blocks the cons may be
    *    assigned to
    *  - leave it open if it hits no blocks yet
    *  @return true iff some assignment was made by the method
    */
   bool assignHittingOpenconss(
      );

   /** @brief assigns every open var
    *
    * Assignments as follows:
    *  - to the respective block if it hits blockconss of exactly one block
    *  - to linking if it hits blockconss of more than one different blocks
    *  - leave the var open otherwise
    *  @return true iff there is a var that has been assigned in this call*/
   bool assignHittingOpenvars(
      );

   /**
    * @brief assigns every open cons to master that hits
    *
    * Assignments as follows:
    *  - exactly one block var and at least one open var or
    *  - a master var
    *  - or leave it open elsewise
    */
   void assignOpenPartialHittingConsToMaster(
      );

   /**
    * @brief assigns open conss/vars that hit exactly one block and at least one open var/cons to border
    */
   void assignOpenPartialHittingToMaster(
      );

   /**
    * @brief assigns every open var to linking that hits
    *
    * Assignments as follows:
    *  - exactly one block cons and at least one open cons
    *  - leave it open otherwise
    */
   void assignOpenPartialHittingVarsToMaster(
      );

   /**
    * @brief calculates the number of nonzero coefficients for the blocks
    */
   void calcNCoeffsForBlocks(
   );

   /**
    * @brief calculates the hash value of the partialdec for comparing
    */
   void calcHashvalue();

   /**
    * @brief blockwise calculation of how many master conss contain the block vars
    *
    * counts for each pair of block and master constraint, how many nonzero entries the variables of the blocks
    * have in the master constraint
    */
   void calcNCoeffsForBlockForMastercons(
        );

   /**
    *  @brief optimizes block order to max stairlinking vars
    *
    *  changes the block order in a way such that all linking vars that are potentially stairlinking
    *  may be reassigned to stairlinking
    * @note precondition: all potentially stairlinking vars have a staircase structure */
   void changeBlockOrderStaircase(
        GraphGCG* g /**< graph with blocks as nodes and weighted edges for the number of
                         potentially stairlinkingvars connecting two blocks */
        );

   /**
    * @brief changes the order of the blocks according to the given mapping
    *
    * \note precondition: given mapping needs to be an adequately sized permutation */
   void changeBlockOrder(
        std::vector<int> oldToNewBlockIndex /**< the mapping from old to new block indices */
        );

   /**
    * @brief returns true if the given detector used a conspartition
    * @return true iff the given detector used a conspartition
    */
   bool consPartitionUsed(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief prints out the current aggregation information
    *
    *  aggregation information: if there has been identified identical blocks
    */
   void displayAggregationInformation();

   /**
    * @brief calculates potential stairlinking variables with their blocks
    *
    * @return a vector of pairs of var index and vector of (two) block indices
    *  the related linking variable hits exactly these two blocks given in the related vector
    */
   std::vector< std::pair< int, std::vector< int > > > findLinkingVarsPotentiallyStairlinking(
      );

   /**
    * @brief returns the data of the conspartition that the given detector made use of
    */
   void getConsPartitionData(
      int detectorchainindex, /**< index of the detector in the detectorchain */
      ConsPartition** partition, /**< a pointer to the used conspartition (set by method)*/
      std::vector<int>& consclassesmaster /**< a vector containing all indices of the consclasses assigned to master
                                            *  (set by method) */
      );

   /**
    * @brief returns a string displaying all detector-related clock times and assignment data
    *
    * @return string displaying all detector-related clock times and assignment data
    */
   std::string getDetectorStatistics(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

   /**
    * @brief returns a string displaying partition information if a partition was used
    *
    * @return string displaying partition information if a partition was used
    */
   std::string getDetectorPartitionInfo(
      int detectorchainindex, /**< index of the detector in the detectorchain */
      bool displayConssVars /**< pass true if constraints and variables of the respective classes should be displayed */
      );

   /**
    * @brief Gets the number used partitions
    * @return number used partitions
    */
   int getNUsedPartitions();

   /**
    * @brief Gets the data of the varpartition that the given detector made use of
    * @return data of the varpartition that the given detector made use of
    */
   void getVarPartitionData(
      int detectorchainindex, /**< index of the detector in the detectorchain */
      VarPartition** partition, /**< a pointer to the used varpartition (set by method) */
      std::vector<int>& varclasseslinking, /**< a vector containing all indices of the varclasses assigned to linking (set by method) */
      std::vector<int>& varclassesmaster /**< a vector containing all indices of the varclasses assigned to master (set by method)*/
      );

   /**
    * @brief checks if calculation of aggregation information is considered to be too expensive
    * @return TRUE iff calculation of aggregation information is considered to be too expensive
    */
   SCIP_Bool isAgginfoTooExpensive();

   /**
    * @brief Gets whether the cons is a cons of the block
    * @param cons id of constraint to check
    * @param block id of the blocks
    * @return true iff the cons is a cons of the block
    */
   /**  */
   bool isConsBlockconsOfBlock(
      int cons,
      int block
      );

   /**
    * @brief returns true if the given detector used a varpartition
    *
    * @return true if the given detector used a varpartition
    */
   bool varPartitionUsed(
      int detectorchainindex /**< index of the detector in the detectorchain */
      );

};


} /* namespace gcg */
#endif /* GCG_CLASS_PARTIALDECOMP_H__ */