Beispiel #1
0
run(
    Tester("csp" + os.sep + "single").add("Riddle", variant="v1")  # 1 solution
    .add("Riddle", variant="v2")  # 1 solution
    .add("Riddle", variant="v3a")  # 1 solution
    .add("Riddle", variant="v3b")  # 1 solution
    .add("Riddle", variant="v4a")  # 1 solution
    .add("Riddle", variant="v4b")  # 1 solution
    .add("Riddle", variant="v5")  # 1 solution
    .add("Abbots")  # 1 solution
    .add("Agatha")  # 4 solutions
    .add("Allergy")  # 1 solution
    .add("Alpha")  # 1 solution
    .add("Alpha", variant="var")  # 1 solution
    .add("Dimes")  # 2 solutions
    .add("Dinner")  # 2 solutions
    .add("Dudeney")  # 5 solutions
    .add("Grocery")  # 1 solution
    .add("LabeledDice")  # 24 solutions
    .add("MagicModuloNumber")  # 3 solutions
    .add("NFractions")  # 22 solutions
    .add("Picnic")  # 1 solution
    .add("PrimeLooking")  # 105 solutions
    .add("Purdey")  # 1 solution
    .add("SafeCracking")  # 1 solution
    .add("Sandwich")  # 8 solutions
    .add("SendMore")  # 1 solution
    .add("SimpleColoring")  # unsat
    .add("Square")  # 1 solution
    .add("SuperNumber")  # 1 solution
    .add("SuperNumber", variant="rules")  # 1 solution
    .add("TrafficLights")  # 4 solutions
    .add("TravelingWorld")  # unsat
    .add("TravelingWorld", variant="integer")  # unsat
    .add("Zebra")  # 48 solutions
)
Beispiel #2
0
import os

from pycsp3.problems.tests.tester import Tester, run

run(
    Tester("cop" + os.sep + "single").add("DakotaFurniture")  # optimum 280
    .add("Photo")  # optimum 2
    .add("Photo", variant="aux")  # optimum 2
    .add("Recipe")  # optimum 1700
    .add("Witch")  # optimum 1300
)
Beispiel #3
0
run(
    Tester("cop" + os.sep + "complex").add("AircraftLanding",
                                           data="airland01.txt",
                                           prs_py="AircraftLanding_Parser.py",
                                           prs_jv="")  # optimum 70000
    .add("AircraftLanding",
         data="airland01.txt",
         prs_py="AircraftLanding_Parser.py",
         prs_jv="",
         variant="table")  # optimum 70000
    .add("Amaze", data="Amaze_simple.json")  # optimum 12
    .add("Amaze",
         data="Amaze_2012-03-07.dzn",
         prs_py="Amaze_ParserZ.py",
         prs_jv="")  # optimum 315
    .add("Auction", data="Auction_example.json")  # optimum 54
    .add("Auction",
         data="Auction_example.txt",
         prs_py="Auction_Parser",
         prs_jv="Auction_Parser")  # optimum 54
    .add("Bacp", data="Bacp_10.json", variant="m1")  # optimum 26
    .add("Bacp", data="Bacp_10.json", variant="m2")  # optimum 26
    .add("Bacp", data="Bacp_10.json", variant="m1-d")  # optimum 1
    .add("Bacp", data="Bacp_10.json", variant="m2-d")  # optimum 1
    .add("Bacp",
         data="Bacp_10.mzn",
         variant="m1",
         prs_py="Bacp_ParserZ",
         prs_jv="Bacp_ParserZ")  # m1 is enough to test parsing; optimum 26
    .add("BinPacking", data="BinPacking_n1c1w4a.json")  # optimum 5
    .add("BinPacking", data="BinPacking_n1c1w4a.json",
         variant="table")  # optimum 5
    .add("BinPacking",
         data="BinPacking_example.txt",
         prs_py="BinPacking_Parser",
         prs_jv="BinPacking_Parser")  # optimum 5
    .add("Bugs", data="Bugs_example.json")  # optimum 5
    .add("Bugs",
         data="Bugs_example.txt",
         prs_py="Bugs_Parser",
         prs_jv="Bugs_Parser")  # optimum 5
    .add("BusScheduling", data="BusScheduling_c1a.json").add(
        "BusScheduling", data="BusScheduling_r1.json").add(
            "BusScheduling", data="BusScheduling_t1.json")  # optimum 7
    .add("Coloring", data="Coloring_rand1.json")  # optimum 2
    .add("Cutstock", data="Cutstock_small.json")  # optimum 4
    .add("Fapp", data="Fapp_ex2.json")  # optimum 13871
    .add("Fapp", data="Fapp_ex2.json", variant="short")  # optimum 13871
    # .add("Fapp", data="Fapp_01-0200.json")  # TODO too long
    # .add("Fapp", data="Fapp_01-0200.json", variant="short")  # around 22 seconds for generating the file
    .add("Fastfood", data="Fastfood_ff01.json")  # optimum 3050
    .add("Fastfood", data="Fastfood_ff01.json",
         variant="table")  # optimum 3050
    .add("Fastfood",
         data="Fastfood_example.dzn",
         prs_py="Fastfood_ParserZ",
         prs_jv="Fastfood_ParserZ")  # optimum 3050
    .add("GraphColoring", data="GraphColoring_1-fullins-3.json")  # optimum 3
    .add("GraphColoring", data="GraphColoring_1-fullins-3.json",
         variant="sum")  # optimum 24
    .add("GraphColoring",
         data="GraphColoring_qwhdec-o18-h120-1.json")  # optimum 17
    .add("GraphColoring",
         data="GraphColoring_qwhdec-o18-h120-1.json",
         variant="sum")  # optimum 2754
    .add("GraphMaxAcyclic", data="GraphMaxAcyclic_example.json")  # optimum 44
    .add("GraphMaxAcyclic",
         data="GraphMaxAcyclic_example.txt",
         prs_py="GraphMaxAcyclic_Parser",
         prs_jv="GraphMaxAcyclic_Parser")  # optimum 44
    .add("GraphMaxAcyclic",
         data="GraphMaxAcyclic_example.txt",
         prs_py="GraphMaxAcyclic_Parser",
         prs_jv="GraphMaxAcyclic_Parser",
         variant="cnt")  # optimum 44
    .add("HCPizza", data="HCPizza_tiny.json")  # optimum 15
    .add("HCPizza",
         data="HCPizza_tiny.txt",
         prs_py="HCPizza_Parser",
         prs_jv="HCPizza_Parser")  # optimum 15
    .add("HCPizza",
         data="HCPizza_small.txt",
         prs_py="HCPizza_Parser",
         prs_jv="HCPizza_Parser").add(
             "Knapsack", data="Knapsack_20-50-00.json")  # optimum 583
    .add("League", data="League_010-03-04.json")  # optimum 92
    .add("LinearArrangement",
         data="MinLA01.json").add("Mario",
                                  data="Mario_easy-2.json")  # optimum 628
    .add("Mario", data="Mario_easy-2.json", variant="aux")  # optimum 628
    .add("Mario", data="Mario_easy-2.json", variant="table")  # optimum 628
    .add("MultiKnapsack",
         data="MultiKnapsack_example.txt",
         prs_py="MultiKnapsack_Parser",
         prs_jv="MultiKnapsack_Parser").add(
             "NurseRostering", data="NurseRostering_00.json")  # optimum 1202
    .add("NurseRostering",
         data="NurseRostering_18.json").add("OpenStacks",
                                            data="OpenStacks_example.dzn",
                                            prs_py="OpenStacks_ParserZ",
                                            prs_jv="OpenStacks_ParserZ",
                                            variant="m1")  # optimum 45
    .add("OpenStacks",
         data="OpenStacks_example.dzn",
         prs_py="OpenStacks_ParserZ",
         prs_jv="OpenStacks_ParserZ",
         variant="m2")  # optimum 45
    .add("PizzaVoucher", data="PizzaVoucher_pizza6.json")  # optimum 210
    .add("PrizeCollecting",
         data="PrizeCollecting_example.dzn",
         prs_py="PrizeCollecting_ParserZ")  # optimum 20
    .add("PrizeCollecting",
         data="PrizeCollecting_example.dzn",
         prs_py="PrizeCollecting_ParserZ",
         variant="table")  # optimum 20
    .add("ProgressiveParty",
         data="ProgressiveParty_example.txt",
         prs_py="ProgressiveParty_Parser")  # optimum 5
    .add("PseudoBoolean",
         data="PseudoBoolean_example.opb",
         prs_py="PseudoBoolean_Parser",
         prs_jv="PseudoBoolean_Parser")  # optimum 20
    .add("QuadraticAssignment",
         data="QuadraticAssignment_qap.json")  # optimum 4776
    .add("QuadraticAssignment",
         data="QuadraticAssignment_example.txt",
         prs_py="QuadraticAssignment_Parser",
         prs_jv="QuadraticAssignment_Parser")  # optimum 4776
    .add("Rack", data="Rack_r2.json")  # optimum 1100
    .add("Rack2", data="Rack_r2b.json")  # optimum 1100
    .add("Rcpsp", data="Rcpsp_j30-01-01.json")  # optimum 43
    .add("Rehearsal", data="RehearsalSmith.json")  # optimum 17
    .add("Rehearsal", data="RehearsalSmith.json", variant="bis")  # optimum 17
    .add("Rlfap", data="Rlfap_card-scen-04.json", variant="card")  # optimum 46
    .add("Rlfap", data="Rlfap_span-scen-05.json",
         variant="span")  # optimum 792
    .add(
        "Rlfap", data="Rlfap_max-graph-05.json", variant="max"
    )  # optimum 221  (use -ub=222 with Ace to prove it, or -os=increasing)
    .add("RoadConstruction", data="Road_9.json")  # optimum 3206
    .add("SchedulingFS",
         data="SchedulingFS-Taillard-os-04-04-0.json")  # optimum 302
    .add("SchedulingFS", data="Taillard-fs-020-05-1.json").add(
        "SchedulingJS", data="Sadeh-js-e0ddr1-0.json").add(
            "SchedulingJS", data="Taillard-js-015-15-1.json").add(
                "SchedulingOS", data="Taillard-os-05-05-1.json").add(
                    "SchedulingOS", data="GP-os-01.json").add(
                        "SetCovering",
                        data="Subsets_example.json")  # optimum 3
    .add("SetPacking", data="Subsets_example.json")  # optimum 4
    .add("Sonet", data="Sonet_sonet1.json")  # optimum 8
    .add("Sonet", data="Sonet_sonet3-4.json")  # optimum 12
    .add("SteelMillSlab", data="SteelMillSlab_bench_2_0.json").add(
        "SteelMillSlab", data="SteelMillSlab_bench_2_0.json",
        variant="01").add(
            "Tal",
            data="Tal-frobserved-7-15-11-13-9-1-11-7-4_1.json")  # optimum 142
    .add(
        "TemplateDesign", data="TemplateDesign_catfood_2.json"
    )  # optimum 2 ; java ace TemplateDesign-catfood_2.xml -valh=Rand -p=SAC3 -sop
    .add("TemplateDesign", data="TemplateDesign_catfood_2.json",
         variant="aux").add(
             "TravelingPurchaser",
             data="TravelingPurchaser-7-5-30-1.json")  # optimum 124
    .add("TravelingSalesman",
         data="TravelingSalesman_10-20-0.json")  # optimum 47
    .add("TravelingSalesman",
         data="TravelingSalesman_10-20-0.json",
         variant="table")  # optimum 47
    .add("TravelingTournament",
         data="TravelingTournament_galaxy04.json",
         variant="a2")  # optimum 517
    .add("TravelingTournament",
         data="TravelingTournament_galaxy04.json",
         variant="a3")  # optimum 416
    .add("TravelingTournamentWithPredefinedVenues",
         data="Ttppv_circ8bbal.json",
         variant="a2")  # optimum 94
    .add("TravelingTournamentWithPredefinedVenues",
         data="Ttppv_circ8bbal.json",
         variant="a3")  # optimum 80
    .add("Vellino", data="Vellino-5.json")  # optimum 8
    .add("Vrp", data="Vrp_P-n16-k8.json").add(
        "Warehouse",
        data="Warehouse_example.txt",
        prs_py="Warehouse_Parser",
        prs_jv="Warehouse_Parser")  # optimum 383
    .add("Warehouse",
         data="Warehouse_example.txt",
         prs_py="Warehouse_Parser",
         prs_jv="Warehouse_Parser",
         variant="compact")  # optimum 383
)
Beispiel #4
0
            data="Tal-frobserved-7-15-11-13-9-1-11-7-4_1.json")  # optimum 142
    .add(
        "TemplateDesign", data="TemplateDesign_catfood_2.json"
    )  # optimum 2 ; java AbsCon TemplateDesign-catfood_2.xml -valh=Rand -p=SAC3 -sop
    .add("TemplateDesign", data="TemplateDesign_catfood_2.json",
         variant="aux").add(
             "TravelingPurchaser",
             data="TravelingPurchaser-7-5-30-1.json")  # optimum 124
    .add("TravelingTournament",
         data="TravelingTournament_galaxy04.json",
         variant="a2")  # optimum 517
    .add("TravelingTournament",
         data="TravelingTournament_galaxy04.json",
         variant="a3")  # optimum 416
    .add("TravelingTournamentWithPredefinedVenues",
         data="Ttppv_circ8bbal.json",
         variant="a2")  # optimum 94
    .add("TravelingTournamentWithPredefinedVenues",
         data="Ttppv_circ8bbal.json",
         variant="a3")  # optimum 80
    .add("Vrp", data="Vrp_P-n16-k8.json").add(
        "Warehouse",
        data="Warehouse_example.txt",
        prs_py="Warehouse_Parser",
        prs_jv="Warehouse_Parser")  # optimum 383
    .add("Wwtpp", data="Wwtpp_ex04400.json")  # unsat
    .add("Wwtpp", data="Wwtpp_ex04400.json", variant="short")  # unsat
)

run(diff, same, xcsp)
Beispiel #5
0
run(Tester("csp" + os.sep + "complex")
    .add("Areas", data="Areas-3-3-3.json")  # 7 solutions
    .add("Blackhole", data="Blackhole.json", options_py="-recognizeSlides")  # 47232 solutions
    .add("CarSequencing", data="CarSequencing_dingbas.json")  # 6 solutions
    .add("CarSequencing", data="CarSequencing_dingbas.json", variant="table")  # 6 solutions
    .add("Coloring", data="Coloring_rand1.json", variant="csp")  # sat
    .add("Crossword", data="Crossword_vg6-7-ogd.json")  # sat
    .add("Crossword", data="Crossword_h1501-lex.json")  # sat
    .add("Crossword", data="Crossword_h0504-lex.json", variant="alt")  # sat
    .add("Dominoes", data="Dominoes_grid1.json")  # 128 solutions
    .add("Eternity", data="Eternity_07x05.json")  # 32 solutions
    .add("Eternity", data="Eternity_example.txt", prs_py="Eternity_Parser", prs_jv="Eternity_Parser")  # 32 solutions
    .add("Fillomino", data="Fillomino-01.json")  # 22 solutions
    .add("Fillomino", data="Fillomino-08.json")  # sat
    .add("Futoshiki", data="Futoshiki_futo3_0.json")  # 1 solution
    .add("Kakuro", data="Kakuro_easy-000.json")  # 1 solution
    .add("Kakuro", data="Kakuro_easy-000.json", variant="table")  # 1 solution
    .add("LatinSquare", data="LatinSquare_qwh-o030-h320.json")
    .add("LatinSquare2", data="LatinSquare2_7-2-0.json")  # 480 solutions
    .add("Layout", data="Layout_example.json")  # 2 solutions
    .add("Lightup", data="Lightup_example.json")  # 1 solution
    .add("Lightup", data="Lightup_example.txt", prs_py="Lightup_Parser", prs_jv="Lightup_Parser")  # 1 solution
    .add("Lits", data="Lits-example.json")  # 1636 solutions
    .add("MagicSquare", data="[4,None]")  # 7040 solutions
    .add("MagicSquare", data="MagicSquare_example1.txt", prs_py="MagicSquare_Parser", prs_jv="MagicSquare_Parser")
    .add("MarketSplit", data="MarketSplit_04.json")  # 1 solution
    .add("MineSweeper")  # 4 solutions
    .add("MisteryShopper", data="MisteryShopper_04.json")  # 501552 solutions
    .add("Nonogram", data="Nonogram_example.txt", prs_py="Nonogram_Parser", prs_jv="Nonogram_Parser")  # 1 solution
    .add("Nonogram", data="Nonogram_example.txt", prs_py="Nonogram_Parser", prs_jv="Nonogram_Parser", variant="table")  # 1 solution
    .add("RadarSurveillance", data="RadarSurveillance_8-24-3-2-00.json")  # sat
    .add("RectPacking", data="RectPacking_perfect-001.json")
    .add("RoomMate", data="RoomMate_sr0006.json")  # 2 solutions
    .add("Sat", data="Sat_flat30-16.json", variant="clause")  # 1482 solutions
    .add("Sat", data="Sat_flat30-16.json", variant="sum")  # 1482 solutions
    .add("Sat", data="Sat_flat30-16.json", variant="dual")  # 1482 solutions
    .add("Shikaku", data="Shikaku_grid1.json")  # 1 solution
    .add("SolitaireBattleship", data="SolitaireBattleship_sb-12-12-5-0.json")  # 51 solutions
    .add("SolitaireBattleship", data="SolitaireBattleship-battleship_instances-00113.json")  # 1 solution
    .add("Spiral")  # 5 solutions
    .add("Spiral", variant="table")  # 5 solutions
    .add("StableMarriage", data="StableMarriage-example.json")  # 3 solutions
    .add("StripPacking", data="StripPacking_C1P1.json")
    .add("Subisomorphism", data="Subisomorphism_A-01.json")  # 1 solution
    .add("Sudoku", data="[9,None]")  # None can be replaced by null (but not by an empty string in this context)
    .add("Sudoku", data="Sudoku_s13a.json")  # 1 solution
    .add("Sudoku", data="Sudoku_s13a.json", variant="table")  # 1 solution
    .add("Sudoku", data="Sudoku_example.txt", prs_py="Sudoku_Parser", prs_jv="Sudoku_Parser")  # 1 solution
    .add("Survo", data="Survo-01.json")  # 1 solution
    .add("VesselLoading", data="VesselLoading-inst1.json")  # 8 solutions
    .add("VesselLoading", data="VesselLoading-inst2.json")
    .add("Wwtpp", data="Wwtpp_ex04400.json")  # unsat
    .add("Wwtpp", data="Wwtpp_ex04400.json", variant="short")  # unsat
    )
Beispiel #6
0
run(
    Tester("csp" + os.sep + "academic").add(
        "AllInterval",
        data="10")  # 148 solutions (296 without symmetry-breaking)
    .add("AllInterval", data="10",
         variant="aux")  # 104 solutions  (296 without symmetry-breaking)
    .add("Bibd", data="[6,0,0,3,8]")  # 494 solutions
    .add("Bibd", data="[6,0,0,3,8]", variant="aux")  # 494 solutions
    .add("ColouredQueens", data="6")  # unsat
    .add("CostasArray", data="10")  # 2160 solutions
    .add("CoveringArray", data="[3,5,2,10]")  # sat
    .add("CryptoPuzzle", data="[SEND,MORE,MONEY]")  # 1 solution
    .add("CryptoPuzzle", data="[SEND,MORE,MONEY]",
         variant="carry")  # 1 solution
    .add("CryptoPuzzle", data="[DONALD,GERALD,ROBERT]")  # 1 solution
    .add("DeBruijnSequence", data="[2,5]")  # 2048 solutions
    .add("DiamondFree", data="8")  # 17 solutions
    .add("Domino", data="[200,200]")  # 1 solution
    .add("Domino",
         data="[200,200]",
         variant="table",
         options_py="-recognizeSlides")  # 1 solution
    .add("Dubois", data="10")  # unsat
    .add("Enigme5", data="[364,55440]").add("GracefulGraph",
                                            data="[3,5]")  # sat
    .add("KnightTour", data="16", options_py="-recognizeSlides").add(
        "KnightTour",
        data="16",
        variant="table-2",
        options_py="-recognizeSlides").add(
            "KnightTour",
            data="16",
            variant="table-3",
            options_py="-recognizeSlides").add("Langford",
                                               data="[3,10]")  # 10 solutions
    .add("LangfordBin", data="8")  # 300 solutions
    .add("MagicHexagon", data="[4,3]")  # sat
    .add("MagicSequence", data="10")  # 1 solution
    .add("NumberPartitioning", data="8")  # 1 solution
    .add("NumberPartitioning", data="10")  # unsat
    .add("Ortholatin", data="5")  # 4 solutions
    .add("Pigeons", data="6")  # unsat
    .add("Pigeons", data="6", variant="dec")  # unsat
    .add("PropStress", data="20").add("QuasiGroup",
                                      data="8",
                                      variant="base-v3")  # 12960 solutions
    .add("QuasiGroup", data="5", variant="base-v4")  # 12 solutions
    .add("QuasiGroup", data="8", variant="base-v5")  # 720 sols
    .add("QuasiGroup", data="8", variant="base-v6")  # 1440 sols
    .add("QuasiGroup", data="9", variant="base-v7")  # 5040 sols
    .add("QuasiGroup", data="8", variant="aux-v3")  # 12960 solutions
    .add("QuasiGroup", data="5", variant="aux-v4")  # 12 solutions
    .add("QuasiGroup", data="8", variant="aux-v5")  # 720 sols
    .add("QuasiGroup", data="9", variant="aux-v7")  # 5040 sols
    .add("Queens", data="10")  # 724 solutions
    .add("Queens", data="10", variant="v1")  # 724 solutions
    .add("Queens", data="10", variant="v2")  # 724 solutions
    .add("QueensKnights", data="[6,4]")  # 1664 solutions
    .add("QueensKnights", data="[10,5]")  # unsat
    .add("SchurrLemma", data="[6,6]")  # 39870 solutions
    .add("SchurrLemma", data="[8,8]", variant="mod")  # 141120 solutions
    .add("SocialGolfers", data="[4,4,5]")  # 2 solutions
    .add("SocialGolfers", data="[4,4,5]", variant="01")  # 2 solutions
    .add("SportsScheduling", data="6")  # 10 solutions
    .add("SportsScheduling", data="6", variant="dummy")  # 10 solutions
    .add("Steiner3", data="7")  # 151200 solutions
    .add("Superpermutation", data="3")  # 1 solution
    .add("Superpermutation", data="3", variant="table")  # 1 solution
    .add("Talisman", data="[4,2]")  # 34714 solutions
    # .add("WordDesign", data="[WordDesign.json,n=5]")  # sat  (pb in testing mode due to special way of setting parameters (pb with path)
)
Beispiel #7
0
from pycsp3.problems.tests.tester import Tester, run

NAME = "g6_tests"

tests = (Tester(NAME)
         # .add("UnitTestingIntension")
         .add("UnitTestingExtension")
         .add("UnitTestingSum")
         .add("UnitTestingVariable")
         .add("TestElement")
         .add("TestSums")
         .add("TestSlices")
         .add("TestUnaryConditions")
         .add("TestSumConditions")
         .add("TestSolver")
         )

run(tests, tests=True)
Beispiel #8
0
run(
    Tester("cop" + os.sep + "academic").add("BoardColoration",
                                            data="[8,10]")  # optimum 2
    .add("ChangeMaking", data="10")  # optimum 1
    .add("ChangeMaking", data="10", variant="compact")  # optimum 1
    .add("CoinsGrid", data="[10,4]")  # optimum 98
    .add("GolombRuler", data="8")  # optimum 34
    .add("GolombRuler", data="8", variant="dec")  # optimum 34
    .add("GolombRuler", data="8", variant="aux")  # optimum 34
    .add("LowAutocorrelation", data="16")  # optimum 24
    .add("Opd", data="[4,4,4]")  # optimum 4
    .add("Opd", data="[4,6,4]", variant="aux")  # optimum 3
    .add("PeacableArmies", data="6", variant="m1")  # optimum 5
    .add("PeacableArmies", data="6", variant="m2")  # optimum 5
    .add("QueenAttacking", data="6",
         options_py="-recognizeSlides")  # optimum 0
    .add("QueenAttacking",
         data="6",
         variant="aux",
         options_py="-recognizeSlides")  # optimum 0
    .add("QueenAttacking",
         data="6",
         variant="hybrid",
         options_py="-recognizeSlides")  # optimum 0
    .add("QueenAttacking",
         data="6",
         variant="table",
         options_py="-recognizeSlides")  # optimum 0
    .add("Ramsey", data="10")  # optimum 2
    .add("StillLife", data="[7,7]")  # optimum 28
    .add("StillLife", data="[8,8]", variant="wastage")  # optimum 36
    .add("WaterBucket", data="[8,5,3,4,4,0,8]")  # optimum 7
)