Skip to content

Commit b2bac41

Browse files
Merge branch '3865-fix-fix-reader_cip-in-exact-mode' into 'master'
Resolve "Fix reader_cip in exact mode" Closes #3865 See merge request integer/scip!3813
2 parents 5c4b0b9 + b13c510 commit b2bac41

16 files changed

+1271
-1433
lines changed

check/CMakeLists.txt

+64-8
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,18 @@ endif()
333333
# exact ip instances
334334
if(SCIP_WITH_EXACTSOLVE)
335335
set(instances_MIPEX
336+
"instances/MIPEX/egout.cip\;5681007/10000"
336337
"instances/MIP/enigma.mps\;0"
337338
"instances/MIPEX/flugpl_rational.mps\;1201500"
338-
"instances/MIP/stein27_inf.lp\;+infinity"
339339
"instances/MIP/Side.lp\;2"
340+
"instances/MIPEX/Side-coef.cip\;2"
340341
"instances/MIPEX/Side-coeftest.lp\;2"
342+
"instances/MIP/stein27_inf.lp\;+infinity"
341343
"instances/PseudoBoolean/normalized-t2001.13queen13.1111218308.opb\;+infinity"
342344
)
343345
if(SCIP_WITH_ZIMPL)
344346
list(APPEND
345347
instances_MIPEX
346-
"instances/MIPEX/egout.zpl\;568.1007"
347348
"instances/MIPEX/misc03.zpl\;3360"
348349
"instances/MIPEX/rgn.zpl\;2054999981/25000000"
349350
"instances/MIPEX/stein27.zpl\;18"
@@ -560,12 +561,12 @@ set(pairs_Issue
560561
# available reader file extensions for MIP problems
561562
#
562563
set(reader_extensions_MIP
564+
"cip"
563565
"mps"
564566
"lp"
565567
"opb"
566568
"pip"
567569
"fzn"
568-
"cip"
569570
"rlp"
570571
)
571572

@@ -576,6 +577,14 @@ set(reader_extensions_PB
576577
"cip"
577578
)
578579

580+
#
581+
# available reader file extensions for MIPEX problems
582+
#
583+
set(reader_extensions_MIPEX
584+
"cip"
585+
"lp"
586+
)
587+
579588
#
580589
# Writer output formats that are not also readers (all writers are reader_extensions_MIP + writer_only_extensions)
581590
#
@@ -810,32 +819,45 @@ endforeach(instance)
810819
set(basenames_opb_wrongformat
811820
bell5.mps
812821
blend2.mps
822+
dcmulti.mps
823+
egout.cip
813824
egout.mps
814825
flugpl.mps
826+
flugpl_rational.mps
815827
gt2.mps
828+
lseu_dcmulti.cip
816829
MANN_a9.clq.lp
817830
misc03.mps
831+
misc03.zpl
818832
rgn.mps
833+
rgn.zpl
819834
vpm2.fzn
820-
lseu_dcmulti.cip
821-
lseu_dcmulti_sHB.cip
822-
dcmulti.mps
823835
)
824836
set(message_format_opb "WARNING: only binary problems can be written in OPB format.")
825837

826838
#
827839
# the following instances use variable or equations names that are not supported in pip format
828840
#
829841
set(basenames_pip_wrongformat
842+
dcmulti.mps
843+
egout.cip
844+
egout.mps
845+
lseu_dcmulti.cip
830846
rgn.mps
847+
rgn.zpl
831848
)
832849
set(message_format_pip "PIP might be corrupted")
833850

834851
#
835852
# the following instances use variable or equations names that are not supported in lp format
836853
#
837854
set(basenames_lp_wrongformat
855+
dcmulti.mps
856+
egout.cip
857+
egout.mps
858+
lseu_dcmulti.cip
838859
rgn.mps
860+
rgn.zpl
839861
)
840862
set(message_format_lp "WARNING: violation of LP format - a constraint name starts with a digit; it is not possible to read the generated LP file with SCIP; use write/genproblem or write/gentransproblem for generic variable names")
841863

@@ -1226,7 +1248,41 @@ endif()
12261248

12271249
if(SCIP_WITH_EXACTSOLVE)
12281250
#
1229-
# first test without certification
1251+
# first test writing and reading from and to different file extensions for default MIPEX (only without original objective offset)
1252+
#
1253+
foreach(instance ${instances_MIPEX})
1254+
split_instance(instance)
1255+
foreach(extension ${reader_extensions_MIPEX})
1256+
#
1257+
# configure the batch file for this test by substituting placeholders in the in.file
1258+
#
1259+
# does this instance match the requirements of this format?
1260+
list(FIND basenames_${extension}_wrongformat ${basename} wrongformat)
1261+
#
1262+
# use different template batch files depending on the format requirements
1263+
#
1264+
if( wrongformat EQUAL -1 )
1265+
configure_file(interactiveshell/readertest.bat.in interactiveshell/readertest-${extension}-${basename}.bat)
1266+
set(regex "Validation : Success.*Validation : Success")
1267+
else()
1268+
configure_file(interactiveshell/readertest-wrongformat.bat.in interactiveshell/readertest-${extension}-${basename}.bat)
1269+
set(regex "${message_format_${extension}}")
1270+
endif()
1271+
add_test(NAME MIPEX-readertest-${extension}-${basename}
1272+
COMMAND $<TARGET_FILE:scip>
1273+
-c "set load ${PROJECT_SOURCE_DIR}/check/coverage/settings/exact-default.set"
1274+
-b "${PROJECT_BINARY_DIR}/check/interactiveshell/readertest-${extension}-${basename}.bat"
1275+
)
1276+
set_tests_properties(MIPEX-readertest-${extension}-${basename}
1277+
PROPERTIES
1278+
PASS_REGULAR_EXPRESSION ${regex}
1279+
FAIL_REGULAR_EXPRESSION "ERROR"
1280+
DEPENDS scip-build
1281+
)
1282+
endforeach(extension)
1283+
endforeach(instance)
1284+
#
1285+
# second test without certification
12301286
#
12311287
foreach(instance ${instances_MIPEX})
12321288
split_instance(instance)
@@ -1252,7 +1308,7 @@ if(SCIP_WITH_EXACTSOLVE)
12521308
endforeach(setting)
12531309
endforeach(instance ${instances_MIPEX})
12541310
#
1255-
# second test with certification, even if VIPR is not available, because it leads to SCIP running differently
1311+
# third test with certification, even if VIPR is not available, because it leads to SCIP running differently
12561312
#
12571313
foreach(instance ${instances_MIPEX})
12581314
split_instance(instance)

check/instances/MIPEX/Side-coef.cip

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
STATISTICS
2+
Problem name : Side-coef
3+
Variables : 19 (19 binary, 0 integer, 0 implicit integer, 0 continuous)
4+
Constraints : 0 initial, 7 maximal
5+
OBJECTIVE
6+
Sense : minimize
7+
VARIABLES
8+
[binary] <x0>: obj=0, original bounds=[0,1]
9+
[binary] <x1>: obj=0, original bounds=[0,1]
10+
[binary] <x2>: obj=0, original bounds=[0,1]
11+
[binary] <x3>: obj=0, original bounds=[0,1]
12+
[binary] <x4>: obj=0, original bounds=[0,1]
13+
[binary] <x5>: obj=0, original bounds=[0,1]
14+
[binary] <x6>: obj=0, original bounds=[0,1]
15+
[binary] <x7>: obj=0, original bounds=[0,1]
16+
[binary] <x8>: obj=0, original bounds=[0,1]
17+
[binary] <x9>: obj=0, original bounds=[0,1]
18+
[binary] <x10>: obj=0, original bounds=[0,1]
19+
[binary] <x11>: obj=0, original bounds=[0,1]
20+
[binary] <x12>: obj=0, original bounds=[0,1]
21+
[binary] <x13>: obj=1, original bounds=[0,1]
22+
[binary] <x14>: obj=1, original bounds=[0,1]
23+
[binary] <x15>: obj=2, original bounds=[0,1]
24+
[binary] <x16>: obj=1, original bounds=[0,1]
25+
[binary] <x17>: obj=1, original bounds=[0,1]
26+
[binary] <x18>: obj=2, original bounds=[0,1]
27+
CONSTRAINTS
28+
[exactlinear] <c0>: 360 <= +60<x9>[B] +53<x3>[B] +5321/100<x10>[B] +46<x12>[B] +38<x8>[B] +40<x7>[B] +80<x14>[B] +40<x0>[B] +40<x2>[B] +40<x6>[B] +80<x4>[B] +40<x5>[B] <= 380;
29+
[exactlinear] <c1>: -52<x4>[B] -32<x1>[B] -260/10<x10>[B] -23<x12>[B] -20<x2>[B] -20<x6>[B] -19<x8>[B] <= -140;
30+
[exactlinear] <c2>: -10<x14>[B] -6<x13>[B] -6<x3>[B] -5<x7>[B] -5<x0>[B] <= -16;
31+
[exactlinear] <c3>: -2<x11>[B] -2<x18>[B] -2<x15>[B] -<x16>[B] -<x17>[B] <= -3;
32+
[exactlinear] <c4>: -<x1>[B] -<x10>[B] -<x2>[B] <= -2;
33+
[exactlinear] <c5>: -<x9>[B] -<x5>[B] <= -1;
34+
[exactlinear] <c6>: <x1>[B] +<x11>[B] +<x9>[B] <= 1;
35+
END

check/instances/MIPEX/Side-coeftest.lp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\ SCIP STATISTICS
2-
\ Problem name : Side
2+
\ Problem name : Side-coeftest
33
\ Variables : 19 (19 binary, 0 integer, 0 implicit integer, 0 continuous)
44
\ Constraints : 7
55
Minimize

0 commit comments

Comments
 (0)