├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── FORMAT.md ├── FiniteStateMachines.md ├── LICENSE ├── README.md ├── TUTORIAL.md ├── examples ├── gnf │ ├── art_gallery_10_3_3_100_6504.gnf │ ├── connected_components.gnf │ ├── diorama_basic.gnf │ ├── diorama_distance.gnf │ ├── diorama_maxflow.gnf │ ├── diorama_reach.gnf │ └── reach.gnf ├── java │ └── Tutorial.java ├── python │ ├── chromatic_maze.py │ ├── color_maze.py │ ├── gnf_output.py │ ├── maxflow_benchmark.py │ ├── nqueens.py │ ├── reach_benchmark.py │ ├── shortestpath_benchmark.py │ ├── test_acyclic.py │ ├── test_acyclic2.py │ ├── test_amo.py │ ├── test_api.py │ ├── test_bv.py │ ├── test_bv_add.py │ ├── test_bv_add_blast.py │ ├── test_bv_concat.py │ ├── test_bv_eq.py │ ├── test_bv_ite.py │ ├── test_bv_min.py │ ├── test_bv_popcount.py │ ├── test_bv_weights.py │ ├── test_bv_weights_add.py │ ├── test_connected_components.py │ ├── test_logic.py │ ├── test_maxflow_bv.py │ ├── test_maxflow_pb.py │ ├── test_multiple_solvers.py │ ├── test_pb.py │ ├── test_pb_opt.py │ ├── test_reach.py │ ├── test_resource_limits.py │ ├── test_shortestpaths.py │ ├── test_shortestpaths_bv.py │ ├── test_unsat_gt.py │ ├── test_unsat_gt_logic.py │ ├── test_unsat_overflow_add.py │ └── tutorial.py └── routing │ ├── PCRT_FORMAT │ ├── instances │ ├── M_3_C_0 │ │ ├── instance_N_20_M_3_C_0_1.pcrt │ │ ├── instance_N_20_M_3_C_0_10.pcrt │ │ ├── instance_N_20_M_3_C_0_2.pcrt │ │ ├── instance_N_20_M_3_C_0_3.pcrt │ │ ├── instance_N_20_M_3_C_0_4.pcrt │ │ ├── instance_N_20_M_3_C_0_5.pcrt │ │ ├── instance_N_20_M_3_C_0_6.pcrt │ │ ├── instance_N_20_M_3_C_0_7.pcrt │ │ ├── instance_N_20_M_3_C_0_8.pcrt │ │ └── instance_N_20_M_3_C_0_9.pcrt │ ├── M_3_C_10 │ │ ├── instance_N_20_M_3_C_10_11.pcrt │ │ ├── instance_N_20_M_3_C_10_12.pcrt │ │ ├── instance_N_20_M_3_C_10_13.pcrt │ │ ├── instance_N_20_M_3_C_10_14.pcrt │ │ ├── instance_N_20_M_3_C_10_15.pcrt │ │ ├── instance_N_20_M_3_C_10_16.pcrt │ │ ├── instance_N_20_M_3_C_10_17.pcrt │ │ ├── instance_N_20_M_3_C_10_18.pcrt │ │ ├── instance_N_20_M_3_C_10_19.pcrt │ │ └── instance_N_20_M_3_C_10_20.pcrt │ ├── M_3_C_20 │ │ ├── instance_N_20_M_3_C_20_21.pcrt │ │ ├── instance_N_20_M_3_C_20_22.pcrt │ │ ├── instance_N_20_M_3_C_20_23.pcrt │ │ ├── instance_N_20_M_3_C_20_24.pcrt │ │ ├── instance_N_20_M_3_C_20_25.pcrt │ │ ├── instance_N_20_M_3_C_20_26.pcrt │ │ ├── instance_N_20_M_3_C_20_27.pcrt │ │ ├── instance_N_20_M_3_C_20_28.pcrt │ │ ├── instance_N_20_M_3_C_20_29.pcrt │ │ └── instance_N_20_M_3_C_20_30.pcrt │ ├── M_3_C_30 │ │ ├── instance_N_20_M_3_C_30_31.pcrt │ │ ├── instance_N_20_M_3_C_30_32.pcrt │ │ ├── instance_N_20_M_3_C_30_33.pcrt │ │ ├── instance_N_20_M_3_C_30_34.pcrt │ │ ├── instance_N_20_M_3_C_30_35.pcrt │ │ ├── instance_N_20_M_3_C_30_36.pcrt │ │ ├── instance_N_20_M_3_C_30_37.pcrt │ │ ├── instance_N_20_M_3_C_30_38.pcrt │ │ ├── instance_N_20_M_3_C_30_39.pcrt │ │ └── instance_N_20_M_3_C_30_40.pcrt │ ├── M_5_C_0 │ │ ├── instance_N_20_M_5_C_0_41.pcrt │ │ ├── instance_N_20_M_5_C_0_42.pcrt │ │ ├── instance_N_20_M_5_C_0_43.pcrt │ │ ├── instance_N_20_M_5_C_0_44.pcrt │ │ ├── instance_N_20_M_5_C_0_45.pcrt │ │ ├── instance_N_20_M_5_C_0_46.pcrt │ │ ├── instance_N_20_M_5_C_0_47.pcrt │ │ ├── instance_N_20_M_5_C_0_48.pcrt │ │ ├── instance_N_20_M_5_C_0_49.pcrt │ │ └── instance_N_20_M_5_C_0_50.pcrt │ ├── M_5_C_10 │ │ ├── instance_N_20_M_5_C_10_51.pcrt │ │ ├── instance_N_20_M_5_C_10_52.pcrt │ │ ├── instance_N_20_M_5_C_10_53.pcrt │ │ ├── instance_N_20_M_5_C_10_54.pcrt │ │ ├── instance_N_20_M_5_C_10_55.pcrt │ │ ├── instance_N_20_M_5_C_10_56.pcrt │ │ ├── instance_N_20_M_5_C_10_57.pcrt │ │ ├── instance_N_20_M_5_C_10_58.pcrt │ │ ├── instance_N_20_M_5_C_10_59.pcrt │ │ └── instance_N_20_M_5_C_10_60.pcrt │ ├── M_5_C_20 │ │ ├── instance_N_20_M_5_C_20_61.pcrt │ │ ├── instance_N_20_M_5_C_20_62.pcrt │ │ ├── instance_N_20_M_5_C_20_63.pcrt │ │ ├── instance_N_20_M_5_C_20_64.pcrt │ │ ├── instance_N_20_M_5_C_20_65.pcrt │ │ ├── instance_N_20_M_5_C_20_66.pcrt │ │ ├── instance_N_20_M_5_C_20_67.pcrt │ │ ├── instance_N_20_M_5_C_20_68.pcrt │ │ ├── instance_N_20_M_5_C_20_69.pcrt │ │ └── instance_N_20_M_5_C_20_70.pcrt │ ├── M_5_C_30 │ │ ├── instance_N_20_M_5_C_30_71.pcrt │ │ ├── instance_N_20_M_5_C_30_72.pcrt │ │ ├── instance_N_20_M_5_C_30_73.pcrt │ │ ├── instance_N_20_M_5_C_30_74.pcrt │ │ ├── instance_N_20_M_5_C_30_75.pcrt │ │ ├── instance_N_20_M_5_C_30_76.pcrt │ │ ├── instance_N_20_M_5_C_30_77.pcrt │ │ ├── instance_N_20_M_5_C_30_78.pcrt │ │ ├── instance_N_20_M_5_C_30_79.pcrt │ │ └── instance_N_20_M_5_C_30_80.pcrt │ ├── M_7_C_0 │ │ ├── instance_N_20_M_7_C_0_81.pcrt │ │ ├── instance_N_20_M_7_C_0_82.pcrt │ │ ├── instance_N_20_M_7_C_0_83.pcrt │ │ ├── instance_N_20_M_7_C_0_84.pcrt │ │ ├── instance_N_20_M_7_C_0_85.pcrt │ │ ├── instance_N_20_M_7_C_0_86.pcrt │ │ ├── instance_N_20_M_7_C_0_87.pcrt │ │ ├── instance_N_20_M_7_C_0_88.pcrt │ │ ├── instance_N_20_M_7_C_0_89.pcrt │ │ └── instance_N_20_M_7_C_0_90.pcrt │ ├── M_7_C_10 │ │ ├── instance_N_20_M_7_C_10_100.pcrt │ │ ├── instance_N_20_M_7_C_10_91.pcrt │ │ ├── instance_N_20_M_7_C_10_92.pcrt │ │ ├── instance_N_20_M_7_C_10_93.pcrt │ │ ├── instance_N_20_M_7_C_10_94.pcrt │ │ ├── instance_N_20_M_7_C_10_95.pcrt │ │ ├── instance_N_20_M_7_C_10_96.pcrt │ │ ├── instance_N_20_M_7_C_10_97.pcrt │ │ ├── instance_N_20_M_7_C_10_98.pcrt │ │ └── instance_N_20_M_7_C_10_99.pcrt │ ├── M_7_C_20 │ │ ├── instance_N_20_M_7_C_20_101.pcrt │ │ ├── instance_N_20_M_7_C_20_102.pcrt │ │ ├── instance_N_20_M_7_C_20_103.pcrt │ │ ├── instance_N_20_M_7_C_20_104.pcrt │ │ ├── instance_N_20_M_7_C_20_105.pcrt │ │ ├── instance_N_20_M_7_C_20_106.pcrt │ │ ├── instance_N_20_M_7_C_20_107.pcrt │ │ ├── instance_N_20_M_7_C_20_108.pcrt │ │ ├── instance_N_20_M_7_C_20_109.pcrt │ │ └── instance_N_20_M_7_C_20_110.pcrt │ ├── M_7_C_30 │ │ ├── instance_N_20_M_7_C_30_111.pcrt │ │ ├── instance_N_20_M_7_C_30_112.pcrt │ │ ├── instance_N_20_M_7_C_30_113.pcrt │ │ ├── instance_N_20_M_7_C_30_114.pcrt │ │ ├── instance_N_20_M_7_C_30_115.pcrt │ │ ├── instance_N_20_M_7_C_30_116.pcrt │ │ ├── instance_N_20_M_7_C_30_117.pcrt │ │ ├── instance_N_20_M_7_C_30_118.pcrt │ │ ├── instance_N_20_M_7_C_30_119.pcrt │ │ └── instance_N_20_M_7_C_30_120.pcrt │ ├── README │ ├── generate_pcrt.py │ └── make_benchmarks.sh │ ├── pcrt.py │ ├── router.py │ ├── router_multi.py │ ├── simple45.pcrt │ ├── simple45b.pcrt │ ├── simple90.pcrt │ └── simple90b.pcrt ├── src └── monosat │ ├── Main.cc │ ├── Version.cpp │ ├── Version.h │ ├── amo │ ├── AMOParser.h │ └── AMOTheory.h │ ├── api │ ├── Circuit.h │ ├── CircuitC.cpp │ ├── CircuitC.h │ ├── Logic.h │ ├── Monosat.cpp │ ├── Monosat.h │ ├── MonosatInternal.h │ ├── java │ │ ├── JNIExcept.h │ │ ├── MonosatJNI.cpp │ │ ├── README.md │ │ ├── monosat │ │ │ ├── BitVector.java │ │ │ ├── Comparison.java │ │ │ ├── Graph.java │ │ │ ├── Lit.java │ │ │ ├── Logic.java │ │ │ ├── MonosatJNI.java │ │ │ ├── NoModelException.java │ │ │ ├── Solver.java │ │ │ ├── TrivialContradictionException.java │ │ │ └── scala │ │ │ │ └── Bindings.scala │ │ ├── monosat_MonosatJNI.h │ │ └── tests │ │ │ ├── hamcrest-core-1.3.jar │ │ │ ├── junit-4.12.jar │ │ │ └── monosat │ │ │ ├── BitVectorTest.java │ │ │ ├── Constraints.java │ │ │ ├── GraphTest.java │ │ │ ├── LitTest.java │ │ │ ├── LogicTest.java │ │ │ ├── PseudoBooleanTest.java │ │ │ ├── ResourceLimitTest.java │ │ │ ├── SolverTest.java │ │ │ └── TestSuite.java │ └── python │ │ ├── .gitignore │ │ ├── README.md │ │ ├── monosat │ │ ├── __init__.py │ │ ├── bvtheory.py │ │ ├── fsmtheory.py │ │ ├── graphtheory.py │ │ ├── logic.py │ │ ├── manager.py │ │ ├── monosat_c.py │ │ ├── monosat_header.pxd │ │ ├── monosat_p.c │ │ ├── monosat_p.pyx │ │ ├── pbtheory.py │ │ ├── singleton.py │ │ └── solver.py │ │ ├── setup.py │ │ └── tests │ │ ├── __init__.py │ │ ├── test_graph.py │ │ ├── test_logic.py │ │ └── test_output.py │ ├── bv │ ├── BVParser.h │ ├── BVTheory.h │ └── BVTheorySolver.h │ ├── core │ ├── AssumptionParser.h │ ├── Config.cpp │ ├── Config.h │ ├── Dimacs.h │ ├── Heuristic.h │ ├── Optimize.cpp │ ├── Optimize.h │ ├── Remap.h │ ├── Solver.cc │ ├── Solver.h │ ├── SolverTypes.h │ ├── Theory.h │ └── TheorySolver.h │ ├── dgl │ ├── AcyclicFlow.h │ ├── AllPairs.cpp │ ├── AllPairs.h │ ├── BFS.h │ ├── CachedReach.h │ ├── Chokepoint.h │ ├── ConnectedComponents.cpp │ ├── ConnectedComponents.h │ ├── Cycle.h │ ├── DFS.h │ ├── DFSCycle.h │ ├── Dijkstra.h │ ├── DijkstraAllPairs.h │ ├── Dinics.h │ ├── DinicsLinkCut.h │ ├── DisjointSetConnectedComponents.h │ ├── Distance.cpp │ ├── Distance.h │ ├── DynamicBackGraph.h │ ├── DynamicConnectivity.h │ ├── DynamicConnectivityImpl.h │ ├── DynamicGraph.h │ ├── DynamicNodes.h │ ├── EdmondsKarp.h │ ├── EdmondsKarpAdj.h │ ├── EdmondsKarpDynamic.h │ ├── FloydWarshall.h │ ├── Graph.h │ ├── KohliTorr.h │ ├── Kruskal.h │ ├── MaxFlow.h │ ├── MinimumSpanningTree.h │ ├── NaiveDynamicConnectivity.h │ ├── PKTopologicalSort.h │ ├── Prim.h │ ├── RamalReps.h │ ├── RamalRepsBatched.h │ ├── RamalRepsBatchedUnified.h │ ├── Reach.cpp │ ├── Reach.h │ ├── SpiraPan.h │ ├── SteinerApprox.h │ ├── SteinerTree.h │ ├── TarjansSCC.h │ ├── ThorupDynamicConnectivity.h │ └── alg │ │ ├── AugmentedSplayTree.h │ │ ├── DisjointSets.cpp │ │ ├── DisjointSets.h │ │ ├── EulerTree.h │ │ ├── Heap.h │ │ ├── IntMap.h │ │ ├── LinkCut.h │ │ ├── LinkCutCost.cpp │ │ ├── LinkCutCost.h │ │ ├── Rnd.h │ │ ├── SearchTree.h │ │ ├── SplayTree.h │ │ ├── Treap.h │ │ ├── TreapCustom.h │ │ └── dyncut │ │ ├── GPL.TXT │ │ ├── README.TXT │ │ ├── block.h │ │ └── graph.h │ ├── fsm │ ├── DynamicFSM.h │ ├── FSMAcceptDetector.cpp │ ├── FSMAcceptDetector.h │ ├── FSMDetector.h │ ├── FSMGeneratesDetector.cpp │ ├── FSMGeneratesDetector.h │ ├── FSMGeneratorAcceptorDetector.cpp │ ├── FSMGeneratorAcceptorDetector.h │ ├── FSMParser.h │ ├── FSMTheory.h │ ├── FSMTransducesDetector.cpp │ ├── FSMTransducesDetector.h │ └── alg │ │ ├── NFAAccept.h │ │ ├── NFAAcceptor.h │ │ ├── NFAGenerate.h │ │ ├── NFAGraphAccept.h │ │ ├── NFALinearGeneratorAcceptor.h │ │ ├── NFATransduce.h │ │ └── NFATypes.h │ ├── graph │ ├── AllPairsDetector.cpp │ ├── AllPairsDetector.h │ ├── ConnectedComponentsDetector.cpp │ ├── ConnectedComponentsDetector.h │ ├── CycleDetector.cpp │ ├── CycleDetector.h │ ├── Detector.h │ ├── DistanceDetector.cpp │ ├── DistanceDetector.h │ ├── GraphHeuristic.h │ ├── GraphParser.h │ ├── GraphTheory.h │ ├── GraphTheoryTypes.h │ ├── MSTDetector.cpp │ ├── MSTDetector.h │ ├── MaxflowDetector.cpp │ ├── MaxflowDetector.h │ ├── ReachDetector.cpp │ ├── ReachDetector.h │ ├── SteinerDetector.cpp │ ├── SteinerDetector.h │ ├── WeightedDijkstra.h │ ├── WeightedDistanceDetector.cpp │ └── WeightedDistanceDetector.h │ ├── mtl │ ├── Alg.h │ ├── Alloc.h │ ├── Bitset.h │ ├── Deque.h │ ├── Heap.h │ ├── IntMap.h │ ├── IntTypes.h │ ├── Map.h │ ├── Queue.h │ ├── Rnd.h │ ├── Sort.h │ ├── Vec.h │ └── XAlloc.h │ ├── pb │ ├── ADTs │ │ ├── FEnv.cc │ │ ├── FEnv.h │ │ ├── File.cc │ │ ├── File.h │ │ ├── Global.cc │ │ ├── Global.h │ │ ├── Hash_standard.h │ │ ├── Heap.h │ │ ├── Int.h │ │ ├── Map.h │ │ ├── Sort.h │ │ ├── StackAlloc.h │ │ ├── VecAlloc.h │ │ └── VecMaps.h │ ├── Clausify.h │ ├── Config_pb.cpp │ ├── Config_pb.h │ ├── Debug.cc │ ├── Debug.h │ ├── Hardware.h │ ├── Hardware_adders.cc │ ├── Hardware_clausify.cc │ ├── Hardware_sorters.cc │ ├── Pb.h │ ├── PbParser.h │ ├── PbSolver.cc │ ├── PbSolver.h │ ├── PbSolver_convert.cc │ ├── PbSolver_convertAdd.cc │ ├── PbSolver_convertBdd.cc │ ├── PbSolver_convertSort.cc │ ├── PbTheory.h │ └── README.md │ ├── routing │ ├── FlowRouter.h │ └── FlowRouterParser.h │ ├── simp │ ├── SimpSolver.cc │ └── SimpSolver.h │ └── utils │ ├── Options.cc │ ├── Options.h │ ├── ParseUtils.h │ ├── System.cc │ └── System.h ├── style.xml └── tests └── python ├── read_pb.py ├── rnd_bv_eq.py ├── rnd_bv_max.py ├── rnd_bv_minmax.py ├── rnd_bv_popcount.py ├── rnd_cnd_diophantine.py ├── rnd_diophantine.py ├── rnd_diophantine_01.py ├── rnd_pb_opt.py ├── test_bv_add_blast2.py └── test_bv_add_blast3.py /.gitignore: -------------------------------------------------------------------------------- 1 | /ClangDebug 2 | /ClangRelease 3 | /GPerf 4 | *.o 5 | *.d 6 | *.so 7 | /CMakeFiles 8 | /api/python/build 9 | /src/monosat/api/python/build 10 | /src/monosat/api/cython/build 11 | /src/monosat/api/cython/cython_debug 12 | /src/monosat/api/java/build 13 | Release/* 14 | Release2/* 15 | MinSizeRel/* 16 | RelWithDebInfo/* 17 | SharedLibraryDbg/* 18 | Debug/* 19 | Klee/* 20 | MinSizeRel/* 21 | RelWithDebInfo/* 22 | SharedLibraryDbg/* 23 | cmake-build-debug/* 24 | cmake-build-minsizerel/* 25 | cmake-build-release/* 26 | cmake-build-relwithdebinfo/* 27 | coverage/* 28 | Static/* 29 | Win32/* 30 | Win64/* 31 | DbgRelease/* 32 | TestRelease/* 33 | Test/* 34 | graph/resources/* 35 | /DbgRelease 36 | /Test 37 | /Win64 38 | *.pyc 39 | tests/local/ 40 | venv/ 41 | javadoc/ 42 | CMakeCache.txt 43 | Makefile 44 | cmake_install.cmake 45 | libmonosat.a 46 | libmonosat.dylib 47 | libmonosat.so 48 | monosat 49 | monosat.jar 50 | monosat 51 | monosat_javadoc.zip 52 | 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2017, Sam Bayless 4 | Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson 5 | Copyright (c) 2007-2010, Niklas Sorensson 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 8 | associated documentation files (the "Software"), to deal in the Software without restriction, 9 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 10 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all copies or 14 | substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 17 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 20 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/gnf/connected_components.gnf: -------------------------------------------------------------------------------- 1 | c monosat monosat 2 | 1 0 3 | 1 0 4 | digraph 0 0 1 -1 5 | node 1 0 6 | node 1 1 7 | node 1 2 8 | edge 1 1 2 2 1 9 | node 1 3 10 | edge 1 2 3 3 1 11 | edge 1 1 3 4 1 12 | -2 5 0 13 | -3 5 0 14 | -4 5 0 15 | 2 3 4 -5 0 16 | 5 0 17 | graph_connected_component_count_geq 1 6 4 18 | solve 6 19 | -------------------------------------------------------------------------------- /examples/gnf/reach.gnf: -------------------------------------------------------------------------------- 1 | c this is a cnf with 5 Boolean variables and 2 clauses 2 | p cnf 7 5 3 | c some clauses in CNF format 4 | 1 0 5 | 3 0 6 | -2 -4 0 7 | 6 7 0 8 | -6 0 9 | c add a directed graph with identifier '0'. This graph has 3 nodes (numbered 0..2) and 4 edges. 10 | c All graph identifiers must be unique non-negative integers. 11 | digraph 4 5 0 12 | c declare an edge in graph 0, from node 0 to node 2. This edge is enabled (e.g., in the graph) if and only if variable 1 is true. 13 | c note that the variable controlling the graph must not be negative, and also that (for now), no two edges or graph predicates 14 | c can be associated with the same variable. 15 | edge 0 0 2 1 16 | edge 0 2 0 2 17 | edge 0 2 1 3 18 | edge 0 2 3 4 19 | edge 0 3 2 5 20 | c add a reachability constraint to graph 0. Variable 7 must be assigned true if and only if node 0 reaches node 1 in graph 0 21 | c (under assignment to the edge variables). 22 | reach 0 0 3 6 23 | c add a second reachability constraint to graph 0. Variable 8 must be true if and only if node 3 reaches node 0 in graph 0. 24 | reach 0 3 0 7 -------------------------------------------------------------------------------- /examples/python/gnf_output.py: -------------------------------------------------------------------------------- 1 | # Demonstrate writing and loading GNF files 2 | 3 | from monosat import * 4 | #To write to an output file, create a new solver and pass it the name of a file to write to 5 | #All constraints created in that new solver will be copied to that file 6 | Monosat().newSolver(output_file="example.gnf") 7 | a = Var() 8 | b = Var() 9 | c = Or(a, Not(b)) 10 | 11 | Assert(c) 12 | Assert(Not(c)) 13 | 14 | #trivial contradition, so result should be UNSAT 15 | result = Solve() 16 | print(result) 17 | 18 | Monosat().newSolver() #create a new solver, this time without any output file set. 19 | #solver now has no constraints, so it should be SAT 20 | print(Solve()) 21 | 22 | # read in the previously saved constraints (these can also be read in on the command line, eg ./monosat tutorial.gnf 23 | Monosat().readGNF("example.gnf") 24 | 25 | result2 = Solve() 26 | print(result2) 27 | assert(result==result2) -------------------------------------------------------------------------------- /examples/python/test_acyclic2.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | import random 3 | from monosat import * 4 | from networkx.relabel import convert_node_labels_to_integers 5 | 6 | print("begin encode"); 7 | 8 | seed = random.randint(1,100000) 9 | 10 | random.seed(seed) 11 | print("RandomSeed=" + str(seed)) 12 | 13 | size =6 14 | 15 | 16 | 17 | 18 | 19 | g = Graph() 20 | 21 | nodes = [] 22 | nxg = nx.gnp_random_graph(9,0.35,127,True) 23 | nxg = convert_node_labels_to_integers(nxg) 24 | for n in nxg: 25 | nodes.append(g.addNode()) 26 | nedges=0 27 | 28 | edges =[] 29 | for u,v in nxg.edges(): 30 | print("%d -> %d"%(u,v)) 31 | edges.append(g.addEdge(nodes[u],nodes[v])) 32 | 33 | 34 | 35 | Assert(g.acyclic(True)) 36 | Assert(g.reaches(0,8)) 37 | Assert(g.reaches(8,0)) 38 | #This is unsat, because the second two constraints force a cycle, while the first prohibits it 39 | 40 | result = Solve() 41 | print("Result is " + str(result)) 42 | assert(result==False) 43 | 44 | -------------------------------------------------------------------------------- /examples/python/test_amo.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | print("Testing MonoSAT's simple at-most-one constraint theory") 4 | print("For small numbers of variables, try also pseudo-Boolean constraint encodings.") 5 | vars=[] 6 | for v in range(10): 7 | vars.append(Var()) 8 | 9 | AssertAtMostOne(vars) 10 | 11 | result=Solve() 12 | print("Result is " + str(result)) 13 | assert(result==True) 14 | for v in vars: 15 | print(v.value()) 16 | 17 | AssertOr(vars) 18 | result=Solve() 19 | print("Result is " + str(result)) 20 | assert(result==True) 21 | for v in vars: 22 | print(v.value()) 23 | 24 | Assert(vars[0]) 25 | Assert(vars[1]) 26 | result=Solve() 27 | print("Result is " + str(result)) 28 | assert(result==False) 29 | -------------------------------------------------------------------------------- /examples/python/test_api.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | g= Graph() 3 | e1 = g.addEdge(1,2) 4 | e2 = g.addEdge(2,3) 5 | e3 = g.addEdge(1,3) 6 | Assert(Not(And(e1,e3))) 7 | Assert(~g.reaches(1,3)) 8 | Assert(~g.reaches(1,3)) 9 | 10 | try: 11 | Assert(~g.reaches(1,4)) 12 | # should not be reachable, as node 4 doesn't exist, so the above should raise an exception 13 | assert(false) 14 | except RuntimeError as e: 15 | pass 16 | 17 | try: 18 | Assert(~g.reaches(1,4)) 19 | # should not be reachable, as node 4 doesn't exist, so the above should raise an exception 20 | assert(false) 21 | except RuntimeError as e: 22 | pass 23 | 24 | result = Solve() 25 | print(result) 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/python/test_bv.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | bv = BitVector(32) 4 | assert(Solve()) 5 | Assert(bv<=0) 6 | Assert(bv>8) 7 | 8 | result=Solve() 9 | print("Result is " + str(result)) 10 | assert(result==False) 11 | 12 | -------------------------------------------------------------------------------- /examples/python/test_bv_add.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | bv1 = BitVector(4) 13 | bv2 = BitVector(4) 14 | bv3 = BitVector(4) 15 | bv4 = BitVector(4) 16 | 17 | 18 | g = Graph() 19 | 20 | nodes = [] 21 | for n in range(4): 22 | nodes.append(g.addNode()) 23 | 24 | Assert(g.addEdge(0,1,bv1)) 25 | Assert(g.addEdge(0,2,bv2)) 26 | Assert(g.addEdge(1,2,bv3)) 27 | Assert(g.addEdge(2,3,bv4)) 28 | 29 | bv5 = BitVector(4) 30 | bv6 = BitVector(4) 31 | 32 | Assert(g.distance_leq(0,3,bv5)) 33 | Assert(Not(g.distance_lt(0,3,bv5))) 34 | 35 | Assert(bv5<6) 36 | Assert(bv5 > 4) 37 | 38 | #Assert(bv6>=5) 39 | 40 | Assert(g.distance_leq(1,3,bv6)) 41 | Assert(Not(g.distance_lt(1,3,bv6))) 42 | 43 | 44 | Assert(bv5+bv6<10) 45 | 46 | #Assert(bv6>6) 47 | #Assert(bv6<10) 48 | 49 | result =Solve() 50 | 51 | print("Result is " + str(result)) 52 | assert(result==True) 53 | 54 | -------------------------------------------------------------------------------- /examples/python/test_bv_add_blast.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | monosat.bvtheory.BVManager().bitblast_addition=True 5 | 6 | print("begin encode"); 7 | 8 | seed = random.randint(1,100000) 9 | 10 | random.seed(seed) 11 | print("RandomSeed=" + str(seed)) 12 | 13 | 14 | 15 | bv1 = BitVector(4) 16 | bv2 = BitVector(4) 17 | bv3 = BitVector(4) 18 | bv4 = BitVector(4) 19 | 20 | 21 | g = Graph() 22 | 23 | nodes = [] 24 | for n in range(4): 25 | nodes.append(g.addNode()) 26 | 27 | Assert(g.addEdge(0,1,bv1)) 28 | Assert(g.addEdge(0,2,bv2)) 29 | Assert(g.addEdge(1,2,bv3)) 30 | Assert(g.addEdge(2,3,bv4)) 31 | 32 | bv5 = BitVector(4) 33 | bv6 = BitVector(4) 34 | 35 | Assert(g.distance_leq(0,3,bv5)) 36 | Assert(Not(g.distance_lt(0,3,bv5))) 37 | 38 | Assert(bv5<6) 39 | Assert(bv5 > 4) 40 | 41 | #Assert(bv6>=5) 42 | 43 | Assert(g.distance_leq(1,3,bv6)) 44 | Assert(Not(g.distance_lt(1,3,bv6))) 45 | 46 | Assert(bv2==10) 47 | Assert(bv5+bv6<11) 48 | Assert(bv5+bv6>8) 49 | #Assert(bv6>6) 50 | #Assert(bv6<10) 51 | 52 | result=Solve() 53 | print("Result is " + str(result)) 54 | 55 | if result: 56 | 57 | print(bv1.value()) 58 | print(bv2.value()) 59 | print(bv3.value()) 60 | print(bv4.value()) 61 | print(bv5.value()) 62 | print(bv6.value()) 63 | 64 | print("Done!\n") 65 | 66 | 67 | -------------------------------------------------------------------------------- /examples/python/test_bv_concat.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | bv1 = BitVector(4) 4 | bv2 = BitVector(4) 5 | bv3 = bv1.concat(bv2) 6 | 7 | Assert(bv1<=5) 8 | Assert(bv1>0) 9 | Assert(bv2 >=10) 10 | 11 | result =Solve() 12 | assert(result) 13 | for v in reversed(bv1.bits()): 14 | print("1" if v.value() else 0,end='') 15 | print(" = " + str(bv1.value()) +"\n") 16 | 17 | for v in reversed(bv2.bits()): 18 | print("1" if v.value() else 0,end='') 19 | print(" = " + str(bv2.value()) +"\n") 20 | 21 | for v in reversed(bv3.bits()): 22 | print("1" if v.value() else 0,end='') 23 | print(" = " + str(bv3.value()) +"\n") -------------------------------------------------------------------------------- /examples/python/test_bv_eq.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | a = Var() 13 | b= Var() 14 | 15 | bv1 = BitVector(4) 16 | bv2 = BitVector(4) 17 | bv3 = BitVector(4) 18 | bv4 = BitVector(4) 19 | 20 | Assert(bv1<=5) 21 | Assert(bv2 >=10) 22 | 23 | Assert(bv2==bv3) 24 | 25 | AssertIf(a, bv1==bv2, bv3==bv4) 26 | AssertIf(Not(a), bv1==bv2, bv3==bv4) 27 | 28 | result =Solve() 29 | 30 | print("Result is " + str(result)) 31 | assert(result==False) 32 | 33 | -------------------------------------------------------------------------------- /examples/python/test_bv_ite.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | Monosat().newSolver("""-debug-learnts=/tmp/test_learnts.cnf -decide-graph-bv -no-decide-theories -no-decide-graph-rnd -lazy-maxflow-decisions -conflict-min-cut -conflict-min-cut-maxflow -reach-underapprox-cnf """) 12 | 13 | 14 | bv1 = BitVector(4) 15 | bv2 = BitVector(4) 16 | bv3 = BitVector(4) 17 | bv4 = BitVector(4) 18 | 19 | 20 | g = Graph() 21 | 22 | nodes = [] 23 | for n in range(4): 24 | nodes.append(g.addNode()) 25 | 26 | Assert(g.addEdge(0,1,bv1)) 27 | Assert(g.addEdge(0,2,bv2)) 28 | Assert(g.addEdge(1,2,bv3)) 29 | Assert(g.addEdge(2,3,bv4)) 30 | 31 | bv5 = BitVector(4) 32 | bv6 = BitVector(4) 33 | 34 | Assert(g.distance_leq(0,3,bv5)) 35 | Assert(Not(g.distance_lt(0,3,bv5))) 36 | 37 | Assert(bv5<6) 38 | Assert(bv5 > 4) 39 | 40 | #Assert(bv6>=5) 41 | 42 | Assert(g.distance_leq(1,3,bv6)) 43 | Assert(Not(g.distance_lt(1,3,bv6))) 44 | 45 | bvRes = Ite(bv2>bv1, bv5,bv6) 46 | 47 | Assert(bvRes<10) 48 | 49 | #Assert(bv6>6) 50 | #Assert(bv6<10) 51 | 52 | result =Solve() 53 | 54 | print("Result is " + str(result)) 55 | assert(result==True) 56 | 57 | -------------------------------------------------------------------------------- /examples/python/test_bv_min.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | bv1 = BitVector(4) 13 | bv2 = BitVector(4) 14 | bv3 = BitVector(4) 15 | 16 | 17 | Assert(bv1==4) 18 | Assert(bv2 == 3) 19 | Assert(bv3==1) 20 | bv4 = Max(bv1,bv2,bv3) 21 | 22 | result =Solve() 23 | 24 | print("Result is " + str(result)) 25 | assert(result==True) 26 | print(bv1.value()) 27 | print(bv2.value()) 28 | print(bv3.value()) 29 | 30 | print(bv4.value()) 31 | assert(bv4.value()==4) 32 | 33 | -------------------------------------------------------------------------------- /examples/python/test_bv_popcount.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | bv1 = BitVector(4) 13 | bv2 = BitVector(4) 14 | bv3 = BitVector(4) 15 | 16 | 17 | Assert(bv1==4) 18 | Assert(bv2 == 3) 19 | Assert(bv3==1) 20 | bv4 = Max(bv1,bv2,bv3) 21 | 22 | result =Solve() 23 | 24 | print("Result is " + str(result)) 25 | assert(result==True) 26 | print(bv1.value()) 27 | print(bv2.value()) 28 | print(bv3.value()) 29 | 30 | print(bv4.value()) 31 | assert(bv4.value()==4) 32 | 33 | -------------------------------------------------------------------------------- /examples/python/test_bv_weights.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | 9 | 10 | random.seed(seed) 11 | print("RandomSeed=" + str(seed)) 12 | 13 | 14 | 15 | bv1 = BitVector(4) 16 | bv2 = BitVector(4) 17 | bv3 = BitVector(4) 18 | bv4 = BitVector(4) 19 | 20 | 21 | 22 | g = Graph() 23 | 24 | nodes = [] 25 | for n in range(4): 26 | nodes.append(g.addNode()) 27 | 28 | Assert(g.addEdge(0,1,bv1)) 29 | Assert(g.addEdge(0,2,bv2)) 30 | Assert(g.addEdge(1,2,bv3)) 31 | Assert(g.addEdge(2,3,bv4)) 32 | 33 | bv5 = BitVector(4) 34 | bv6 = BitVector(4) 35 | 36 | Assert(g.distance_leq(0,3,bv5)) 37 | Assert(Not(g.distance_lt(0,3,bv5))) 38 | 39 | Assert(bv5<6) 40 | Assert(bv5 > 4) 41 | 42 | #Assert(bv6>=5) 43 | 44 | Assert(g.distance_leq(1,3,bv6)) 45 | Assert(Not(g.distance_lt(1,3,bv6))) 46 | 47 | Assert(bv5<=bv6) 48 | Assert(Not(bv66) 51 | #Assert(bv6<10) 52 | result = Solve() 53 | print("Result is " + str(result)) 54 | if(result): 55 | for bv in bvs: 56 | print("bv" + str(bv.getID()) + " = " + str(bv.value())) 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /examples/python/test_bv_weights_add.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | bv1 = BitVector(4) 12 | bv2 = BitVector(4) 13 | bv3 = BitVector(4) 14 | bv4 = BitVector(4) 15 | 16 | 17 | 18 | g = Graph() 19 | 20 | nodes = [] 21 | for n in range(4): 22 | nodes.append(g.addNode()) 23 | 24 | Assert(g.addEdge(0,1,bv1)) 25 | Assert(g.addEdge(0,2,bv2)) 26 | Assert(g.addEdge(1,2,bv3)) 27 | Assert(g.addEdge(2,3,bv4)) 28 | 29 | bv5 = BitVector(4) 30 | bv6 = BitVector(4) 31 | 32 | Assert(g.distance_leq(0,3,bv5)) 33 | Assert(Not(g.distance_lt(0,3,bv5))) 34 | 35 | #Assert(bv5<6) 36 | #Assert(bv5 > 4) 37 | 38 | 39 | #Assert(bv6>=5) 40 | 41 | Assert(g.distance_leq(1,3,bv6)) 42 | Assert(Not(g.distance_lt(1,3,bv6))) 43 | 44 | Assert(bv5+bv6==10) 45 | Assert(bv6>4) 46 | bvs=[bv1,bv2,bv3,bv4,bv5,bv6] 47 | #Assert(bv6>6) 48 | #Assert(bv6<10) 49 | result = Solve() 50 | print("Result is " + str(result)) 51 | if(result): 52 | for bv in bvs: 53 | print("bv" + str(bv.getID()) + " = " + str(bv.value())) 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /examples/python/test_connected_components.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | g= Graph() 4 | e1 = g.addEdge(0,1) 5 | e2 = g.addEdge(1,2) 6 | e3 = g.addEdge(0,2) 7 | Assert(Or(e1,e2, e3)) 8 | 9 | # Test Connected component constraints 10 | # Note that the graph is interpreted as undirected for this constraint - so an edge connecting two nodes, in either 11 | # direction, makes them part of one component. 12 | 13 | # Note also that the node indices start at '0' 14 | assert(g.numNodes()==3) 15 | 16 | # Because at least one edge above must be true, and there are 3 nodes, there can be at most 2 connected components, 17 | # so the 'g.connectedComponentsGreaterOrEqualTo(3)' cannot be true 18 | atleast3components = g.connectedComponentsGreaterOrEqualTo(3) 19 | assert(not Solve(atleast3components)) 20 | # but the negated version should be sat 21 | assert(Solve (Not(atleast3components))) 22 | 23 | # cannot have less than 1 connected component 24 | 25 | atleast1component = g.connectedComponentsGreaterOrEqualTo(1) 26 | assert(Solve(atleast1component)) 27 | assert(not Solve(Not(atleast1component))) 28 | 29 | # There can, however, be at least 2 components 30 | 31 | atleast2components = g.connectedComponentsGreaterOrEqualTo(2) 32 | assert(Solve(atleast2components)) 33 | 34 | # and we can also have less than 2 connected components 35 | assert(Solve(Not(atleast2components))) 36 | 37 | # But if we assert 2 of the edges false, then we cannot have fewer than 2 connected components 38 | assert(not Solve(Not(atleast2components), Not(e1), Not(e2))) 39 | # If we enforce at least 2 components, this becomes SAT again 40 | assert(Solve(atleast2components, Not(e1), Not(e2))) 41 | 42 | # make this constraint permanent 43 | g.AssertConnectedComponentsGreaterOrEqualTo(2) 44 | # Still SAT 45 | assert(Solve()) 46 | 47 | # Still SAT 48 | g.AssertConnectedComponentsEqualTo(2) 49 | assert(Solve()) 50 | 51 | # But no longer SAT after this constraint 52 | g.AssertConnectedComponentsLessOrEqualto(1) 53 | assert(not Solve()) -------------------------------------------------------------------------------- /examples/python/test_logic.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | a = Var() 4 | b = Var() 5 | c = Or(a, Not(b)) 6 | 7 | Assert(c) 8 | 9 | result = Solve() 10 | print(result) -------------------------------------------------------------------------------- /examples/python/test_maxflow_bv.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | Monosat().newSolver("-decide-graph-bv -no-decide-theories -no-decide-graph-rnd -lazy-maxflow-decisions -conflict-min-cut -conflict-min-cut-maxflow -reach-underapprox-cnf ") 13 | 14 | 15 | 16 | bv0 = BitVector(4) 17 | bv1 = BitVector(4) 18 | bv2 = BitVector(4) 19 | bv3 = BitVector(4) 20 | 21 | 22 | 23 | 24 | g = Graph() 25 | 26 | nodes = [] 27 | for n in range(4): 28 | nodes.append(g.addNode()) 29 | 30 | Assert(g.addEdge(0,1,bv0)) 31 | Assert(g.addEdge(0,2,bv1)) 32 | Assert(g.addEdge(1,2,bv2)) 33 | Assert(g.addEdge(2,3,bv3)) 34 | 35 | bv4 = BitVector(4) 36 | bv5 = BitVector(4) 37 | 38 | #Assert(g.distance_leq(0,3,bv5)) 39 | #Assert(Not(g.distance_lt(0,3,bv5))) 40 | 41 | #Assert(bv5<6) 42 | Assert(bv4 >3) 43 | 44 | Assert(bv2>1) 45 | Assert(bv3>1) 46 | 47 | Assert(bv5<7) 48 | 49 | mf = g.maxFlowGreaterOrEqualTo(1,3,bv4) 50 | Assert(mf) 51 | Assert(Not(g.maxFlowGreaterOrEqualTo(1,3,bv5))) 52 | 53 | Assert(bv4+bv5==10) 54 | #Assert(bv4+bv5==11) 55 | #Assert(bv6>4) 56 | bvs=[bv0,bv1,bv2,bv3,bv4,bv5] 57 | #Assert(bv6>6) 58 | #Assert(bv6<10) 59 | 60 | result=Solve() 61 | 62 | print(str(result)) 63 | if result: 64 | print(bv1.value()) 65 | print(bv2.value()) 66 | print(bv3.value()) 67 | print(bv4.value()) 68 | print(bv5.value()) 69 | print(g.getMaxFlow(mf)) 70 | 71 | 72 | -------------------------------------------------------------------------------- /examples/python/test_maxflow_pb.py: -------------------------------------------------------------------------------- 1 | import random 2 | from monosat import * 3 | 4 | print("begin encode"); 5 | 6 | seed = random.randint(1,100000) 7 | 8 | random.seed(seed) 9 | print("RandomSeed=" + str(seed)) 10 | 11 | 12 | Monosat().newSolver("-decide-graph-bv -no-decide-theories -no-decide-graph-rnd -lazy-maxflow-decisions -conflict-min-cut -conflict-min-cut-maxflow -reach-underapprox-cnf ") 13 | 14 | 15 | 16 | 17 | 18 | 19 | g = Graph() 20 | 21 | nodes = [] 22 | for n in range(4): 23 | nodes.append(g.addNode()) 24 | 25 | 26 | a = g.addEdge(0,1) 27 | b = g.addEdge(1,2) 28 | c = g.addEdge(2,3) 29 | d = Var() 30 | Assert(Eq(d,Not(c))) 31 | AssertLessThanPB((a,b,Not(d)),4); 32 | 33 | mf = g.maxFlowGreaterOrEqualTo(0,3,1) 34 | Assert(mf) 35 | 36 | result=Solve() 37 | 38 | print(str(result)) 39 | if result: 40 | print(a.value()) 41 | print(b.value()) 42 | print(c.value()) 43 | 44 | print(g.getMaxFlow(mf)) 45 | for (v,w,var,wt) in g.getAllEdges(): 46 | #if var in model: 47 | if var.value(): 48 | print("%d->%d"%(v,w)) 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /examples/python/test_multiple_solvers.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | S1 = Monosat().newSolver() 4 | S2 = Monosat().newSolver() 5 | 6 | Monosat().setSolver(S1) 7 | 8 | a = Var() 9 | b = Var() 10 | c = Or(a, Not(b)) 11 | 12 | Assert(c) 13 | 14 | result = Solve() 15 | print(result) 16 | Monosat().setSolver(S2) 17 | a2 = Var() 18 | b2 = Var() 19 | c2 = Or(a2, Not(b2)) 20 | 21 | Assert(c2) 22 | Assert(~c2) 23 | 24 | result = Solve() 25 | print(result) 26 | 27 | Monosat().setSolver(S1) 28 | result = Solve() 29 | print(result) 30 | 31 | print(str(a)) 32 | print(str(a2)) 33 | 34 | found_error=False 35 | try: 36 | Assert(a2) 37 | except RuntimeError as e: 38 | #correct, there should be an error here 39 | found_error=True 40 | assert(found_error) 41 | 42 | Monosat().setSolver(S2) 43 | found_error=False 44 | try: 45 | Assert(a) 46 | except RuntimeError as e: 47 | #correct, there should be an error here 48 | found_error=True 49 | assert(found_error) 50 | 51 | print("Done") 52 | -------------------------------------------------------------------------------- /examples/python/test_pb.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | vars=[] 4 | for v in range(10): 5 | vars.append(Var()) 6 | 7 | AssertEqualPB(vars,2); 8 | AssertLessEqPB(vars, 4) 9 | AssertGreaterThanPB(vars, 1) 10 | 11 | result=Solve() 12 | for v in vars: 13 | print(v.value()) 14 | print("Result is " + str(result)) 15 | assert(result==True) 16 | 17 | -------------------------------------------------------------------------------- /examples/python/test_pb_opt.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | vars=[] 4 | for v in range(10): 5 | vars.append(Var()) 6 | 7 | AssertEqualPB(vars,2); 8 | AssertLessEqPB(vars, 4) 9 | AssertGreaterThanPB(vars, 1) 10 | 11 | weights = list(range(10)) 12 | 13 | maximize(vars,weights) 14 | result=Solve() 15 | sum = 0 16 | for i,v in enumerate(vars): 17 | print(v.value()) 18 | if (v.value()): 19 | sum+=weights[i] 20 | print("Result is " + str(result)) 21 | assert(result==True) 22 | 23 | -------------------------------------------------------------------------------- /examples/python/test_reach.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | g= Graph() 3 | e1 = g.addEdge(1,2) 4 | e2 = g.addEdge(2,3) 5 | e3 = g.addEdge(1,3) 6 | Assert(Not(And(e1,e3))) 7 | 8 | reaches = g.reaches(1,3) 9 | Assert(reaches) 10 | 11 | result = Solve() 12 | print(result) 13 | 14 | if result: 15 | #If the result is SAT, you can find the nodes that make up a satisfying path: 16 | path_by_nodes = g.getPath(reaches) 17 | print("Satisfying path (as a list of nodes): " +str(path_by_nodes)) 18 | #You can also list the edge literals that make up that path 19 | path_by_edges = g.getPath(reaches,return_edge_lits=True) 20 | for e in path_by_edges: 21 | v = e.value() 22 | assert(v) 23 | -------------------------------------------------------------------------------- /examples/python/test_shortestpaths.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | g= Graph() 3 | e1 = g.addEdge(1,2) 4 | e2 = g.addEdge(2,3) 5 | e3 = g.addEdge(1,3) 6 | Assert(Not(And(e1,e3))) 7 | 8 | dist = g.distance_lt(1,3,2) 9 | Assert(dist) 10 | 11 | result = Solve() 12 | print(result) 13 | 14 | if result: 15 | #If the result is SAT, you can find the nodes that make up a satisfying path: 16 | path_by_nodes = g.getPath(dist) 17 | print("Satisfying path (as a list of nodes): " +str(path_by_nodes)) 18 | #You can also list the edge literals that make up that path 19 | path_by_edges = g.getPath(dist,return_edge_lits=True) 20 | for e in path_by_edges: 21 | v = e.value() 22 | assert(v) 23 | -------------------------------------------------------------------------------- /examples/python/test_shortestpaths_bv.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | g= Graph() 3 | bv1 = BitVector(4) 4 | bv2 = BitVector(4) 5 | bv3 = BitVector(4) 6 | e1 = g.addEdge(1,2,bv1) 7 | e2 = g.addEdge(2,3,bv2) 8 | 9 | Assert(g.distance_leq(1,3,bv3)) 10 | Assert(Not(g.distance_lt(1,3,bv3))) 11 | 12 | Assert((bv1 + bv3)==9) 13 | 14 | result = Solve() 15 | if(result): 16 | print(result) 17 | print(e1.value()) 18 | print(e2.value()) 19 | print(bv1.value()) 20 | print(bv2.value()) 21 | print(bv3.value()) -------------------------------------------------------------------------------- /examples/python/test_unsat_gt.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | bv1 = BitVector(4) 4 | bv2 = BitVector(4) 5 | assert(Solve()) 6 | Assert(bv1==15) 7 | assert(Solve()) 8 | Assert(bv2>bv1) 9 | assert(not Solve()) 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/python/test_unsat_gt_logic.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | bv1 = BitVector(4) 4 | bv2 = BitVector(4) 5 | assert(Solve()) 6 | Assert(bv1==15) 7 | assert(Solve()) 8 | # The Logic.py Arithmetic operators do not apply to bitvectors 9 | # this method will throw an exception 10 | try: 11 | GreaterThan(bv2, bv1) 12 | assert(False,"Should throw exception because Logic.GreaterThan does not apply to bitvectors") 13 | except Exception: 14 | # Exception expected 15 | print("Logic.GreaterThan does not apply to bitvectors") 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/python/test_unsat_overflow_add.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | bv1 = BitVector(4) 4 | assert(Solve()) 5 | # 15 is the largest value representable in a 4 bit unsigned bitvector 6 | Assert(bv1==15) 7 | # In MonoSAT, bitvectors cannot overflow 8 | bv2 = bv1 + 1 9 | # so bv2 = 15 + 1 will be UNSAT (whereas in other SMT solvers this might be SAT) 10 | assert(not Solve()) 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_1.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2168 3114 3 | N 288 436 4 | N 2911 1828 5 | N 1481 830 6 | N 1866 3421 7 | N 1493 2307 8 | N 2988 2640 9 | N 1048 3106 10 | N 2234 3426 11 | N 80 61 12 | N 2081 3360 13 | N 2604 1633 14 | N 106 873 15 | N 1728 2131 16 | N 1334 2594 17 | N 2894 1109 18 | N 119 3206 19 | N 2158 2519 20 | N 666 2800 21 | N 1135 2827 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_10.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 156 1827 3 | N 36 1753 4 | N 1912 1072 5 | N 3101 130 6 | N 1893 260 7 | N 2835 143 8 | N 3326 2288 9 | N 1462 1106 10 | N 2632 1756 11 | N 2591 2539 12 | N 503 2969 13 | N 955 2368 14 | N 144 37 15 | N 495 3492 16 | N 2059 2963 17 | N 957 2540 18 | N 1715 2464 19 | N 1237 1974 20 | N 3190 1574 21 | N 135 1862 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_2.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 3295 303 3 | N 1385 653 4 | N 3107 3282 5 | N 979 818 6 | N 158 2617 7 | N 1630 1540 8 | N 2811 1975 9 | N 2063 1739 10 | N 1052 177 11 | N 115 1763 12 | N 1259 1498 13 | N 3447 2036 14 | N 2110 911 15 | N 74 1211 16 | N 491 1952 17 | N 1943 2143 18 | N 3431 3028 19 | N 2846 3513 20 | N 2938 3023 21 | N 1357 3263 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_3.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2235 514 3 | N 3503 1838 4 | N 2260 2284 5 | N 3480 1853 6 | N 2116 734 7 | N 1845 3214 8 | N 1835 2425 9 | N 595 2414 10 | N 3309 2039 11 | N 2844 2520 12 | N 289 2890 13 | N 157 2959 14 | N 3121 1075 15 | N 2310 3526 16 | N 1496 3045 17 | N 1678 2785 18 | N 2211 3568 19 | N 3368 383 20 | N 482 811 21 | N 2596 2967 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_4.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1155 2766 3 | N 1825 309 4 | N 64 2125 5 | N 1138 2931 6 | N 843 2073 7 | N 1043 709 8 | N 412 796 9 | N 119 2513 10 | N 1011 1071 11 | N 612 1099 12 | N 3340 3286 13 | N 3414 323 14 | N 2334 2541 15 | N 1944 675 16 | N 1815 317 17 | N 3179 2155 18 | N 1193 3480 19 | N 2178 3405 20 | N 3259 1968 21 | N 1572 2307 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_5.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 999 1367 3 | N 2690 2873 4 | N 3581 93 5 | N 1793 949 6 | N 221 657 7 | N 1387 3330 8 | N 1455 394 9 | N 936 2760 10 | N 1573 677 11 | N 3358 1489 12 | N 2890 291 13 | N 2348 1719 14 | N 488 3300 15 | N 780 829 16 | N 3310 1090 17 | N 740 3394 18 | N 2443 673 19 | N 764 1497 20 | N 79 1583 21 | N 3550 969 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_6.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2210 352 3 | N 2911 136 4 | N 540 2262 5 | N 2910 1427 6 | N 2960 1021 7 | N 3091 2772 8 | N 1615 2098 9 | N 2614 726 10 | N 2136 3104 11 | N 1006 3102 12 | N 2619 3245 13 | N 1287 1385 14 | N 1611 1011 15 | N 2668 2886 16 | N 2652 3040 17 | N 378 2222 18 | N 777 2512 19 | N 1438 3571 20 | N 3533 1932 21 | N 2496 3464 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_7.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 560 2485 3 | N 243 2092 4 | N 1386 217 5 | N 1978 133 6 | N 1625 266 7 | N 315 1655 8 | N 3123 456 9 | N 2414 2260 10 | N 2163 1537 11 | N 843 2102 12 | N 534 1578 13 | N 2049 2167 14 | N 2119 2632 15 | N 371 2197 16 | N 760 383 17 | N 2735 2164 18 | N 2343 1873 19 | N 2083 2967 20 | N 1760 3577 21 | N 1409 919 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_8.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1394 504 3 | N 2712 302 4 | N 908 1971 5 | N 1513 101 6 | N 1889 1469 7 | N 2191 3432 8 | N 1553 1865 9 | N 2894 2641 10 | N 1997 1826 11 | N 3537 2784 12 | N 2527 376 13 | N 292 2364 14 | N 1493 2526 15 | N 1263 2655 16 | N 2517 3453 17 | N 2233 591 18 | N 278 154 19 | N 2671 552 20 | N 2275 2789 21 | N 3397 1108 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_0/instance_N_20_M_3_C_0_9.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2369 1043 3 | N 668 2635 4 | N 1260 1772 5 | N 2337 1265 6 | N 3575 2679 7 | N 2762 624 8 | N 1725 1666 9 | N 610 195 10 | N 487 3332 11 | N 2279 2944 12 | N 1484 2870 13 | N 416 1138 14 | N 2593 2774 15 | N 1610 356 16 | N 1069 838 17 | N 1045 3081 18 | N 722 3405 19 | N 3360 206 20 | N 1497 1914 21 | N 68 1635 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_11.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 3328 3275 3 | N 2999 1709 4 | N 3272 757 5 | N 3071 1832 6 | N 2380 710 7 | N 1686 559 8 | N 2045 3411 9 | N 2444 2282 10 | N 1705 2861 11 | N 2499 2350 12 | N 3180 273 13 | N 123 3372 14 | N 2295 2941 15 | N 1229 2248 16 | N 773 873 17 | N 1120 31 18 | N 342 2489 19 | N 1577 3575 20 | N 353 1005 21 | N 2900 1934 22 | C 78 2178 23 | C 409 366 24 | C 1134 1084 25 | C 3241 781 26 | C 3553 1813 27 | C 2724 2726 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_12.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1050 2022 3 | N 1362 1449 4 | N 1380 3101 5 | N 2669 2335 6 | N 2114 2520 7 | N 579 1408 8 | N 1270 837 9 | N 2163 772 10 | N 1924 3163 11 | N 2601 3085 12 | N 353 3481 13 | N 3123 2578 14 | N 872 1625 15 | N 448 1662 16 | N 2048 3380 17 | N 2139 2650 18 | N 236 635 19 | N 3152 1505 20 | N 1598 2322 21 | N 1830 1478 22 | C 94 754 23 | C 2570 2542 24 | C 3323 3343 25 | C 439 435 26 | C 1401 1412 27 | C 3096 96 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_13.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1096 3523 3 | N 3103 3414 4 | N 2471 2534 5 | N 3309 2474 6 | N 706 248 7 | N 3274 2833 8 | N 78 507 9 | N 2633 38 10 | N 3197 309 11 | N 3055 3411 12 | N 1011 1732 13 | N 1667 3008 14 | N 1016 3262 15 | N 1874 2937 16 | N 2195 2547 17 | N 3383 2427 18 | N 2480 1327 19 | N 2332 2451 20 | N 2656 2128 21 | N 2859 1688 22 | C 2803 2794 23 | C 1091 671 24 | C 1353 1343 25 | C 989 985 26 | C 536 515 27 | C 2175 3375 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_14.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2346 2924 3 | N 2021 1035 4 | N 1007 2778 5 | N 2524 1168 6 | N 2609 1555 7 | N 2965 478 8 | N 856 3475 9 | N 1340 1011 10 | N 3083 2440 11 | N 573 2110 12 | N 2562 617 13 | N 2460 424 14 | N 1298 301 15 | N 797 1494 16 | N 2245 1739 17 | N 2337 3306 18 | N 2621 476 19 | N 2257 683 20 | N 415 3347 21 | N 1951 763 22 | C 1697 1877 23 | C 1131 1086 24 | C 3127 1027 25 | C 437 2837 26 | C 446 1646 27 | C 2610 2070 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_15.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 13 2853 3 | N 602 958 4 | N 181 3116 5 | N 583 2694 6 | N 923 1267 7 | N 2729 1042 8 | N 985 862 9 | N 3299 3313 10 | N 3082 860 11 | N 3559 1966 12 | N 866 1776 13 | N 1613 331 14 | N 2189 1431 15 | N 2188 3560 16 | N 2504 1528 17 | N 3349 291 18 | N 3211 721 19 | N 2048 2351 20 | N 2690 2814 21 | N 1081 1893 22 | C 3369 3429 23 | C 1507 247 24 | C 2789 2785 25 | C 1979 719 26 | C 1954 1925 27 | C 1155 1150 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_16.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1823 1110 3 | N 866 28 4 | N 3266 2742 5 | N 916 880 6 | N 1080 3139 7 | N 2541 2829 8 | N 1178 3001 9 | N 2294 76 10 | N 597 2331 11 | N 2442 1741 12 | N 2309 2740 13 | N 858 1190 14 | N 983 3026 15 | N 1325 1651 16 | N 2493 2171 17 | N 2238 1082 18 | N 3185 50 19 | N 1413 1875 20 | N 1149 1219 21 | N 1769 604 22 | C 1844 1724 23 | C 3353 3300 24 | C 3238 3224 25 | C 470 473 26 | C 339 341 27 | C 541 3481 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_17.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1593 1191 3 | N 1103 2951 4 | N 2745 2554 5 | N 437 118 6 | N 1455 2872 7 | N 986 1975 8 | N 1251 3280 9 | N 2803 505 10 | N 215 3128 11 | N 3410 552 12 | N 2756 2134 13 | N 2631 1273 14 | N 454 280 15 | N 1579 1925 16 | N 1854 2320 17 | N 2589 1611 18 | N 1972 1318 19 | N 1621 2183 20 | N 3423 2868 21 | N 202 1410 22 | C 2977 3337 23 | C 925 2125 24 | C 913 903 25 | C 257 252 26 | C 2327 1007 27 | C 1182 1160 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_18.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 431 1722 3 | N 921 1872 4 | N 1900 1811 5 | N 1758 1016 6 | N 972 2697 7 | N 1207 2613 8 | N 3048 3311 9 | N 951 910 10 | N 2832 2183 11 | N 752 2631 12 | N 3357 3228 13 | N 811 1185 14 | N 16 1521 15 | N 2954 1546 16 | N 1354 2197 17 | N 1053 1072 18 | N 2738 2119 19 | N 1087 2190 20 | N 1979 1869 21 | N 3043 3040 22 | C 730 2470 23 | C 3103 3068 24 | C 1946 1956 25 | C 3486 2226 26 | C 2056 2090 27 | C 3231 3185 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_19.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 163 3470 3 | N 453 752 4 | N 1345 1113 5 | N 577 998 6 | N 966 1226 7 | N 3197 2946 8 | N 3440 79 9 | N 2376 3372 10 | N 3484 432 11 | N 1774 3324 12 | N 286 411 13 | N 86 2226 14 | N 1666 3288 15 | N 1705 1182 16 | N 3516 3212 17 | N 3010 1600 18 | N 2954 2194 19 | N 406 831 20 | N 744 488 21 | N 1900 2106 22 | C 1785 3465 23 | C 2310 2010 24 | C 3150 3143 25 | C 3447 3387 26 | C 900 60 27 | C 1469 1447 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_10/instance_N_20_M_3_C_10_20.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2817 3043 3 | N 3409 597 4 | N 2596 3280 5 | N 417 1255 6 | N 3456 70 7 | N 1586 364 8 | N 1208 2250 9 | N 1588 733 10 | N 2420 2638 11 | N 1281 327 12 | N 2020 3231 13 | N 1531 785 14 | N 936 722 15 | N 306 972 16 | N 2924 1158 17 | N 1004 2350 18 | N 3427 1021 19 | N 885 3234 20 | N 2174 195 21 | N 3060 2381 22 | C 1039 2659 23 | C 1301 1318 24 | C 3549 3575 25 | C 1673 653 26 | C 3565 2665 27 | C 2948 2962 28 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_21.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1570 1604 3 | N 1120 3210 4 | N 3013 3090 5 | N 692 2012 6 | N 3015 0 7 | N 3563 1657 8 | N 544 2930 9 | N 3494 2654 10 | N 1622 2987 11 | N 1616 1719 12 | N 1262 1894 13 | N 464 1421 14 | N 541 3167 15 | N 425 3591 16 | N 1741 2110 17 | N 1306 1885 18 | N 669 162 19 | N 3330 952 20 | N 2944 792 21 | N 3103 2577 22 | C 2928 468 23 | C 1835 1812 24 | C 3561 3381 25 | C 1594 1583 26 | C 1948 1940 27 | C 1471 1441 28 | C 353 2753 29 | C 1905 285 30 | C 2315 2195 31 | C 1238 698 32 | C 642 653 33 | C 1319 1308 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_22.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 538 75 3 | N 1719 2651 4 | N 2827 3401 5 | N 3022 356 6 | N 1034 1203 7 | N 698 2159 8 | N 2803 1679 9 | N 3405 2163 10 | N 116 997 11 | N 1579 672 12 | N 474 2017 13 | N 2986 216 14 | N 1244 1299 15 | N 676 1165 16 | N 2997 2515 17 | N 572 3137 18 | N 2537 704 19 | N 207 2061 20 | N 177 3566 21 | N 1936 1998 22 | C 1616 1602 23 | C 3539 1199 24 | C 1416 1417 25 | C 1141 1188 26 | C 3463 3425 27 | C 1685 1686 28 | C 2967 2943 29 | C 3239 1979 30 | C 1515 375 31 | C 3449 629 32 | C 2041 2062 33 | C 1271 1300 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_23.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2999 3438 3 | N 353 2221 4 | N 1639 2004 5 | N 502 766 6 | N 1697 840 7 | N 1779 117 8 | N 306 1905 9 | N 86 2432 10 | N 1666 2962 11 | N 783 170 12 | N 1417 702 13 | N 819 1427 14 | N 2916 1435 15 | N 1116 1242 16 | N 336 1852 17 | N 2711 2250 18 | N 1730 2503 19 | N 670 711 20 | N 1234 3163 21 | N 753 457 22 | C 365 362 23 | C 1056 1072 24 | C 1297 3457 25 | C 2058 2097 26 | C 1789 1009 27 | C 369 2709 28 | C 3230 3195 29 | C 2061 3501 30 | C 2267 1487 31 | C 1690 190 32 | C 1600 1561 33 | C 3070 2590 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_24.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1485 2273 3 | N 791 730 4 | N 2530 343 5 | N 2925 3069 6 | N 1125 3586 7 | N 49 1768 8 | N 2815 460 9 | N 1981 1870 10 | N 3287 2608 11 | N 1879 2585 12 | N 1008 2393 13 | N 2590 1160 14 | N 2044 1421 15 | N 3462 3542 16 | N 1213 3441 17 | N 287 379 18 | N 2535 3098 19 | N 3129 1914 20 | N 1135 2117 21 | N 1067 779 22 | C 2165 2210 23 | C 2469 1209 24 | C 750 1830 25 | C 992 2072 26 | C 950 2450 27 | C 968 1001 28 | C 2494 1534 29 | C 3013 3025 30 | C 1804 1853 31 | C 980 2840 32 | C 3156 3141 33 | C 3415 3475 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_25.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2964 3239 3 | N 53 3553 4 | N 1195 1840 5 | N 3242 1008 6 | N 1142 1656 7 | N 2226 474 8 | N 2616 3226 9 | N 1932 2390 10 | N 3140 718 11 | N 1355 1832 12 | N 393 3236 13 | N 2620 2286 14 | N 1357 1346 15 | N 2592 2350 16 | N 269 1504 17 | N 276 2432 18 | N 2768 176 19 | N 694 3124 20 | N 877 1669 21 | N 2155 1648 22 | C 1911 1888 23 | C 3123 3138 24 | C 190 233 25 | C 1492 1441 26 | C 870 879 27 | C 1356 3216 28 | C 428 848 29 | C 703 883 30 | C 599 553 31 | C 2410 2423 32 | C 1399 1411 33 | C 1769 1768 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_26.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 3527 2532 3 | N 1633 2078 4 | N 483 2929 5 | N 150 2626 6 | N 1959 2410 7 | N 927 1607 8 | N 3285 3012 9 | N 3284 2521 10 | N 894 489 11 | N 2293 3210 12 | N 1488 923 13 | N 2272 61 14 | N 1127 2094 15 | N 454 152 16 | N 41 2309 17 | N 2142 3140 18 | N 3260 1662 19 | N 3267 764 20 | N 3363 736 21 | N 1479 1675 22 | C 2018 218 23 | C 246 2046 24 | C 2735 215 25 | C 806 818 26 | C 3529 3289 27 | C 1234 1594 28 | C 170 165 29 | C 2249 149 30 | C 382 3022 31 | C 485 502 32 | C 3536 3502 33 | C 1833 1845 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_27.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1841 1064 3 | N 738 244 4 | N 3136 1294 5 | N 1396 3173 6 | N 685 3495 7 | N 1875 292 8 | N 3526 2200 9 | N 341 3219 10 | N 2967 2846 11 | N 2523 1348 12 | N 3240 2512 13 | N 990 2348 14 | N 2361 881 15 | N 3165 573 16 | N 1506 1188 17 | N 2878 3590 18 | N 2942 2023 19 | N 605 2729 20 | N 969 214 21 | N 2471 1680 22 | C 589 596 23 | C 2196 2164 24 | C 1699 1702 25 | C 1380 3000 26 | C 676 682 27 | C 2036 956 28 | C 790 815 29 | C 1265 1308 30 | C 1503 1540 31 | C 1147 1190 32 | C 2675 1175 33 | C 1769 1772 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_28.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2827 2048 3 | N 2738 851 4 | N 2408 2909 5 | N 806 553 6 | N 625 533 7 | N 758 72 8 | N 926 364 9 | N 3446 2660 10 | N 532 3431 11 | N 1979 2673 12 | N 2566 1071 13 | N 879 2638 14 | N 508 12 15 | N 2999 2418 16 | N 1003 1985 17 | N 3514 1078 18 | N 466 1596 19 | N 656 1392 20 | N 124 2907 21 | N 3113 1411 22 | C 1450 1493 23 | C 3384 864 24 | C 1151 2831 25 | C 2084 2041 26 | C 734 3494 27 | C 1340 1326 28 | C 3151 2791 29 | C 2011 2071 30 | C 1730 1690 31 | C 1602 1782 32 | C 3535 3509 33 | C 914 14 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_29.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 275 2302 3 | N 2334 318 4 | N 3572 1522 5 | N 86 362 6 | N 1734 881 7 | N 1371 1865 8 | N 3501 2078 9 | N 3206 766 10 | N 628 1634 11 | N 1610 3043 12 | N 2203 753 13 | N 2614 1167 14 | N 1937 888 15 | N 1612 1850 16 | N 573 1188 17 | N 2737 1841 18 | N 3145 3279 19 | N 3469 2766 20 | N 1436 534 21 | N 556 1304 22 | C 291 250 23 | C 2426 2429 24 | C 3558 1218 25 | C 3347 2567 26 | C 17 1517 27 | C 1619 1679 28 | C 1089 3309 29 | C 235 2935 30 | C 1181 41 31 | C 2020 160 32 | C 2912 572 33 | C 2711 2723 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_20/instance_N_20_M_3_C_20_30.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 3094 2358 3 | N 2341 3161 4 | N 973 1503 5 | N 2484 308 6 | N 29 3573 7 | N 75 604 8 | N 3238 2332 9 | N 3513 3205 10 | N 1361 3394 11 | N 1504 901 12 | N 2211 1063 13 | N 1668 396 14 | N 2140 477 15 | N 1899 1199 16 | N 3188 3379 17 | N 979 332 18 | N 908 1244 19 | N 2947 1561 20 | N 2878 1172 21 | N 1991 701 22 | C 2490 2492 23 | C 3328 3333 24 | C 261 3561 25 | C 401 416 26 | C 991 976 27 | C 997 2617 28 | C 3131 1931 29 | C 1578 3558 30 | C 1813 1859 31 | C 3447 3452 32 | C 2544 2539 33 | C 3111 3083 34 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_31.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1800 2887 3 | N 565 163 4 | N 428 874 5 | N 2925 548 6 | N 167 222 7 | N 848 2794 8 | N 2008 806 9 | N 337 67 10 | N 3409 1285 11 | N 792 1521 12 | N 2303 795 13 | N 826 2246 14 | N 2142 183 15 | N 713 502 16 | N 553 3053 17 | N 84 2825 18 | N 3333 2488 19 | N 831 3013 20 | N 2787 743 21 | N 2481 892 22 | C 150 141 23 | C 1278 1290 24 | C 2501 2473 25 | C 407 417 26 | C 2111 2105 27 | C 731 3491 28 | C 2330 2324 29 | C 2526 2538 30 | C 1198 478 31 | C 749 748 32 | C 3025 2125 33 | C 465 426 34 | C 2455 775 35 | C 1272 2712 36 | C 594 543 37 | C 2371 2395 38 | C 2363 2380 39 | C 157 1897 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_32.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 3544 553 3 | N 2659 957 4 | N 91 166 5 | N 1206 1292 6 | N 233 2673 7 | N 1856 2303 8 | N 2040 3048 9 | N 1988 1860 10 | N 2986 773 11 | N 1133 779 12 | N 328 441 13 | N 1982 2767 14 | N 1690 1621 15 | N 3483 2102 16 | N 862 1750 17 | N 2779 1919 18 | N 2050 3172 19 | N 1187 2196 20 | N 336 169 21 | N 1117 1094 22 | C 321 2541 23 | C 3205 3207 24 | C 284 240 25 | C 712 670 26 | C 344 524 27 | C 1002 2142 28 | C 559 543 29 | C 2232 1872 30 | C 1920 1943 31 | C 1831 2371 32 | C 2000 860 33 | C 1464 1452 34 | C 3293 2333 35 | C 3163 3161 36 | C 503 23 37 | C 6 2946 38 | C 1254 1259 39 | C 1754 1745 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_33.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 636 880 3 | N 3232 1817 4 | N 3401 2097 5 | N 2038 2471 6 | N 2397 1232 7 | N 2023 1710 8 | N 2598 280 9 | N 1579 1999 10 | N 3451 2823 11 | N 3338 2627 12 | N 3147 1074 13 | N 1259 2915 14 | N 943 3307 15 | N 1203 1136 16 | N 3433 2824 17 | N 443 1241 18 | N 949 1052 19 | N 20 2002 20 | N 1182 1535 21 | N 684 463 22 | C 176 175 23 | C 2860 580 24 | C 425 420 25 | C 1563 1582 26 | C 3312 2592 27 | C 1481 1478 28 | C 3030 3037 29 | C 1774 1771 30 | C 4 24 31 | C 2904 2887 32 | C 3342 42 33 | C 2099 2086 34 | C 3320 3500 35 | C 2791 2762 36 | C 344 329 37 | C 1637 1636 38 | C 3390 3384 39 | C 2881 2900 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_34.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1353 97 3 | N 893 117 4 | N 1496 263 5 | N 1167 381 6 | N 1957 592 7 | N 1026 2362 8 | N 2940 2889 9 | N 333 231 10 | N 983 2147 11 | N 3225 3063 12 | N 3564 2230 13 | N 2455 1099 14 | N 1224 793 15 | N 2068 2291 16 | N 2168 1545 17 | N 1654 915 18 | N 3163 2227 19 | N 2862 3064 20 | N 1048 446 21 | N 1117 3538 22 | C 3012 1512 23 | C 2989 2968 24 | C 3535 2035 25 | C 3167 3146 26 | C 1795 1748 27 | C 848 1088 28 | C 259 273 29 | C 2226 2246 30 | C 899 894 31 | C 2899 2927 32 | C 3159 3124 33 | C 2764 1264 34 | C 1226 2966 35 | C 2831 2841 36 | C 1410 1380 37 | C 2759 2732 38 | C 3034 634 39 | C 437 425 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_35.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1295 528 3 | N 1307 595 4 | N 1638 2176 5 | N 2823 2913 6 | N 3595 1071 7 | N 1421 2751 8 | N 2278 2939 9 | N 1386 1920 10 | N 360 1906 11 | N 2783 1261 12 | N 1903 63 13 | N 1215 605 14 | N 621 276 15 | N 3270 323 16 | N 618 3523 17 | N 2048 3166 18 | N 3148 1231 19 | N 2365 144 20 | N 2956 2978 21 | N 1949 2915 22 | C 3362 2522 23 | C 2121 2106 24 | C 1444 1494 25 | C 1692 1723 26 | C 960 900 27 | C 2270 110 28 | C 342 462 29 | C 704 524 30 | C 3464 3459 31 | C 39 32 32 | C 2933 3233 33 | C 2088 2074 34 | C 2848 2871 35 | C 2643 2692 36 | C 2853 2854 37 | C 632 638 38 | C 1110 1137 39 | C 403 409 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_36.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 201 3061 3 | N 3538 1130 4 | N 356 1920 5 | N 700 1035 6 | N 2506 1407 7 | N 1055 274 8 | N 1596 1912 9 | N 1344 3108 10 | N 3385 1515 11 | N 430 1892 12 | N 2924 1993 13 | N 678 2731 14 | N 1237 3405 15 | N 635 2280 16 | N 3444 511 17 | N 3408 1573 18 | N 1437 831 19 | N 1915 3599 20 | N 2926 2356 21 | N 902 1960 22 | C 2489 2488 23 | C 346 1186 24 | C 2173 673 25 | C 2764 1384 26 | C 2727 2367 27 | C 631 605 28 | C 2466 2473 29 | C 2654 2649 30 | C 529 2089 31 | C 340 357 32 | C 1070 1038 33 | C 2040 2084 34 | C 3455 1175 35 | C 1862 1442 36 | C 463 446 37 | C 684 680 38 | C 3412 532 39 | C 1698 1686 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_37.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2323 3545 3 | N 2559 2873 4 | N 2453 152 5 | N 1420 2008 6 | N 410 1783 7 | N 3038 3558 8 | N 2844 1707 9 | N 3069 3237 10 | N 303 266 11 | N 1114 1439 12 | N 2741 3147 13 | N 2197 2423 14 | N 2205 3062 15 | N 2373 1933 16 | N 0 1961 17 | N 1438 2704 18 | N 877 1201 19 | N 2002 3130 20 | N 115 46 21 | N 837 2807 22 | C 2659 1939 23 | C 3521 3519 24 | C 1082 1125 25 | C 1813 793 26 | C 2357 1697 27 | C 388 1048 28 | C 941 1721 29 | C 521 502 30 | C 361 241 31 | C 636 3156 32 | C 1113 1081 33 | C 696 668 34 | C 433 1633 35 | C 2017 1357 36 | C 257 857 37 | C 648 628 38 | C 260 320 39 | C 139 3139 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_38.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 1600 2907 3 | N 406 1384 4 | N 1784 143 5 | N 2558 2230 6 | N 1222 2717 7 | N 2361 1186 8 | N 2910 1537 9 | N 3554 339 10 | N 1893 1629 11 | N 933 1440 12 | N 2783 3514 13 | N 3343 1959 14 | N 541 390 15 | N 436 527 16 | N 1797 425 17 | N 1549 2598 18 | N 1331 3509 19 | N 1886 2418 20 | N 676 987 21 | N 2684 2650 22 | C 323 2003 23 | C 2206 2866 24 | C 3294 3297 25 | C 959 953 26 | C 64 115 27 | C 2277 897 28 | C 564 599 29 | C 282 2322 30 | C 157 171 31 | C 540 548 32 | C 2037 1992 33 | C 1262 1301 34 | C 106 1786 35 | C 2084 1124 36 | C 496 491 37 | C 1981 2025 38 | C 1455 375 39 | C 2133 2073 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_39.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 973 84 3 | N 852 2785 4 | N 36 3101 5 | N 2596 2722 6 | N 3131 1081 7 | N 3403 294 8 | N 23 1626 9 | N 1642 2930 10 | N 3306 1945 11 | N 1177 2717 12 | N 1744 987 13 | N 1236 2746 14 | N 175 761 15 | N 2398 2397 16 | N 2370 2448 17 | N 3084 3080 18 | N 1458 1361 19 | N 510 1653 20 | N 664 3559 21 | N 2923 918 22 | C 2690 1550 23 | C 2811 2792 24 | C 1565 65 25 | C 2806 2760 26 | C 2336 2324 27 | C 3128 428 28 | C 1714 2014 29 | C 3116 3296 30 | C 2756 536 31 | C 334 321 32 | C 3476 3475 33 | C 3347 3227 34 | C 752 692 35 | C 658 620 36 | C 678 438 37 | C 2173 3313 38 | C 194 2474 39 | C 476 3056 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_3_C_30/instance_N_20_M_3_C_30_40.pcrt: -------------------------------------------------------------------------------- 1 | G 60 60 2 | N 2249 2036 3 | N 902 2538 4 | N 2560 493 5 | N 1368 3377 6 | N 1727 112 7 | N 3453 527 8 | N 2463 2352 9 | N 1785 234 10 | N 3011 1238 11 | N 967 560 12 | N 1970 3223 13 | N 3393 1566 14 | N 236 3173 15 | N 2780 1308 16 | N 2834 1149 17 | N 1990 2659 18 | N 1132 3029 19 | N 3430 817 20 | N 1651 273 21 | N 2230 2293 22 | C 2270 350 23 | C 2369 2347 24 | C 3192 1752 25 | C 389 400 26 | C 1315 1278 27 | C 2094 294 28 | C 3062 2282 29 | C 684 666 30 | C 2813 2772 31 | C 97 90 32 | C 3513 873 33 | C 3028 628 34 | C 1150 1182 35 | C 665 670 36 | C 949 709 37 | C 3063 783 38 | C 2606 2610 39 | C 1159 139 40 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_41.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 4248 2129 3 | N 7349 3688 4 | N 3570 9349 5 | N 7397 9901 6 | N 8431 5602 7 | N 1919 4092 8 | N 3221 8883 9 | N 7479 1507 10 | N 475 3655 11 | N 2794 9209 12 | N 9346 1660 13 | N 8571 1502 14 | N 1812 2288 15 | N 3406 2840 16 | N 379 7377 17 | N 5523 3807 18 | N 1851 8513 19 | N 5211 8402 20 | N 6384 2950 21 | N 1002 917 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_42.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1481 9403 3 | N 3135 1728 4 | N 1394 9486 5 | N 1169 5475 6 | N 304 2711 7 | N 6429 377 8 | N 2571 8391 9 | N 6989 2853 10 | N 7557 35 11 | N 2097 5489 12 | N 3543 2719 13 | N 4397 1113 14 | N 1248 4445 15 | N 3377 9305 16 | N 6858 4815 17 | N 7010 8037 18 | N 4679 2473 19 | N 890 8405 20 | N 9829 1037 21 | N 1229 3548 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_43.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3604 9789 3 | N 5918 8547 4 | N 1289 7658 5 | N 7763 6502 6 | N 7355 7947 7 | N 9670 5055 8 | N 722 1513 9 | N 1948 2012 10 | N 6365 9816 11 | N 7649 3464 12 | N 2373 848 13 | N 7406 2307 14 | N 2107 3537 15 | N 6609 1379 16 | N 8374 8683 17 | N 1207 5879 18 | N 9282 4242 19 | N 8567 5689 20 | N 1621 9910 21 | N 640 3475 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_44.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 6652 8969 3 | N 2214 2848 4 | N 337 1428 5 | N 172 2012 6 | N 6599 3888 7 | N 8188 7548 8 | N 9851 8588 9 | N 4541 4309 10 | N 7936 1420 11 | N 865 1275 12 | N 4034 8013 13 | N 437 4944 14 | N 6112 2460 15 | N 1624 9533 16 | N 9931 506 17 | N 8786 9055 18 | N 9404 8891 19 | N 8394 4742 20 | N 8060 7558 21 | N 1969 6129 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_45.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5334 3262 3 | N 3810 243 4 | N 6109 1401 5 | N 1536 9539 6 | N 483 879 7 | N 3417 1994 8 | N 9727 5491 9 | N 7809 1852 10 | N 789 2204 11 | N 3241 9945 12 | N 4092 5212 13 | N 211 4296 14 | N 4940 9589 15 | N 8467 8068 16 | N 7993 8289 17 | N 7532 784 18 | N 4763 4426 19 | N 8019 3102 20 | N 9163 5479 21 | N 2637 4953 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_46.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5109 7505 3 | N 2975 6681 4 | N 7419 468 5 | N 803 8040 6 | N 306 7017 7 | N 6737 9142 8 | N 1197 9050 9 | N 4661 6019 10 | N 959 9558 11 | N 6989 1479 12 | N 2855 6443 13 | N 9956 3591 14 | N 1319 4576 15 | N 7708 5842 16 | N 2351 3849 17 | N 9845 2699 18 | N 7414 7831 19 | N 9191 8690 20 | N 840 3696 21 | N 4714 2371 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_47.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 845 7055 3 | N 7358 3243 4 | N 4965 7850 5 | N 5305 384 6 | N 13 6133 7 | N 6992 4001 8 | N 5472 3029 9 | N 6566 5645 10 | N 430 4771 11 | N 8891 7645 12 | N 7143 9773 13 | N 3025 493 14 | N 4216 4612 15 | N 4974 6965 16 | N 1232 2983 17 | N 4289 6027 18 | N 1495 5398 19 | N 4577 3686 20 | N 3098 3371 21 | N 6845 572 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_48.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 4070 7116 3 | N 6891 6438 4 | N 9124 5597 5 | N 1921 1384 6 | N 8363 2728 7 | N 6597 6571 8 | N 6019 327 9 | N 5409 1608 10 | N 8663 1620 11 | N 8907 3770 12 | N 8943 1243 13 | N 3430 8233 14 | N 7301 8036 15 | N 4517 5583 16 | N 2522 7751 17 | N 335 1246 18 | N 7336 7537 19 | N 8963 9914 20 | N 2814 4218 21 | N 6860 4084 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_49.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 4408 1452 3 | N 9641 6570 4 | N 8706 9705 5 | N 3594 5819 6 | N 593 6980 7 | N 2864 3677 8 | N 4773 351 9 | N 9231 1217 10 | N 9354 4148 11 | N 4598 8334 12 | N 7851 679 13 | N 5284 6988 14 | N 2678 9883 15 | N 7208 6932 16 | N 6876 1740 17 | N 2862 3241 18 | N 5574 6278 19 | N 8988 9763 20 | N 3448 8899 21 | N 270 1969 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_0/instance_N_20_M_5_C_0_50.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3463 8146 3 | N 8831 9860 4 | N 1042 4068 5 | N 8628 1071 6 | N 4419 4412 7 | N 2840 824 8 | N 7742 5477 9 | N 1181 8808 10 | N 4277 8288 11 | N 55 4329 12 | N 5534 1389 13 | N 5625 8834 14 | N 5874 3416 15 | N 2679 7468 16 | N 5215 7987 17 | N 1589 6980 18 | N 5463 6866 19 | N 1686 7363 20 | N 3866 4711 21 | N 6697 19 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_51.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 6431 2070 3 | N 2931 3270 4 | N 7050 9359 5 | N 7089 8067 6 | N 7543 4684 7 | N 3549 8951 8 | N 1400 6803 9 | N 433 8661 10 | N 4422 3878 11 | N 5747 8397 12 | N 9724 397 13 | N 2156 160 14 | N 1307 7594 15 | N 2213 5970 16 | N 8702 5355 17 | N 4725 6214 18 | N 9970 7522 19 | N 5745 1563 20 | N 9766 8356 21 | N 5501 569 22 | C 6560 6760 23 | C 6839 6887 24 | C 4103 4167 25 | C 7411 7471 26 | C 2835 2875 27 | C 2761 4161 28 | C 3959 3925 29 | C 4570 4532 30 | C 9961 7061 31 | C 5481 1481 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_52.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 634 6592 3 | N 4761 452 4 | N 2017 2352 5 | N 5644 80 6 | N 6904 5649 7 | N 3001 2008 8 | N 6121 8029 9 | N 6235 6399 10 | N 1553 7904 11 | N 1148 5073 12 | N 4685 1669 13 | N 5018 8566 14 | N 9067 3522 15 | N 4111 8923 16 | N 7254 9184 17 | N 7654 2503 18 | N 2600 9283 19 | N 6167 1758 20 | N 9221 9715 21 | N 1123 8016 22 | C 2776 2725 23 | C 7271 7209 24 | C 2170 1970 25 | C 2964 2976 26 | C 3019 3067 27 | C 2585 8585 28 | C 1884 9284 29 | C 79 33 30 | C 5108 1608 31 | C 1966 9466 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_53.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 2778 6458 3 | N 6191 6691 4 | N 9346 9358 5 | N 403 4421 6 | N 1695 9533 7 | N 2107 4606 8 | N 5629 2925 9 | N 1716 6444 10 | N 8297 6540 11 | N 5184 4207 12 | N 1935 8611 13 | N 5270 5649 14 | N 8431 1999 15 | N 697 8257 16 | N 2961 7544 17 | N 1829 410 18 | N 8696 612 19 | N 6198 7050 20 | N 3241 730 21 | N 5349 2318 22 | C 6825 6882 23 | C 8446 6046 24 | C 6628 6644 25 | C 6222 7722 26 | C 1238 1208 27 | C 4849 3749 28 | C 8316 8329 29 | C 7658 3958 30 | C 2430 2462 31 | C 2954 2754 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_54.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5617 3871 3 | N 6261 2848 4 | N 4257 9373 5 | N 2648 2592 6 | N 6307 5770 7 | N 1176 4369 8 | N 3766 3453 9 | N 1869 8212 10 | N 3533 7556 11 | N 4804 186 12 | N 3446 2900 13 | N 293 9321 14 | N 4817 331 15 | N 2689 4857 16 | N 2274 3056 17 | N 8031 276 18 | N 6282 3071 19 | N 5043 5453 20 | N 4649 270 21 | N 5960 2737 22 | C 6145 6110 23 | C 8307 8329 24 | C 5964 9964 25 | C 7563 7564 26 | C 4039 4098 27 | C 1205 1249 28 | C 5351 5317 29 | C 4655 4662 30 | C 9555 1855 31 | C 7168 7159 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_55.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 2511 9419 3 | N 1038 2395 4 | N 1138 9245 5 | N 6084 4969 6 | N 6449 4051 7 | N 5492 9868 8 | N 580 3280 9 | N 2905 9065 10 | N 7301 2859 11 | N 4806 1129 12 | N 8264 5495 13 | N 2924 2697 14 | N 2152 4239 15 | N 1301 3952 16 | N 4641 2579 17 | N 5930 2122 18 | N 3928 2070 19 | N 2656 8138 20 | N 8916 5391 21 | N 7460 9477 22 | C 5113 3213 23 | C 8907 8938 24 | C 3440 1040 25 | C 5376 5363 26 | C 862 833 27 | C 4570 3570 28 | C 5028 5060 29 | C 2275 2207 30 | C 8130 8153 31 | C 9041 9071 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_56.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 171 8360 3 | N 3866 6998 4 | N 9053 1229 5 | N 7947 4308 6 | N 3282 2673 7 | N 9702 7406 8 | N 1771 8749 9 | N 1903 3149 10 | N 1223 2578 11 | N 2771 2356 12 | N 4991 8516 13 | N 9908 6727 14 | N 2386 2224 15 | N 7017 9463 16 | N 4681 8400 17 | N 486 4774 18 | N 7200 86 19 | N 7067 7812 20 | N 4963 4686 21 | N 4760 6524 22 | C 7059 7087 23 | C 8705 2305 24 | C 8943 8918 25 | C 2401 2418 26 | C 3274 3201 27 | C 316 365 28 | C 9820 620 29 | C 8874 8877 30 | C 3150 6550 31 | C 8161 8178 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_57.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 4705 7775 3 | N 2802 4165 4 | N 3761 8155 5 | N 248 2194 6 | N 7766 4847 7 | N 1350 9283 8 | N 8774 6962 9 | N 8232 1778 10 | N 1872 4817 11 | N 1971 5475 12 | N 9765 7522 13 | N 4655 6673 14 | N 2865 3530 15 | N 8550 5327 16 | N 157 5881 17 | N 257 649 18 | N 4379 6656 19 | N 597 5990 20 | N 7370 3802 21 | N 3800 4644 22 | C 8247 8202 23 | C 8660 1760 24 | C 8507 8535 25 | C 2090 3390 26 | C 5390 1890 27 | C 8872 9272 28 | C 9614 3414 29 | C 2640 7340 30 | C 8531 7331 31 | C 2270 1370 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_58.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 2574 9426 3 | N 2582 2405 4 | N 5157 3645 5 | N 5733 5378 6 | N 7436 113 7 | N 2762 9660 8 | N 5709 8470 9 | N 8448 747 10 | N 8512 1799 11 | N 438 3723 12 | N 2239 7778 13 | N 3192 8797 14 | N 2009 5725 15 | N 1616 9216 16 | N 329 3233 17 | N 9286 6112 18 | N 8564 3475 19 | N 8575 7442 20 | N 1651 3236 21 | N 5926 7825 22 | C 5829 2229 23 | C 6311 6341 24 | C 5788 5732 25 | C 6290 9990 26 | C 889 589 27 | C 2966 3666 28 | C 407 7307 29 | C 1508 6208 30 | C 7007 7085 31 | C 9062 9040 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_59.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1028 5883 3 | N 1702 9138 4 | N 8702 179 5 | N 4862 6862 6 | N 9738 9320 7 | N 4374 2285 8 | N 1467 4712 9 | N 582 3940 10 | N 511 9524 11 | N 7210 1178 12 | N 3832 8511 13 | N 9474 7782 14 | N 4313 1673 15 | N 5185 9901 16 | N 5711 6836 17 | N 2864 6643 18 | N 5186 3995 19 | N 8876 9816 20 | N 8107 4976 21 | N 5777 4665 22 | C 8887 8845 23 | C 6818 6118 24 | C 2770 8070 25 | C 2860 2829 26 | C 8480 8467 27 | C 699 603 28 | C 8340 8375 29 | C 8750 150 30 | C 5873 3173 31 | C 5372 6172 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_10/instance_N_20_M_5_C_10_60.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3639 1973 3 | N 2933 5961 4 | N 542 8511 5 | N 1923 549 6 | N 8130 5201 7 | N 2192 3916 8 | N 8079 1986 9 | N 7665 7571 10 | N 7606 1372 11 | N 1938 7202 12 | N 3728 6930 13 | N 835 1628 14 | N 3290 9326 15 | N 7425 1582 16 | N 4064 4663 17 | N 1148 8267 18 | N 412 7103 19 | N 1192 2210 20 | N 8849 7140 21 | N 4971 9994 22 | C 6949 4349 23 | C 4291 4209 24 | C 8965 8903 25 | C 3256 1456 26 | C 5328 7028 27 | C 555 502 28 | C 1354 7454 29 | C 9881 881 30 | C 4723 4763 31 | C 8617 7217 32 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_61.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 2363 2771 3 | N 3741 8841 4 | N 6203 4545 5 | N 5108 4259 6 | N 4221 80 7 | N 8864 8111 8 | N 4322 5503 9 | N 1618 5193 10 | N 3737 4394 11 | N 4056 4779 12 | N 8097 2280 13 | N 7891 5333 14 | N 2952 2316 15 | N 6907 6147 16 | N 6901 1049 17 | N 39 2254 18 | N 5913 9144 19 | N 5008 1427 20 | N 4579 4178 21 | N 6204 5434 22 | C 2450 950 23 | C 6350 8750 24 | C 8339 8380 25 | C 352 394 26 | C 9226 9220 27 | C 6497 6457 28 | C 1309 2209 29 | C 7715 9415 30 | C 3050 3350 31 | C 7298 7252 32 | C 6240 3240 33 | C 2331 2131 34 | C 5851 4051 35 | C 7519 7511 36 | C 8276 1876 37 | C 1347 2147 38 | C 963 935 39 | C 2955 2959 40 | C 8782 8792 41 | C 867 1767 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_62.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 2273 3008 3 | N 3959 4585 4 | N 6521 2023 5 | N 3300 2181 6 | N 315 6060 7 | N 266 4399 8 | N 8275 8820 9 | N 9127 4110 10 | N 5769 272 11 | N 5078 4339 12 | N 5946 3901 13 | N 7737 3054 14 | N 7888 2435 15 | N 7622 393 16 | N 7273 2574 17 | N 1801 1731 18 | N 8213 5746 19 | N 3862 4725 20 | N 2072 1843 21 | N 6951 4991 22 | C 5143 5100 23 | C 6946 1246 24 | C 9502 9514 25 | C 8592 8192 26 | C 4267 4287 27 | C 1783 1713 28 | C 3584 3515 29 | C 4551 4599 30 | C 4173 5173 31 | C 5908 5951 32 | C 8848 7248 33 | C 2191 7191 34 | C 492 443 35 | C 6252 6217 36 | C 304 8704 37 | C 939 998 38 | C 3077 3097 39 | C 2204 2212 40 | C 6282 6294 41 | C 4451 4466 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_63.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5656 3237 3 | N 8461 4911 4 | N 1095 8409 5 | N 3725 8009 6 | N 9539 778 7 | N 8428 4216 8 | N 3530 8676 9 | N 403 9176 10 | N 2920 7897 11 | N 5471 8155 12 | N 6246 2689 13 | N 413 4304 14 | N 4279 1596 15 | N 7302 7821 16 | N 5001 656 17 | N 747 647 18 | N 5444 3209 19 | N 6993 6886 20 | N 2508 2864 21 | N 5273 5884 22 | C 9520 4620 23 | C 5127 5186 24 | C 1969 1961 25 | C 5415 4615 26 | C 1616 1606 27 | C 3063 1363 28 | C 8053 5053 29 | C 9937 9913 30 | C 6175 2875 31 | C 9944 9644 32 | C 8169 8160 33 | C 811 846 34 | C 2055 8455 35 | C 3361 4561 36 | C 7547 8347 37 | C 3853 5253 38 | C 658 652 39 | C 9907 9947 40 | C 5247 5261 41 | C 5993 5910 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_64.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1560 7880 3 | N 6851 287 4 | N 3426 8090 5 | N 2597 9989 6 | N 1883 5310 7 | N 2556 392 8 | N 5110 86 9 | N 2208 7513 10 | N 7505 2833 11 | N 2569 311 12 | N 5898 2750 13 | N 9537 7017 14 | N 4554 3965 15 | N 4695 6288 16 | N 2266 6 17 | N 5929 2720 18 | N 728 3582 19 | N 8627 331 20 | N 3892 2014 21 | N 2838 7282 22 | C 3086 1986 23 | C 3378 3356 24 | C 9038 9021 25 | C 1935 3835 26 | C 1605 1405 27 | C 6515 2115 28 | C 7142 7154 29 | C 560 540 30 | C 6588 688 31 | C 8895 8886 32 | C 9718 6418 33 | C 3942 5042 34 | C 4749 4149 35 | C 153 3953 36 | C 8184 4884 37 | C 9823 6023 38 | C 7235 7210 39 | C 3840 3803 40 | C 4654 9654 41 | C 6015 6094 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_65.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3653 6536 3 | N 5628 6758 4 | N 7056 8143 5 | N 2855 7109 6 | N 3359 8325 7 | N 7960 588 8 | N 1432 6720 9 | N 1794 1587 10 | N 8817 4744 11 | N 8373 7946 12 | N 8129 5029 13 | N 6057 8906 14 | N 9719 9902 15 | N 3242 9740 16 | N 134 9422 17 | N 955 7033 18 | N 2301 7320 19 | N 5568 1655 20 | N 9766 9453 21 | N 4194 3028 22 | C 7138 7124 23 | C 7347 3847 24 | C 885 836 25 | C 2058 1658 26 | C 3511 3575 27 | C 5090 5069 28 | C 8310 8319 29 | C 6220 6280 30 | C 6137 6164 31 | C 3982 7682 32 | C 9060 1160 33 | C 6623 6668 34 | C 488 3388 35 | C 8492 1692 36 | C 8733 8730 37 | C 5039 5339 38 | C 7917 7983 39 | C 7211 7234 40 | C 2828 6728 41 | C 9779 9794 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_66.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3909 3155 3 | N 3757 7132 4 | N 9512 2363 5 | N 6659 9116 6 | N 9108 9346 7 | N 5221 9093 8 | N 8158 364 9 | N 1467 1749 10 | N 347 9001 11 | N 8926 7859 12 | N 8526 7740 13 | N 3961 3725 14 | N 2508 4196 15 | N 4585 951 16 | N 1139 3451 17 | N 7802 4415 18 | N 7760 753 19 | N 5083 9071 20 | N 9412 5477 21 | N 6140 4647 22 | C 2792 92 23 | C 3940 3640 24 | C 4160 4143 25 | C 7704 9404 26 | C 4236 4336 27 | C 9907 9914 28 | C 5002 2102 29 | C 1999 9899 30 | C 1293 1212 31 | C 1271 1289 32 | C 7249 849 33 | C 9994 6394 34 | C 8599 2299 35 | C 6171 6127 36 | C 1277 1255 37 | C 2790 2753 38 | C 4410 5110 39 | C 8621 9221 40 | C 7218 918 41 | C 199 7599 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_67.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1409 5298 3 | N 5359 7634 4 | N 6254 3579 5 | N 8226 8505 6 | N 3622 2004 7 | N 2356 8715 8 | N 6212 3139 9 | N 9551 175 10 | N 8350 9367 11 | N 2090 4719 12 | N 66 5689 13 | N 9397 8329 14 | N 8685 549 15 | N 2045 7155 16 | N 7600 4456 17 | N 330 7717 18 | N 2100 3077 19 | N 8694 956 20 | N 350 7333 21 | N 1763 2494 22 | C 6867 8867 23 | C 8281 8238 24 | C 1570 1508 25 | C 5637 5698 26 | C 30 6430 27 | C 6258 4058 28 | C 6112 6139 29 | C 6475 6487 30 | C 9366 9304 31 | C 1283 1209 32 | C 8664 5864 33 | C 1715 1798 34 | C 8536 6836 35 | C 5706 9006 36 | C 3482 3407 37 | C 2888 1988 38 | C 9657 5857 39 | C 4464 1464 40 | C 4484 7984 41 | C 7645 4545 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_68.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5994 9588 3 | N 1464 7477 4 | N 5531 3360 5 | N 8692 5642 6 | N 4670 7021 7 | N 9983 1599 8 | N 6905 6193 9 | N 4313 1107 10 | N 2277 9924 11 | N 24 5467 12 | N 6856 6748 13 | N 8916 7186 14 | N 7503 1880 15 | N 7275 1844 16 | N 115 4861 17 | N 7796 3688 18 | N 2510 5454 19 | N 5249 9415 20 | N 5332 8422 21 | N 405 4952 22 | C 9720 1120 23 | C 4595 4599 24 | C 7533 6133 25 | C 5948 5971 26 | C 9764 9748 27 | C 3881 381 28 | C 6785 5685 29 | C 7327 7376 30 | C 4426 4438 31 | C 1486 886 32 | C 3573 4473 33 | C 3703 7403 34 | C 5459 5444 35 | C 9313 9382 36 | C 4153 9553 37 | C 2621 2642 38 | C 3087 3062 39 | C 7290 7254 40 | C 1587 1533 41 | C 6096 3196 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_69.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 487 2112 3 | N 7708 4144 4 | N 5370 5459 5 | N 5672 4166 6 | N 7071 1856 7 | N 5052 5308 8 | N 1836 1825 9 | N 2739 8488 10 | N 9296 2664 11 | N 1213 7949 12 | N 893 9233 13 | N 4777 805 14 | N 2712 1803 15 | N 3131 1935 16 | N 8061 8910 17 | N 8142 6833 18 | N 5366 3204 19 | N 9410 3915 20 | N 8350 1934 21 | N 6285 8280 22 | C 6080 3580 23 | C 2368 2327 24 | C 3483 3462 25 | C 5398 5385 26 | C 872 886 27 | C 7364 7307 28 | C 5610 5616 29 | C 8815 8863 30 | C 326 348 31 | C 3189 3156 32 | C 719 714 33 | C 6470 6370 34 | C 7557 7757 35 | C 7092 7010 36 | C 5015 9615 37 | C 871 8971 38 | C 9690 9696 39 | C 6817 6874 40 | C 6890 6815 41 | C 4948 4979 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_20/instance_N_20_M_5_C_20_70.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 3715 5889 3 | N 1757 1341 4 | N 8619 7686 5 | N 9127 5285 6 | N 3048 8351 7 | N 6409 9840 8 | N 4835 5799 9 | N 1112 6204 10 | N 3644 317 11 | N 5733 9896 12 | N 6315 890 13 | N 4517 2968 14 | N 1076 6607 15 | N 9650 9805 16 | N 9594 1839 17 | N 4579 2515 18 | N 7419 8469 19 | N 9309 5037 20 | N 1913 5563 21 | N 3498 7769 22 | C 1965 3465 23 | C 9097 9011 24 | C 2394 1094 25 | C 759 8559 26 | C 3227 3327 27 | C 8495 7395 28 | C 9054 854 29 | C 3659 2459 30 | C 4051 6651 31 | C 3384 3304 32 | C 4766 1366 33 | C 469 5369 34 | C 4130 4196 35 | C 6031 1031 36 | C 7785 7743 37 | C 9333 9833 38 | C 6472 7672 39 | C 1624 6024 40 | C 9068 9003 41 | C 1665 1663 42 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_71.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 6541 179 3 | N 1933 2596 4 | N 1133 6525 5 | N 7607 6424 6 | N 8803 4667 7 | N 9758 4416 8 | N 2182 4404 9 | N 377 8249 10 | N 2474 4119 11 | N 5755 8412 12 | N 3102 1877 13 | N 3119 6594 14 | N 3845 274 15 | N 4432 5026 16 | N 803 3112 17 | N 3712 5317 18 | N 6361 7298 19 | N 4576 1237 20 | N 3826 2779 21 | N 7320 6056 22 | C 4169 4112 23 | C 9686 9689 24 | C 395 2495 25 | C 6028 6089 26 | C 6464 6431 27 | C 1834 6334 28 | C 5968 1668 29 | C 1176 8076 30 | C 3556 3554 31 | C 3933 3968 32 | C 4092 4070 33 | C 63 27 34 | C 3858 3887 35 | C 601 654 36 | C 4108 4308 37 | C 8876 5776 38 | C 7386 7375 39 | C 661 648 40 | C 7213 7239 41 | C 7094 7092 42 | C 282 248 43 | C 5241 5246 44 | C 1373 1377 45 | C 960 963 46 | C 6120 6150 47 | C 5723 5757 48 | C 7816 716 49 | C 972 930 50 | C 8318 2418 51 | C 9658 4658 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_72.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 7609 2394 3 | N 8944 7969 4 | N 3947 9194 5 | N 7687 8916 6 | N 4388 4829 7 | N 8118 8803 8 | N 5828 5701 9 | N 9808 1137 10 | N 4064 292 11 | N 3253 4434 12 | N 2847 6247 13 | N 3181 7544 14 | N 8963 3823 15 | N 7352 1942 16 | N 2758 705 17 | N 5342 4807 18 | N 1809 738 19 | N 6256 8405 20 | N 6269 5070 21 | N 1529 7163 22 | C 1089 1058 23 | C 6142 1042 24 | C 8338 8388 25 | C 3046 6446 26 | C 1834 5334 27 | C 184 8284 28 | C 2663 4063 29 | C 7925 1525 30 | C 5641 4541 31 | C 8375 9875 32 | C 6700 6719 33 | C 1348 1389 34 | C 3889 3872 35 | C 3522 8522 36 | C 2161 2149 37 | C 392 310 38 | C 6524 6546 39 | C 458 7858 40 | C 9241 9141 41 | C 8645 1645 42 | C 5213 1513 43 | C 4304 4345 44 | C 192 6792 45 | C 8424 2624 46 | C 4935 8935 47 | C 9909 9930 48 | C 319 1819 49 | C 8641 9341 50 | C 7084 7011 51 | C 8670 5770 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_73.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1535 6164 3 | N 2372 3859 4 | N 975 5162 5 | N 6466 5725 6 | N 214 5232 7 | N 399 4553 8 | N 5471 7063 9 | N 2355 3307 10 | N 7672 9125 11 | N 5911 4491 12 | N 1637 329 13 | N 3427 9035 14 | N 9706 6430 15 | N 7821 1055 16 | N 8610 8310 17 | N 1624 1871 18 | N 5956 9898 19 | N 9062 3071 20 | N 3844 725 21 | N 1352 5054 22 | C 8407 4607 23 | C 2152 2199 24 | C 1162 3062 25 | C 7015 7049 26 | C 3352 3310 27 | C 462 1362 28 | C 3381 3370 29 | C 8211 4111 30 | C 2905 605 31 | C 3792 8892 32 | C 1799 1703 33 | C 9187 9175 34 | C 8283 283 35 | C 9626 6726 36 | C 8430 8417 37 | C 9649 1449 38 | C 5278 5272 39 | C 3448 3848 40 | C 6098 6017 41 | C 5256 5249 42 | C 6321 6346 43 | C 8167 3467 44 | C 8647 1147 45 | C 6576 6568 46 | C 8091 8066 47 | C 8010 8067 48 | C 8949 8959 49 | C 9852 552 50 | C 9325 625 51 | C 2747 2761 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_74.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 6578 4014 3 | N 3915 2723 4 | N 1544 5856 5 | N 3567 2157 6 | N 3540 7964 7 | N 8800 565 8 | N 2916 1956 9 | N 5376 3430 10 | N 8432 55 11 | N 2570 2084 12 | N 772 2794 13 | N 4291 205 14 | N 8802 5013 15 | N 7288 9163 16 | N 1850 2189 17 | N 2276 5599 18 | N 5959 7948 19 | N 2913 723 20 | N 6356 6016 21 | N 2419 8439 22 | C 3602 3665 23 | C 3891 3822 24 | C 1447 7247 25 | C 8222 8252 26 | C 9991 8191 27 | C 4193 9593 28 | C 7615 7627 29 | C 7816 7836 30 | C 1769 8969 31 | C 7971 7980 32 | C 8793 3893 33 | C 1061 1087 34 | C 8904 2304 35 | C 5384 5364 36 | C 1683 1693 37 | C 6518 6595 38 | C 3266 3271 39 | C 5494 7394 40 | C 2277 3677 41 | C 2086 9486 42 | C 9449 9415 43 | C 1934 1921 44 | C 1261 261 45 | C 4381 2481 46 | C 1604 5204 47 | C 3179 5879 48 | C 5226 126 49 | C 3121 8521 50 | C 1348 1372 51 | C 4136 4167 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_75.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 7457 5855 3 | N 9305 6598 4 | N 8586 8660 5 | N 8886 1244 6 | N 4088 9610 7 | N 3532 9263 8 | N 4485 8477 9 | N 3462 352 10 | N 6948 8773 11 | N 8659 1625 12 | N 1825 6338 13 | N 2176 259 14 | N 7839 791 15 | N 708 4134 16 | N 724 5211 17 | N 3915 6646 18 | N 1486 5983 19 | N 3737 8472 20 | N 3127 8048 21 | N 9089 300 22 | C 4138 4137 23 | C 6702 9902 24 | C 7070 7001 25 | C 7134 7123 26 | C 3345 3363 27 | C 6290 5090 28 | C 4633 4644 29 | C 3612 3650 30 | C 242 241 31 | C 4778 4777 32 | C 4709 7209 33 | C 5103 5124 34 | C 5745 1845 35 | C 9567 467 36 | C 5654 5683 37 | C 9461 61 38 | C 9955 9999 39 | C 4610 1910 40 | C 2732 2762 41 | C 6354 4954 42 | C 5118 4418 43 | C 2731 6831 44 | C 8646 8635 45 | C 2760 2717 46 | C 8387 8357 47 | C 593 5093 48 | C 3934 2034 49 | C 4909 9809 50 | C 2241 2441 51 | C 6094 6043 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_76.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5947 2549 3 | N 638 3053 4 | N 3836 5696 5 | N 2962 4210 6 | N 2938 6842 7 | N 7 5284 8 | N 7775 9549 9 | N 4230 5869 10 | N 803 8084 11 | N 1951 3112 12 | N 9781 1182 13 | N 9194 8738 14 | N 1373 6593 15 | N 113 2602 16 | N 6363 7822 17 | N 5276 6956 18 | N 2355 7201 19 | N 6083 2548 20 | N 5896 7599 21 | N 5546 7119 22 | C 2377 1777 23 | C 1568 7668 24 | C 1119 1148 25 | C 9348 8948 26 | C 519 6219 27 | C 9208 508 28 | C 8491 8457 29 | C 7497 6497 30 | C 611 686 31 | C 1441 5541 32 | C 1584 4584 33 | C 5154 5157 34 | C 7843 7806 35 | C 4936 2936 36 | C 1540 6240 37 | C 5224 5267 38 | C 2038 2095 39 | C 6457 2757 40 | C 8969 8955 41 | C 6391 1291 42 | C 3752 3780 43 | C 1260 2060 44 | C 3828 9428 45 | C 7064 7033 46 | C 8757 1057 47 | C 5994 5920 48 | C 6057 6082 49 | C 1930 1330 50 | C 9862 5462 51 | C 3997 5197 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_77.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 4132 3025 3 | N 1424 6037 4 | N 7871 1830 5 | N 8071 6484 6 | N 3500 6303 7 | N 2422 4964 8 | N 4223 1541 9 | N 7011 3399 10 | N 6068 2826 11 | N 924 2510 12 | N 7189 7656 13 | N 6890 1209 14 | N 9490 9527 15 | N 1142 7312 16 | N 1059 1368 17 | N 5634 9980 18 | N 1570 6744 19 | N 9807 9651 20 | N 7774 3167 21 | N 7328 5160 22 | C 1794 1701 23 | C 604 680 24 | C 9505 9597 25 | C 1555 1564 26 | C 8872 8807 27 | C 6083 1883 28 | C 6738 238 29 | C 4562 4573 30 | C 700 718 31 | C 9697 8997 32 | C 3001 8501 33 | C 1459 1460 34 | C 1713 3313 35 | C 9826 2026 36 | C 1921 621 37 | C 8529 8573 38 | C 9391 9362 39 | C 3464 6064 40 | C 5379 5369 41 | C 3635 3624 42 | C 7502 7509 43 | C 204 104 44 | C 8411 6511 45 | C 8626 9926 46 | C 2154 8554 47 | C 3649 3662 48 | C 8868 8824 49 | C 5483 5436 50 | C 6711 6740 51 | C 9924 9947 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_78.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 1224 8538 3 | N 3293 5495 4 | N 8304 8318 5 | N 9851 2484 6 | N 6089 6948 7 | N 3001 2292 8 | N 5444 8043 9 | N 8952 2223 10 | N 9699 4646 11 | N 2606 1298 12 | N 1824 3759 13 | N 7618 6782 14 | N 9132 8021 15 | N 8564 8995 16 | N 9249 9210 17 | N 64 5814 18 | N 4686 5529 19 | N 5210 2452 20 | N 8586 16 21 | N 4773 6940 22 | C 3870 8570 23 | C 6470 2670 24 | C 2050 250 25 | C 5613 5617 26 | C 3810 5710 27 | C 5988 5955 28 | C 816 2616 29 | C 6154 1454 30 | C 2711 3911 31 | C 2841 4041 32 | C 8338 1338 33 | C 1961 7261 34 | C 380 300 35 | C 462 450 36 | C 4829 5029 37 | C 6109 6909 38 | C 5637 6137 39 | C 4473 4444 40 | C 2163 5263 41 | C 6047 6006 42 | C 1669 6269 43 | C 8669 8678 44 | C 6858 6824 45 | C 1919 1985 46 | C 9118 3318 47 | C 5446 46 48 | C 7480 7471 49 | C 3370 3374 50 | C 7779 7771 51 | C 2793 2702 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_79.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5618 7644 3 | N 3020 9231 4 | N 6388 819 5 | N 344 1425 6 | N 6292 3991 7 | N 5222 8861 8 | N 7947 4811 9 | N 3313 6299 10 | N 9005 4288 11 | N 9492 9558 12 | N 710 1258 13 | N 1480 2330 14 | N 3451 2844 15 | N 4089 3459 16 | N 822 7404 17 | N 8984 4670 18 | N 1806 2640 19 | N 3488 9843 20 | N 6702 8192 21 | N 6420 6679 22 | C 280 202 23 | C 5496 8396 24 | C 1 5101 25 | C 5686 5629 26 | C 4726 9426 27 | C 7170 9570 28 | C 1892 1811 29 | C 668 670 30 | C 6218 2218 31 | C 8672 8689 32 | C 1525 3625 33 | C 3355 3394 34 | C 2430 2432 35 | C 2230 530 36 | C 3375 3300 37 | C 1499 8999 38 | C 8650 8691 39 | C 4588 4548 40 | C 3568 3564 41 | C 3796 3716 42 | C 9542 9595 43 | C 1919 6719 44 | C 9012 9077 45 | C 6697 6668 46 | C 7217 7280 47 | C 8458 6158 48 | C 5992 9192 49 | C 8262 8250 50 | C 3970 1770 51 | C 5508 4708 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_5_C_30/instance_N_20_M_5_C_30_80.pcrt: -------------------------------------------------------------------------------- 1 | G 100 100 2 | N 5034 9069 3 | N 4753 6846 4 | N 4751 7003 5 | N 4997 7928 6 | N 4906 2130 7 | N 7267 1801 8 | N 7957 2016 9 | N 4729 7545 10 | N 8022 3426 11 | N 1033 1240 12 | N 284 95 13 | N 6719 3837 14 | N 7947 374 15 | N 6340 1394 16 | N 8131 6963 17 | N 6547 694 18 | N 2557 4035 19 | N 9961 4485 20 | N 8688 6401 21 | N 4905 1527 22 | C 1384 2184 23 | C 7704 7745 24 | C 8961 7061 25 | C 4310 4316 26 | C 5361 2061 27 | C 5527 5582 28 | C 9718 918 29 | C 5019 5064 30 | C 3843 3824 31 | C 2174 2198 32 | C 7155 7115 33 | C 372 346 34 | C 5249 3149 35 | C 991 926 36 | C 3571 3541 37 | C 3779 3776 38 | C 1521 9121 39 | C 2319 8219 40 | C 5914 5902 41 | C 8890 8823 42 | C 1214 7714 43 | C 8085 2585 44 | C 4235 4208 45 | C 2042 4142 46 | C 5251 5269 47 | C 5908 5952 48 | C 7578 8378 49 | C 109 156 50 | C 9725 7925 51 | C 9435 9455 52 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_81.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 16369 19126 3 | N 17178 5604 4 | N 16138 11340 5 | N 12813 10976 6 | N 2693 18394 7 | N 6516 6664 8 | N 8358 8794 9 | N 674 12570 10 | N 12534 12530 11 | N 5765 15275 12 | N 9598 8026 13 | N 3618 6777 14 | N 6609 13656 15 | N 569 19280 16 | N 4804 13611 17 | N 8639 12469 18 | N 8123 16334 19 | N 11027 15004 20 | N 15268 3410 21 | N 18766 6840 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_82.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 17537 10489 3 | N 5925 5666 4 | N 15408 3620 5 | N 10970 4374 6 | N 3063 12543 7 | N 3205 6564 8 | N 8540 10871 9 | N 19186 15774 10 | N 13826 14074 11 | N 904 10730 12 | N 8708 1616 13 | N 194 4431 14 | N 12058 14426 15 | N 105 12677 16 | N 3270 15377 17 | N 3506 14693 18 | N 18154 2783 19 | N 2747 16066 20 | N 13540 1630 21 | N 17349 8773 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_83.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 16507 4502 3 | N 1216 7572 4 | N 6208 3019 5 | N 14713 12639 6 | N 7217 8241 7 | N 5994 991 8 | N 16665 13809 9 | N 11387 16362 10 | N 15762 4818 11 | N 18304 4527 12 | N 13163 6833 13 | N 1234 16831 14 | N 5289 9714 15 | N 3565 2740 16 | N 3820 2485 17 | N 9006 9779 18 | N 14781 5867 19 | N 8907 776 20 | N 15669 14254 21 | N 1846 4036 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_84.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 1332 265 3 | N 11473 16430 4 | N 13147 19498 5 | N 18826 14399 6 | N 7924 16972 7 | N 18351 5331 8 | N 17791 10495 9 | N 3917 8543 10 | N 15171 10394 11 | N 9688 3670 12 | N 2659 1099 13 | N 17257 4766 14 | N 5648 6647 15 | N 13241 11057 16 | N 17538 6268 17 | N 2664 16943 18 | N 9156 5202 19 | N 18871 13958 20 | N 12669 9749 21 | N 166 12673 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_85.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 3831 6942 3 | N 16576 7928 4 | N 19276 8117 5 | N 15519 170 6 | N 15418 16220 7 | N 8103 4536 8 | N 4026 5829 9 | N 13582 17956 10 | N 1458 12017 11 | N 2000 3707 12 | N 5706 12924 13 | N 5989 8883 14 | N 6392 5250 15 | N 16221 5626 16 | N 9534 7220 17 | N 746 13808 18 | N 5038 4524 19 | N 10532 9334 20 | N 19086 1466 21 | N 2621 5589 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_86.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 11347 2383 3 | N 10908 3736 4 | N 3489 16484 5 | N 7560 13073 6 | N 6175 10181 7 | N 16961 3180 8 | N 17155 17675 9 | N 15355 13689 10 | N 7331 14150 11 | N 11405 13434 12 | N 13953 15645 13 | N 5945 19026 14 | N 15095 3654 15 | N 6303 13604 16 | N 8104 557 17 | N 1959 11769 18 | N 8656 1933 19 | N 11051 11807 20 | N 17176 18677 21 | N 15115 6574 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_87.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6757 3778 3 | N 11971 11759 4 | N 13051 9803 5 | N 3178 18467 6 | N 7157 6644 7 | N 10940 9947 8 | N 15507 16183 9 | N 12372 17129 10 | N 1335 3717 11 | N 12253 9384 12 | N 2081 19055 13 | N 2129 17438 14 | N 15311 631 15 | N 4561 10317 16 | N 13937 8319 17 | N 8769 6945 18 | N 1428 10565 19 | N 7794 19377 20 | N 11028 14739 21 | N 8950 1344 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_88.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6821 6665 3 | N 18763 12182 4 | N 4878 4397 5 | N 6195 14813 6 | N 15622 10955 7 | N 4241 12158 8 | N 5475 15883 9 | N 7890 465 10 | N 18820 19016 11 | N 17786 18436 12 | N 16898 2508 13 | N 5305 517 14 | N 4515 11169 15 | N 4765 18506 16 | N 13741 12113 17 | N 15595 18433 18 | N 16526 11711 19 | N 5699 11148 20 | N 18589 14785 21 | N 1661 15616 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_89.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 9260 12355 3 | N 5336 12006 4 | N 10693 2745 5 | N 16703 7980 6 | N 16557 11493 7 | N 2543 17045 8 | N 14441 11971 9 | N 175 5185 10 | N 8108 5203 11 | N 227 5689 12 | N 6239 17497 13 | N 16901 18707 14 | N 7353 11189 15 | N 8671 15631 16 | N 5947 10909 17 | N 13221 16111 18 | N 11094 10437 19 | N 15277 15588 20 | N 1792 8432 21 | N 16599 18761 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_0/instance_N_20_M_7_C_0_90.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 3272 11183 3 | N 16190 9458 4 | N 9785 2754 5 | N 5179 13590 6 | N 16475 4647 7 | N 18899 1866 8 | N 859 18091 9 | N 7633 3671 10 | N 2768 2 11 | N 8701 1021 12 | N 18171 17096 13 | N 12122 6370 14 | N 11155 11452 15 | N 15256 19167 16 | N 17794 17867 17 | N 19569 9286 18 | N 10829 14434 19 | N 5862 5489 20 | N 8012 7357 21 | N 12505 9733 22 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_100.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 16417 6276 3 | N 12560 18170 4 | N 19068 2831 5 | N 9496 7292 6 | N 8205 7359 7 | N 5085 12368 8 | N 14654 14473 9 | N 9918 5836 10 | N 6471 14141 11 | N 5777 5929 12 | N 8406 13974 13 | N 1852 18123 14 | N 12114 12315 15 | N 13018 14403 16 | N 3515 15616 17 | N 8604 18451 18 | N 9226 1997 19 | N 5963 9813 20 | N 1710 11116 21 | N 7834 11991 22 | C 536 17056 23 | C 18809 7469 24 | C 13871 14291 25 | C 17118 15858 26 | C 1721 1692 27 | C 8870 3410 28 | C 4909 3229 29 | C 8991 14311 30 | C 19329 19441 31 | C 12295 12314 32 | C 9009 8997 33 | C 14753 9573 34 | C 9342 6822 35 | C 1738 1749 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_91.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6181 14321 3 | N 15797 16499 4 | N 8745 13208 5 | N 7825 13775 6 | N 3103 19574 7 | N 13797 13529 8 | N 6270 6386 9 | N 13398 9434 10 | N 18631 14015 11 | N 6689 7137 12 | N 19337 14951 13 | N 18832 5550 14 | N 12293 7255 15 | N 15908 2190 16 | N 6406 11051 17 | N 18675 3537 18 | N 1644 11622 19 | N 5738 14844 20 | N 18062 7496 21 | N 13395 14587 22 | C 8739 8733 23 | C 10321 10288 24 | C 1865 4245 25 | C 6405 16345 26 | C 11305 11284 27 | C 18883 18813 28 | C 9439 1879 29 | C 2620 7240 30 | C 15113 15062 31 | C 4320 4272 32 | C 2878 4418 33 | C 15846 5486 34 | C 500 18140 35 | C 19206 19309 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_92.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 18587 3428 3 | N 16933 2700 4 | N 2186 851 5 | N 5642 14740 6 | N 6003 5490 7 | N 2498 12990 8 | N 1365 5949 9 | N 7885 8165 10 | N 17256 13581 11 | N 10433 3573 12 | N 2095 13528 13 | N 10955 2603 14 | N 17663 5585 15 | N 11415 13055 16 | N 17416 6634 17 | N 361 2531 18 | N 12635 3484 19 | N 6603 12029 20 | N 3778 18766 21 | N 14586 6963 22 | C 13076 13126 23 | C 6099 14639 24 | C 19420 16200 25 | C 19477 19507 26 | C 6803 6729 27 | C 10943 10920 28 | C 6908 11388 29 | C 15592 15580 30 | C 14098 14029 31 | C 18209 18276 32 | C 18308 13128 33 | C 8538 8466 34 | C 11553 11973 35 | C 12181 7421 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_93.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 12726 3249 3 | N 5270 14044 4 | N 5771 4208 5 | N 14374 2551 6 | N 7892 5863 7 | N 10435 7646 8 | N 2361 1976 9 | N 3683 2820 10 | N 492 6772 11 | N 5558 15763 12 | N 17802 5980 13 | N 19216 9120 14 | N 3029 130 15 | N 918 18027 16 | N 715 394 17 | N 18063 4865 18 | N 10911 4898 19 | N 8048 12470 20 | N 5749 11359 21 | N 17275 19193 22 | C 9749 15209 23 | C 18846 18832 24 | C 455 429 25 | C 18856 5836 26 | C 13299 13167 27 | C 18144 18069 28 | C 2801 2825 29 | C 1397 1291 30 | C 15718 17398 31 | C 15384 7264 32 | C 15436 8016 33 | C 1799 1787 34 | C 10826 10901 35 | C 14188 14250 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_94.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6579 9971 3 | N 15477 17784 4 | N 11014 9909 5 | N 837 531 6 | N 12851 12576 7 | N 1594 16765 8 | N 9420 3253 9 | N 17016 2730 10 | N 15495 1489 11 | N 699 8050 12 | N 16110 8626 13 | N 6087 5892 14 | N 7400 681 15 | N 17972 10106 16 | N 4490 7313 17 | N 1308 5985 18 | N 6076 17278 19 | N 18100 7668 20 | N 13105 5286 21 | N 4610 15341 22 | C 16695 11795 23 | C 10721 11561 24 | C 6946 18006 25 | C 5512 5232 26 | C 11092 11175 27 | C 754 800 28 | C 3456 4856 29 | C 12498 14458 30 | C 1841 3381 31 | C 15974 16114 32 | C 3848 3891 33 | C 15915 6395 34 | C 10203 10164 35 | C 2947 19467 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_95.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 18476 4618 3 | N 1106 455 4 | N 9821 1589 5 | N 6995 12907 6 | N 13931 5555 7 | N 6625 12140 8 | N 14185 18264 9 | N 3960 12905 10 | N 11040 843 11 | N 18994 12595 12 | N 13376 15450 13 | N 4437 2833 14 | N 427 13914 15 | N 18539 6000 16 | N 15780 3956 17 | N 16495 11528 18 | N 13795 6989 19 | N 5110 3978 20 | N 8724 163 21 | N 16011 13305 22 | C 5954 5937 23 | C 19243 12943 24 | C 5599 10639 25 | C 13269 13282 26 | C 18213 18318 27 | C 3616 3549 28 | C 1744 1736 29 | C 5157 5057 30 | C 5775 5796 31 | C 23 114 32 | C 11670 11718 33 | C 10072 3352 34 | C 16316 3996 35 | C 17629 2369 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_96.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 11294 7381 3 | N 12204 711 4 | N 14602 3160 5 | N 12105 9891 6 | N 18093 17082 7 | N 17359 11453 8 | N 12382 18475 9 | N 1062 2142 10 | N 15711 7689 11 | N 2475 4094 12 | N 9317 6924 13 | N 14670 9812 14 | N 12869 14668 15 | N 7163 11319 16 | N 1456 4698 17 | N 6218 15335 18 | N 17504 6054 19 | N 16 10057 20 | N 5881 12333 21 | N 2564 9650 22 | C 4815 55 23 | C 7310 7354 24 | C 11223 11221 25 | C 5658 5678 26 | C 11801 1441 27 | C 17947 18006 28 | C 4726 6966 29 | C 15125 15142 30 | C 17574 634 31 | C 5201 15421 32 | C 9658 10498 33 | C 13312 6732 34 | C 12525 12556 35 | C 4733 18313 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_97.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 15309 1915 3 | N 1405 9664 4 | N 934 15698 5 | N 4040 8760 6 | N 6518 14764 7 | N 6857 3825 8 | N 19520 2272 9 | N 3815 19336 10 | N 10076 2120 11 | N 2775 6501 12 | N 5325 7129 13 | N 2893 482 14 | N 36 17679 15 | N 18342 820 16 | N 15692 3470 17 | N 18911 1682 18 | N 19316 15320 19 | N 12844 15725 20 | N 12771 12252 21 | N 7432 6641 22 | C 10584 18004 23 | C 18198 7558 24 | C 3063 15943 25 | C 16245 16372 26 | C 6310 6430 27 | C 3508 3603 28 | C 13348 18668 29 | C 13761 5501 30 | C 7392 7280 31 | C 6753 16833 32 | C 2565 2596 33 | C 6761 41 34 | C 6785 6743 35 | C 9640 3900 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_98.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 1631 15070 3 | N 16955 2312 4 | N 7127 1221 5 | N 232 13721 6 | N 11977 17371 7 | N 19369 14463 8 | N 17965 9568 9 | N 4611 19374 10 | N 14750 3778 11 | N 5732 5698 12 | N 17720 10545 13 | N 2795 1587 14 | N 17614 13435 15 | N 19323 19055 16 | N 11678 7637 17 | N 1464 1151 18 | N 15379 12861 19 | N 1227 10037 20 | N 9466 472 21 | N 364 4421 22 | C 7668 7585 23 | C 3219 15679 24 | C 7947 7896 25 | C 15944 15923 26 | C 17204 17188 27 | C 797 708 28 | C 1724 9144 29 | C 19446 19367 30 | C 11093 11188 31 | C 4428 4385 32 | C 11560 6940 33 | C 11761 11864 34 | C 19337 19351 35 | C 5754 5750 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_10/instance_N_20_M_7_C_10_99.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 13683 6351 3 | N 8878 3114 4 | N 13784 19315 5 | N 17522 15031 6 | N 13355 7659 7 | N 16558 12085 8 | N 18921 16822 9 | N 14500 9530 10 | N 15121 12932 11 | N 2936 18598 12 | N 16570 12753 13 | N 7733 15861 14 | N 17965 1305 15 | N 728 16983 16 | N 2907 3188 17 | N 11096 13581 18 | N 4844 14553 19 | N 2011 15874 20 | N 19525 4583 21 | N 17030 4634 22 | C 14598 3398 23 | C 5070 5084 24 | C 14605 7465 25 | C 17861 9181 26 | C 12910 2550 27 | C 10348 1808 28 | C 7786 7802 29 | C 14366 14386 30 | C 19134 6534 31 | C 13309 13413 32 | C 11118 3838 33 | C 7780 13800 34 | C 15755 15055 35 | C 2445 2462 36 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_101.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 19369 16751 3 | N 17932 7894 4 | N 17433 11814 5 | N 2632 6925 6 | N 3121 19293 7 | N 6953 11740 8 | N 14481 7528 9 | N 15416 10899 10 | N 3974 9604 11 | N 13681 15178 12 | N 14439 247 13 | N 7818 3496 14 | N 788 12974 15 | N 9382 1159 16 | N 6550 2311 17 | N 14458 17032 18 | N 17822 11190 19 | N 18946 2941 20 | N 1136 19128 21 | N 4313 5017 22 | C 7185 7175 23 | C 5340 5406 24 | C 2476 12556 25 | C 2078 10058 26 | C 3303 3259 27 | C 16724 15184 28 | C 18788 18822 29 | C 9964 444 30 | C 14143 14151 31 | C 8626 8660 32 | C 19230 19265 33 | C 4764 4848 34 | C 14513 14433 35 | C 18536 7756 36 | C 4237 12217 37 | C 13191 15991 38 | C 13071 4531 39 | C 19577 19536 40 | C 9177 15617 41 | C 16292 16250 42 | C 1742 1792 43 | C 1932 1872 44 | C 16668 428 45 | C 16205 16136 46 | C 2224 9644 47 | C 3111 3166 48 | C 2653 16933 49 | C 3886 3781 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_102.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 12777 6483 3 | N 10458 1649 4 | N 19595 6713 5 | N 15916 18258 6 | N 2972 6593 7 | N 18033 18956 8 | N 5314 14825 9 | N 2502 3283 10 | N 13525 18249 11 | N 15509 4861 12 | N 13062 2573 13 | N 10560 4590 14 | N 9632 16880 15 | N 16097 7550 16 | N 8780 19372 17 | N 19081 18994 18 | N 14152 16970 19 | N 10964 18638 20 | N 9198 6266 21 | N 11254 6834 22 | C 7880 7875 23 | C 17116 316 24 | C 8560 8610 25 | C 4098 5358 26 | C 14841 14921 27 | C 15888 15882 28 | C 6830 6771 29 | C 16665 16525 30 | C 8173 8143 31 | C 13903 13895 32 | C 9101 9204 33 | C 6636 6640 34 | C 2560 16980 35 | C 5628 5641 36 | C 2147 5087 37 | C 16134 16223 38 | C 12199 16679 39 | C 8936 396 40 | C 10006 17286 41 | C 2430 7190 42 | C 1093 1109 43 | C 5863 5804 44 | C 3569 9309 45 | C 3660 7300 46 | C 2419 14179 47 | C 15038 12098 48 | C 9920 9866 49 | C 8654 17334 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_103.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 7816 4359 3 | N 16617 4286 4 | N 3065 7873 5 | N 1546 3837 6 | N 18652 6515 7 | N 14944 8878 8 | N 13182 7751 9 | N 17070 10144 10 | N 18955 19017 11 | N 18809 1475 12 | N 5303 15013 13 | N 9091 17245 14 | N 3449 10943 15 | N 4464 13744 16 | N 774 14122 17 | N 15917 2307 18 | N 15865 11631 19 | N 355 8679 20 | N 7900 13778 21 | N 2979 1077 22 | C 16362 16262 23 | C 1297 1330 24 | C 19239 16299 25 | C 14219 6519 26 | C 13088 17428 27 | C 4848 4777 28 | C 13727 14707 29 | C 10469 10498 30 | C 14921 14908 31 | C 1253 1235 32 | C 15064 4844 33 | C 15937 4317 34 | C 684 598 35 | C 16581 16550 36 | C 486 1886 37 | C 5215 5192 38 | C 8884 8931 39 | C 10523 10622 40 | C 6936 6991 41 | C 8379 8287 42 | C 10311 10241 43 | C 16500 16393 44 | C 17431 4831 45 | C 18665 8585 46 | C 10443 10456 47 | C 7084 3864 48 | C 11217 11270 49 | C 15717 15762 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_104.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 7005 14058 3 | N 224 592 4 | N 3682 4237 5 | N 11779 2194 6 | N 9151 11580 7 | N 10683 1504 8 | N 16079 8817 9 | N 6506 3510 10 | N 4349 9001 11 | N 12286 12478 12 | N 7278 1424 13 | N 17198 7873 14 | N 6338 6573 15 | N 19190 1216 16 | N 16557 7601 17 | N 3053 5475 18 | N 298 8713 19 | N 2551 14960 20 | N 19162 15448 21 | N 919 17366 22 | C 18752 1112 23 | C 764 17424 24 | C 4455 6975 25 | C 3142 3106 26 | C 2562 14882 27 | C 5794 5824 28 | C 6438 3078 29 | C 7607 8867 30 | C 7161 13741 31 | C 8249 17209 32 | C 17410 2570 33 | C 3154 3137 34 | C 1138 1134 35 | C 7800 7813 36 | C 2590 17990 37 | C 1491 16471 38 | C 6162 6269 39 | C 9387 9515 40 | C 1376 5996 41 | C 17402 10962 42 | C 11075 2255 43 | C 12012 8792 44 | C 17638 13298 45 | C 2441 2404 46 | C 11282 11312 47 | C 18029 8369 48 | C 13338 3818 49 | C 5122 5117 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_105.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 3869 11060 3 | N 12034 5814 4 | N 5969 3537 5 | N 12561 15443 6 | N 16478 8247 7 | N 11106 9094 8 | N 11635 12769 9 | N 14047 18196 10 | N 18465 10316 11 | N 4473 12847 12 | N 9454 3952 13 | N 14123 511 14 | N 7328 6594 15 | N 15201 18175 16 | N 1162 2679 17 | N 11011 8608 18 | N 14793 3017 19 | N 3808 6005 20 | N 12291 8702 21 | N 10231 8455 22 | C 13050 18510 23 | C 9714 9690 24 | C 19024 18902 25 | C 5082 1722 26 | C 11592 12572 27 | C 12969 6809 28 | C 13943 13887 29 | C 8739 8701 30 | C 2311 1331 31 | C 3088 3103 32 | C 15900 15940 33 | C 6282 6160 34 | C 4766 4875 35 | C 6625 2565 36 | C 12887 13447 37 | C 14848 19468 38 | C 16215 13695 39 | C 12614 12736 40 | C 6604 3664 41 | C 19454 974 42 | C 17622 17629 43 | C 10004 10021 44 | C 17664 19064 45 | C 7487 7511 46 | C 11975 12115 47 | C 16853 16904 48 | C 16481 16514 49 | C 11562 502 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_106.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 682 17074 3 | N 9254 6736 4 | N 13146 16211 5 | N 8052 10059 6 | N 5023 9846 7 | N 17593 2749 8 | N 12533 6384 9 | N 15435 1281 10 | N 11503 6465 11 | N 15915 9039 12 | N 16087 8648 13 | N 5079 7405 14 | N 8719 11528 15 | N 4674 9600 16 | N 12773 19295 17 | N 7658 8647 18 | N 13294 13819 19 | N 5775 12328 20 | N 18897 3376 21 | N 17217 18606 22 | C 476 3416 23 | C 4167 4117 24 | C 7635 775 25 | C 19477 19531 26 | C 11786 11760 27 | C 18449 3889 28 | C 9737 10437 29 | C 17360 10220 30 | C 1162 1121 31 | C 5735 5683 32 | C 1151 1257 33 | C 4208 13308 34 | C 14974 12454 35 | C 7221 7200 36 | C 19260 19279 37 | C 14841 14942 38 | C 18214 18238 39 | C 9204 10044 40 | C 12091 12175 41 | C 10650 13030 42 | C 2979 3053 43 | C 6833 16213 44 | C 1011 19351 45 | C 16774 3194 46 | C 14371 7791 47 | C 7870 9130 48 | C 526 12146 49 | C 17711 1891 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_107.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 15183 11183 3 | N 15155 4479 4 | N 10564 9948 5 | N 6800 6907 6 | N 19079 8715 7 | N 4155 5759 8 | N 17656 5508 9 | N 9777 8702 10 | N 15189 8511 11 | N 11078 10462 12 | N 1616 10740 13 | N 8302 3416 14 | N 7532 10555 15 | N 17902 15811 16 | N 227 1357 17 | N 13986 17949 18 | N 9046 8263 19 | N 19282 9172 20 | N 13817 18294 21 | N 14481 14811 22 | C 14595 14665 23 | C 2909 2833 24 | C 2418 38 25 | C 8922 8903 26 | C 17819 1019 27 | C 19311 19241 28 | C 10181 10106 29 | C 5494 5497 30 | C 7385 4445 31 | C 10657 16257 32 | C 528 6828 33 | C 9191 9178 34 | C 843 874 35 | C 5363 8583 36 | C 14549 12869 37 | C 2132 2214 38 | C 13103 13059 39 | C 6914 14194 40 | C 8218 13538 41 | C 3610 1510 42 | C 16829 9829 43 | C 3554 3514 44 | C 10056 9967 45 | C 15660 6980 46 | C 13496 12096 47 | C 1414 1519 48 | C 10819 10863 49 | C 9904 9910 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_108.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 2973 9898 3 | N 7096 10660 4 | N 6494 11391 5 | N 3968 2988 6 | N 3748 11616 7 | N 7659 15974 8 | N 12328 8484 9 | N 18251 7685 10 | N 2385 4043 11 | N 6683 8486 12 | N 392 6530 13 | N 12938 885 14 | N 17278 6845 15 | N 18927 2138 16 | N 4806 9047 17 | N 2527 5121 18 | N 1640 14394 19 | N 9880 17498 20 | N 10377 13988 21 | N 13873 6699 22 | C 6207 5507 23 | C 8503 11443 24 | C 10519 10528 25 | C 2635 5575 26 | C 1251 18051 27 | C 2407 2498 28 | C 15509 15482 29 | C 5765 5745 30 | C 5441 5348 31 | C 3342 17762 32 | C 2709 2763 33 | C 19597 14557 34 | C 6265 6188 35 | C 2560 2524 36 | C 6310 6341 37 | C 2535 2522 38 | C 11072 11074 39 | C 16157 9157 40 | C 7116 7008 41 | C 14336 14384 42 | C 9325 6385 43 | C 5040 5072 44 | C 6021 6119 45 | C 17474 17403 46 | C 11142 11088 47 | C 10253 4373 48 | C 19268 19305 49 | C 10284 14764 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_109.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 8191 16217 3 | N 3514 17978 4 | N 10767 2932 5 | N 16160 9929 6 | N 5989 18558 7 | N 2321 6293 8 | N 12042 4951 9 | N 14466 5154 10 | N 12988 6619 11 | N 850 13961 12 | N 4463 7768 13 | N 18876 1709 14 | N 16728 17310 15 | N 2107 2767 16 | N 11042 12928 17 | N 8221 17705 18 | N 17644 14971 19 | N 7219 4058 20 | N 4006 8842 21 | N 9389 5128 22 | C 5970 5919 23 | C 15327 15391 24 | C 17894 3474 25 | C 15605 2165 26 | C 1419 4639 27 | C 16087 3487 28 | C 325 319 29 | C 5350 4090 30 | C 4380 4439 31 | C 11803 9003 32 | C 4958 2718 33 | C 2041 15061 34 | C 19233 8173 35 | C 8050 8045 36 | C 1887 1876 37 | C 17838 2018 38 | C 12914 13614 39 | C 3810 3530 40 | C 9510 3490 41 | C 16606 16525 42 | C 11493 433 43 | C 18429 18351 44 | C 76 5956 45 | C 7201 7272 46 | C 3308 16468 47 | C 713 715 48 | C 18402 18418 49 | C 12329 12334 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_20/instance_N_20_M_7_C_20_110.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 8919 17325 3 | N 19390 19479 4 | N 18026 1480 5 | N 18369 5340 6 | N 533 15255 7 | N 9999 12953 8 | N 18153 14587 9 | N 9917 6892 10 | N 14766 8240 11 | N 16145 2997 12 | N 11886 8904 13 | N 10962 7175 14 | N 6369 9520 15 | N 456 14398 16 | N 7611 18184 17 | N 11595 18051 18 | N 1634 14079 19 | N 18729 11488 20 | N 3329 3100 21 | N 18886 6483 22 | C 4058 698 23 | C 4653 4093 24 | C 2175 8475 25 | C 2649 1669 26 | C 331 11391 27 | C 4234 11934 28 | C 3640 17500 29 | C 12058 16398 30 | C 14256 14254 31 | C 9723 18683 32 | C 17419 17434 33 | C 8872 8952 34 | C 16288 3968 35 | C 6310 570 36 | C 4863 4772 37 | C 9455 5955 38 | C 17180 7800 39 | C 4857 2337 40 | C 2284 14744 41 | C 3662 12202 42 | C 14056 8596 43 | C 7248 14388 44 | C 14928 5828 45 | C 11513 9833 46 | C 14622 14624 47 | C 16380 16513 48 | C 9474 9463 49 | C 2056 2000 50 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_111.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 11254 6986 3 | N 14941 6903 4 | N 8227 16566 5 | N 13826 13511 6 | N 12516 1247 7 | N 8620 14675 8 | N 15136 3910 9 | N 3575 16466 10 | N 12235 17980 11 | N 704 18027 12 | N 17717 17623 13 | N 3918 459 14 | N 17543 19156 15 | N 13024 15872 16 | N 5497 13996 17 | N 122 4534 18 | N 19076 13229 19 | N 16112 12894 20 | N 4218 12986 21 | N 7057 3763 22 | C 14413 14334 23 | C 10811 10810 24 | C 4869 3189 25 | C 16922 16813 26 | C 7142 14702 27 | C 1991 19071 28 | C 9752 9712 29 | C 11268 14768 30 | C 9612 13952 31 | C 11611 11504 32 | C 19141 11021 33 | C 309 18789 34 | C 4043 3988 35 | C 3279 3242 36 | C 10921 9801 37 | C 4050 3929 38 | C 12439 12386 39 | C 10442 642 40 | C 18549 7069 41 | C 19162 19101 42 | C 16168 4548 43 | C 548 539 44 | C 6772 6783 45 | C 18870 18863 46 | C 19195 19293 47 | C 17954 18033 48 | C 15938 15868 49 | C 17698 15738 50 | C 17425 10985 51 | C 10436 10458 52 | C 15520 6700 53 | C 5384 5370 54 | C 8226 8197 55 | C 19454 14974 56 | C 7764 344 57 | C 3937 1137 58 | C 16157 16577 59 | C 5479 5583 60 | C 17493 17458 61 | C 18208 10788 62 | C 13640 1740 63 | C 2713 2720 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_112.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 10763 15099 3 | N 12921 18816 4 | N 956 8499 5 | N 16776 12527 6 | N 8169 16142 7 | N 12453 14384 8 | N 765 2396 9 | N 10977 3181 10 | N 2243 9162 11 | N 262 15606 12 | N 6153 15614 13 | N 18796 7725 14 | N 8467 15583 15 | N 8360 2422 16 | N 3300 19484 17 | N 3720 3623 18 | N 18464 5869 19 | N 2447 18481 20 | N 11900 9895 21 | N 16900 18144 22 | C 11112 3272 23 | C 14734 14718 24 | C 11515 11535 25 | C 11725 11714 26 | C 1858 1956 27 | C 15770 19410 28 | C 11130 15890 29 | C 10065 9949 30 | C 6236 6272 31 | C 14956 14952 32 | C 14173 19213 33 | C 5436 5394 34 | C 8753 5953 35 | C 8665 8631 36 | C 15841 14721 37 | C 1898 1820 38 | C 8557 8837 39 | C 5403 13523 40 | C 15084 15000 41 | C 6836 6753 42 | C 10941 8141 43 | C 3603 6963 44 | C 12906 15286 45 | C 18093 18084 46 | C 16740 11700 47 | C 2408 6888 48 | C 2601 2577 49 | C 2530 6870 50 | C 6549 2769 51 | C 10551 10546 52 | C 18063 18110 53 | C 4440 11020 54 | C 13093 13035 55 | C 2509 2398 56 | C 7987 6307 57 | C 11573 11600 58 | C 1433 1454 59 | C 17800 10800 60 | C 11221 11501 61 | C 17423 17499 62 | C 11047 10981 63 | C 5100 5080 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_113.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 9807 17084 3 | N 8629 1091 4 | N 10797 10672 5 | N 10206 15477 6 | N 14226 16709 7 | N 11158 18629 8 | N 6250 9576 9 | N 16646 9842 10 | N 10044 6909 11 | N 1264 6414 12 | N 10788 4755 13 | N 1019 16842 14 | N 18501 18504 15 | N 7588 19403 16 | N 4978 16673 17 | N 8426 17000 18 | N 3831 9979 19 | N 12959 2301 20 | N 6195 17561 21 | N 7320 10159 22 | C 8913 1073 23 | C 7384 7326 24 | C 7649 7569 25 | C 16198 16183 26 | C 15815 9095 27 | C 8518 7258 28 | C 17281 17701 29 | C 10265 10343 30 | C 9938 9916 31 | C 1918 1944 32 | C 12377 12388 33 | C 16393 16406 34 | C 18268 7488 35 | C 18489 18516 36 | C 18604 18491 37 | C 18150 18131 38 | C 8999 9036 39 | C 63 7903 40 | C 14889 14904 41 | C 4151 6111 42 | C 5145 5147 43 | C 9778 9731 44 | C 6163 1823 45 | C 862 13322 46 | C 16629 389 47 | C 15495 12835 48 | C 6430 6376 49 | C 8809 8796 50 | C 2895 2935 51 | C 16105 5045 52 | C 4838 918 53 | C 10908 10912 54 | C 3971 14751 55 | C 6971 9911 56 | C 1421 1465 57 | C 14217 14157 58 | C 15925 11025 59 | C 9343 9331 60 | C 12125 7785 61 | C 11733 4033 62 | C 16896 18156 63 | C 17808 17820 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_114.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 3561 8766 3 | N 5472 19032 4 | N 10632 19196 5 | N 12135 3247 6 | N 14258 18928 7 | N 13237 15674 8 | N 8377 8102 9 | N 10865 2825 10 | N 8994 5968 11 | N 6992 12302 12 | N 18921 3535 13 | N 11976 7435 14 | N 3051 12249 15 | N 7722 7340 16 | N 3052 16977 17 | N 12706 3872 18 | N 15208 4779 19 | N 9380 19448 20 | N 17374 429 21 | N 12681 1328 22 | C 5020 4967 23 | C 19590 19572 24 | C 12107 4127 25 | C 18099 18162 26 | C 15709 15989 27 | C 19289 19234 28 | C 18318 6418 29 | C 4023 12143 30 | C 15932 15850 31 | C 12123 12131 32 | C 1567 6187 33 | C 13584 13628 34 | C 1716 1680 35 | C 11879 11850 36 | C 2305 7065 37 | C 13708 15808 38 | C 3056 3074 39 | C 16176 16205 40 | C 11910 15550 41 | C 331 3831 42 | C 11525 17965 43 | C 19246 19205 44 | C 3202 15802 45 | C 16361 16253 46 | C 16151 16111 47 | C 10327 19287 48 | C 14980 15106 49 | C 3485 19165 50 | C 3641 3700 51 | C 15980 13460 52 | C 6451 14431 53 | C 5696 5677 54 | C 6618 878 55 | C 13637 11257 56 | C 2474 2498 57 | C 3653 13733 58 | C 4043 3623 59 | C 216 258 60 | C 12036 11978 61 | C 11589 3749 62 | C 15928 10328 63 | C 10970 11035 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_115.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 7072 19209 3 | N 11928 10154 4 | N 17306 5055 5 | N 1439 6232 6 | N 8804 6482 7 | N 18937 5095 8 | N 529 18811 9 | N 8904 8330 10 | N 14764 6954 11 | N 12302 14467 12 | N 11173 18808 13 | N 11934 9230 14 | N 6298 2814 15 | N 9627 1266 16 | N 1714 10491 17 | N 13546 10570 18 | N 14935 2143 19 | N 6990 2410 20 | N 503 12253 21 | N 19030 9567 22 | C 19431 19365 23 | C 18698 18739 24 | C 3770 2230 25 | C 3679 17539 26 | C 1257 3357 27 | C 17461 6961 28 | C 15547 16107 29 | C 18642 2822 30 | C 6239 919 31 | C 362 303 32 | C 4118 12378 33 | C 8627 8586 34 | C 11501 11600 35 | C 15493 373 36 | C 17125 18805 37 | C 8099 8077 38 | C 6946 6937 39 | C 10221 10308 40 | C 10241 15841 41 | C 13615 13702 42 | C 8364 8318 43 | C 11113 11184 44 | C 17418 17474 45 | C 4902 16102 46 | C 4408 4358 47 | C 19521 19463 48 | C 10566 10530 49 | C 16240 13020 50 | C 18285 11705 51 | C 11412 11407 52 | C 19058 9538 53 | C 18662 18708 54 | C 18034 1374 55 | C 13560 15800 56 | C 18967 4827 57 | C 4276 4326 58 | C 1065 988 59 | C 7325 8585 60 | C 1978 5338 61 | C 12568 8368 62 | C 1780 19140 63 | C 803 708 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_116.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 10779 4202 3 | N 17253 8803 4 | N 14630 2628 5 | N 2355 18560 6 | N 17862 18494 7 | N 14446 6132 8 | N 13158 17537 9 | N 18360 7538 10 | N 19563 13367 11 | N 1503 248 12 | N 8361 3726 13 | N 14705 10300 14 | N 12799 14683 15 | N 10825 13729 16 | N 3878 10369 17 | N 5753 9041 18 | N 17511 5049 19 | N 18126 675 20 | N 16980 17697 21 | N 15927 18438 22 | C 12114 12050 23 | C 7446 7511 24 | C 12736 12456 25 | C 9632 9589 26 | C 6215 6255 27 | C 3153 2173 28 | C 4774 4771 29 | C 7829 7767 30 | C 12081 12111 31 | C 19149 6269 32 | C 1528 1526 33 | C 15773 15693 34 | C 3433 16033 35 | C 3388 3483 36 | C 15668 15656 37 | C 14286 14334 38 | C 6548 4868 39 | C 6638 8318 40 | C 13211 13186 41 | C 16448 16413 42 | C 18882 18817 43 | C 2520 2621 44 | C 3502 3525 45 | C 10208 10168 46 | C 16534 16567 47 | C 7604 7572 48 | C 9394 16814 49 | C 16640 9780 50 | C 5060 10660 51 | C 9595 4275 52 | C 1948 1901 53 | C 7196 7164 54 | C 6797 6774 55 | C 5894 714 56 | C 9485 9453 57 | C 18303 3323 58 | C 4756 4636 59 | C 3367 3373 60 | C 6174 6222 61 | C 12076 12154 62 | C 437 16397 63 | C 12131 12082 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_117.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6501 7462 3 | N 5702 4304 4 | N 11894 16329 5 | N 4488 15635 6 | N 5757 13831 7 | N 14948 5601 8 | N 6548 17256 9 | N 13973 6219 10 | N 4007 720 11 | N 7431 13385 12 | N 9344 11003 13 | N 11856 5242 14 | N 234 10288 15 | N 1679 11737 16 | N 9243 1513 17 | N 6690 15832 18 | N 16098 18132 19 | N 13997 4067 20 | N 7355 10317 21 | N 15989 12109 22 | C 7003 7115 23 | C 16576 18536 24 | C 14374 14289 25 | C 16732 16717 26 | C 11472 3912 27 | C 1889 3989 28 | C 17310 17290 29 | C 13161 13276 30 | C 18824 2584 31 | C 14472 15452 32 | C 1577 5637 33 | C 13269 13260 34 | C 408 17908 35 | C 4968 7628 36 | C 12457 9657 37 | C 14314 14342 38 | C 9642 18462 39 | C 2782 2674 40 | C 12322 12351 41 | C 9487 17887 42 | C 12433 12329 43 | C 18766 18769 44 | C 18528 18589 45 | C 18767 18487 46 | C 15871 2431 47 | C 12812 9592 48 | C 2525 2615 49 | C 5063 5084 50 | C 10560 10632 51 | C 17689 2009 52 | C 10337 8097 53 | C 10664 5344 54 | C 10768 10730 55 | C 7423 16943 56 | C 19263 19225 57 | C 10946 8286 58 | C 3998 15618 59 | C 4546 4606 60 | C 10306 10292 61 | C 10755 10695 62 | C 1814 1735 63 | C 1013 999 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_118.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 11106 12905 3 | N 635 11837 4 | N 17646 12310 5 | N 5312 271 6 | N 4673 10176 7 | N 2116 11852 8 | N 15656 16122 9 | N 9148 16940 10 | N 16540 2241 11 | N 8856 14232 12 | N 5935 9845 13 | N 4830 8980 14 | N 6431 4394 15 | N 18525 19510 16 | N 5669 11233 17 | N 4737 3605 18 | N 7976 4235 19 | N 2138 5768 20 | N 15969 16291 21 | N 10692 11850 22 | C 6665 6616 23 | C 8273 10233 24 | C 1238 17478 25 | C 10934 17234 26 | C 15548 6588 27 | C 11307 12707 28 | C 15246 15218 29 | C 13807 19407 30 | C 11293 12133 31 | C 18755 18621 32 | C 5185 5210 33 | C 9450 8890 34 | C 18066 10366 35 | C 16552 16523 36 | C 3648 3672 37 | C 5186 5316 38 | C 18589 18509 39 | C 12575 12460 40 | C 9113 9144 41 | C 5178 12738 42 | C 9363 7123 43 | C 4334 694 44 | C 11918 19478 45 | C 8152 8163 46 | C 9593 9562 47 | C 18718 14938 48 | C 3714 10294 49 | C 4994 4986 50 | C 13426 4326 51 | C 16172 16228 52 | C 13149 11749 53 | C 9022 8986 54 | C 12268 12266 55 | C 10582 1762 56 | C 8567 13887 57 | C 799 771 58 | C 12291 12224 59 | C 4313 17613 60 | C 1789 1759 61 | C 6600 15280 62 | C 14127 14109 63 | C 10153 3853 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_119.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 6513 15537 3 | N 2827 8789 4 | N 9005 7491 5 | N 680 9203 6 | N 2210 7506 7 | N 16553 18623 8 | N 17772 3886 9 | N 8411 17274 10 | N 17037 6717 11 | N 156 3963 12 | N 5645 16883 13 | N 13668 7374 14 | N 8252 15040 15 | N 13898 19258 16 | N 700 14815 17 | N 1267 4128 18 | N 18685 11663 19 | N 13792 12503 20 | N 15579 12763 21 | N 9414 1447 22 | C 2302 14622 23 | C 5501 18941 24 | C 2293 4533 25 | C 8709 8808 26 | C 16308 16448 27 | C 8768 15768 28 | C 8130 3510 29 | C 67 17567 30 | C 1268 1334 31 | C 10540 13200 32 | C 18900 18970 33 | C 10259 10235 34 | C 17316 6816 35 | C 5024 4929 36 | C 2094 2794 37 | C 11590 11566 38 | C 14869 14929 39 | C 17229 10789 40 | C 14575 8975 41 | C 15532 1532 42 | C 14552 14437 43 | C 15976 18636 44 | C 13275 13260 45 | C 17394 17398 46 | C 6611 14171 47 | C 3181 3149 48 | C 4779 4889 49 | C 9 8269 50 | C 16174 7494 51 | C 13269 11869 52 | C 19321 19417 53 | C 10159 10103 54 | C 2529 2602 55 | C 894 5094 56 | C 2840 15860 57 | C 2506 9646 58 | C 18928 19022 59 | C 5103 5130 60 | C 9374 9263 61 | C 4883 13983 62 | C 11173 18033 63 | C 3711 3748 64 | -------------------------------------------------------------------------------- /examples/routing/instances/M_7_C_30/instance_N_20_M_7_C_30_120.pcrt: -------------------------------------------------------------------------------- 1 | G 140 140 2 | N 8951 16568 3 | N 11223 8034 4 | N 11544 5835 5 | N 11367 4556 6 | N 10292 7774 7 | N 17968 4190 8 | N 7528 1031 9 | N 164 13834 10 | N 15641 19558 11 | N 3177 981 12 | N 12840 7634 13 | N 13755 11727 14 | N 9362 15349 15 | N 10011 9897 16 | N 18188 1770 17 | N 7922 8538 18 | N 11845 10634 19 | N 2839 12041 20 | N 3560 4823 21 | N 2066 16696 22 | C 16681 3801 23 | C 5370 5404 24 | C 17276 18956 25 | C 12357 14177 26 | C 14845 16945 27 | C 11521 11556 28 | C 16383 16481 29 | C 12099 59 30 | C 11048 13708 31 | C 16737 18417 32 | C 4554 5954 33 | C 6033 153 34 | C 19074 17954 35 | C 8067 12827 36 | C 3179 5559 37 | C 13651 13692 38 | C 18326 18273 39 | C 10883 10865 40 | C 7622 13922 41 | C 11984 11944 42 | C 10079 11199 43 | C 15424 9544 44 | C 19594 6854 45 | C 411 8811 46 | C 9389 15129 47 | C 8781 8789 48 | C 9341 9262 49 | C 801 2621 50 | C 5334 5329 51 | C 15024 14744 52 | C 1679 4619 53 | C 10239 10245 54 | C 4578 7518 55 | C 5163 16643 56 | C 13062 18242 57 | C 4912 11212 58 | C 10038 10031 59 | C 12236 17136 60 | C 16990 16994 61 | C 16685 18785 62 | C 7435 5895 63 | C 14123 15523 64 | -------------------------------------------------------------------------------- /examples/routing/instances/README: -------------------------------------------------------------------------------- 1 | This directory contains randomly generated, artificial benchmark instances in PCRT format, as described in 2 | Alexander Nadel's paper "Routing Under Constraints" (FMCAD 2016). -------------------------------------------------------------------------------- /examples/routing/instances/generate_pcrt.py: -------------------------------------------------------------------------------- 1 | #make pcrt benchmarks in the style of Alexander Nadel's FMCAD 16 RUC paper 2 | import random 3 | import argparse 4 | 5 | def make_pcrt(f, N, M, C, seed): 6 | print("Creating benchmark: N %d, M %d, C %d"%(N,M,C)) 7 | 8 | 9 | width = N*M 10 | height = N*M 11 | assert(width>1 or height>1) 12 | if seed is not None: 13 | print("Setting seed to %d"%(seed)) 14 | random.seed(seed) 15 | f.write("G %d %d\n"%(width,height)) 16 | used = set() 17 | 18 | def newPoint(used,shareXY=None): 19 | if shareXY is None: 20 | x1 = random.randint(0, width - 1) 21 | y1 = random.randint(0, height - 1) 22 | while ((x1, y1) in used): 23 | x1 = random.randint(0, width - 1) 24 | y1 = random.randint(0, height - 1) 25 | else: 26 | #Generate a new point that shares either x or y with shareXY 27 | assert(len(shareXY)==2) 28 | shareX = random.choice([True, False]) 29 | if shareX: 30 | x1 = shareXY[0] 31 | y1 = random.randint(0, height - 1) 32 | else: 33 | x1 = random.randint(0, width - 1) 34 | y1 = shareXY[1] 35 | while ((x1, y1) in used): 36 | if shareX: 37 | x1 = shareXY[0] 38 | y1 = random.randint(0, height - 1) 39 | else: 40 | x1 = random.randint(0, width - 1) 41 | y1 = shareXY[1] 42 | 43 | used.add((x1, y1)) 44 | return (x1,y1) 45 | 46 | def toInt(x,y): 47 | assert(x>=0) 48 | assert(y>=0) 49 | assert (x < width) 50 | assert (y < height) 51 | return y*width + x 52 | 53 | for i in range(N): 54 | 55 | x1,y1 = newPoint(used) 56 | #make sure the two points are not identical 57 | x2,y2 = newPoint(used) 58 | f.write("N %d %d\n"%(toInt(x1,y1),toInt(x2,y2))) 59 | 60 | V = (N*M)^2 61 | for i in range((C*V)//100): 62 | x1,y1 = newPoint(used) 63 | x2, y2 = newPoint(used,(x1,y1)) 64 | f.write("C %d %d\n" % (toInt(x1, y1), toInt(x2, y2))) 65 | 66 | f.close() 67 | print("Done") 68 | 69 | if __name__ == '__main__': 70 | import sys 71 | 72 | parser = argparse.ArgumentParser(description='Generate PCRT benchmarks, as described in the Alexander Nadel FMCAD16 RUC paper') 73 | 74 | parser.add_argument('N', metavar='N', default = 20, type=int, 75 | help='N') 76 | parser.add_argument('M', metavar='M', type=int, 77 | help='M') 78 | parser.add_argument('constraints', metavar='c', type=int, 79 | help='constraints') 80 | parser.add_argument('seed', type=int, default=None, 81 | help='Random seed (default: randomize)') 82 | parser.add_argument('filename', type=argparse.FileType('w')) 83 | 84 | args = parser.parse_args() 85 | 86 | make_pcrt(args.filename,args.N, args.M, args.constraints, args.seed) 87 | -------------------------------------------------------------------------------- /examples/routing/instances/make_benchmarks.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | N=20 4 | next_seed=1 5 | for M in {3,5,7}; do 6 | for C in {0,10,20,30}; do 7 | mkdir -p "M_${M}_C_${C}" 8 | for _ in {1..10}; do 9 | f="M_${M}_C_${C}/instance_N_${N}_M_${M}_C_${C}_${next_seed}.pcrt" 10 | echo $M $C $next_seed $f; 11 | python3 generate_pcrt.py $N $M $C $next_seed $f 12 | next_seed=$((next_seed+1)) 13 | done 14 | done 15 | done -------------------------------------------------------------------------------- /examples/routing/simple45.pcrt: -------------------------------------------------------------------------------- 1 | ;These are comments 2 | G 10 10 45 3 | N 40 48 4 | N 5 95 5 | C 45 30 23 6 | D 62 7 | D 63 -------------------------------------------------------------------------------- /examples/routing/simple45b.pcrt: -------------------------------------------------------------------------------- 1 | ;These are comments 2 | G 10 10 45 3 | N 5 95 4 | N 40 48 5 | C 45 30 23 6 | D 62 7 | D 63 -------------------------------------------------------------------------------- /examples/routing/simple90.pcrt: -------------------------------------------------------------------------------- 1 | ;These are comments 2 | G 10 10 3 | N 40 48 4 | N 5 95 5 | C 45 30 23 6 | D 62 7 | D 63 -------------------------------------------------------------------------------- /examples/routing/simple90b.pcrt: -------------------------------------------------------------------------------- 1 | ;These are comments 2 | G 10 10 3 | N 5 95 4 | N 40 48 5 | C 45 30 23 6 | D 62 7 | D 63 -------------------------------------------------------------------------------- /src/monosat/Version.cpp: -------------------------------------------------------------------------------- 1 | /*****************************************************************************************[Main.cc] 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2017, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | #include "monosat/Version.h" 22 | 23 | #define QUOTE(name) #name 24 | #define STR_VALUE(macro) QUOTE(macro) 25 | 26 | //define MONOSAT_VERSION and MONOSAT_BUILD when building to include more precise version information 27 | #define VERSION_NUM "1.6.0" 28 | 29 | #ifdef MONOSAT_BUILD 30 | #define BUILD_TYPE ", " STR_VALUE(MONOSAT_BUILD) 31 | #else 32 | #define BUILD_TYPE "" 33 | #endif 34 | 35 | 36 | #ifdef MONOSAT_VERSION 37 | #define VERSION_STR ", (" STR_VALUE(MONOSAT_VERSION) ")" 38 | #else 39 | #define VERSION_STR "" 40 | #endif 41 | 42 | const char* Monosat::MONOSAT_VERSION_STR = VERSION_NUM BUILD_TYPE VERSION_STR; -------------------------------------------------------------------------------- /src/monosat/Version.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************************[Main.cc] 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2017, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef MONOSAT_VERSION_H 23 | #define MONOSAT_VERSION_H 24 | namespace Monosat { 25 | 26 | extern const char* MONOSAT_VERSION_STR; 27 | 28 | } 29 | #endif //MONOSAT_VERSION_H 30 | -------------------------------------------------------------------------------- /src/monosat/api/java/README.md: -------------------------------------------------------------------------------- 1 | # JNI-based Java API for Monosat 2 | ##Contents 3 | * monosat/Solver.java: Object-Oriented SAT solver interface to Monosat 4 | * monosat/Lit.java: Represents Boolean literal in formulas 5 | * monosat/LBool.java: Represents potentially unassigned Boolean values (True, False, or Undef) 6 | * monosat/Compare.java: Enum containing basic comparison types (gt, lt, eq, etc) 7 | * monosat/Graph.java: Object-Oriented API for Monosat's graph theory 8 | * monosat/BitVector.java: Object-Oriented API for Monosat's BitVector theory 9 | * monosat/Logic.java: Static accessor methods for common logical operations/constructions 10 | * monosat/MonosatJNI: Low-level, no-frills interface to Monosat's C API. 11 | 12 | ## Installation 13 | By default, the shared library does not compile with JNI bindings. 14 | To build with JNI support (requires a JDK installation, tested with OpenJDK 1.8): 15 | ``` 16 | $ cd 17 | $ cmake -DJAVA=ON 18 | $ make 19 | ``` 20 | 21 | This will compile JNI bindings into the shared library (libmonosat.so/dylib). 22 | It will also produce monosat.jar in the root folder, containing the java API. 23 | 24 | ## Usage 25 | In order to use the library, you will need to ensure that monosat.jar 26 | is on the classpath. You will also need to ensure that libmonosat.so is in Java's 27 | native library path, eg, java -Djava.library.path=/path/to/libmonosat.so 28 | 29 | See examples/java/Tutorial.java for an introduction to using the library. 30 | 31 | -------------------------------------------------------------------------------- /src/monosat/api/java/monosat/Comparison.java: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package monosat; 23 | 24 | /** A comparison between two symbolic values. */ 25 | public enum Comparison { 26 | LT, 27 | LEQ, 28 | EQ, 29 | NEQ, 30 | GEQ, 31 | GT; 32 | 33 | /** 34 | * Compare a to b, using this operator. 35 | * 36 | * @param a First argument to compare. 37 | * @param b Second argument to compare. 38 | * @return True iff a op b holds. 39 | */ 40 | public boolean compare(long a, long b) { 41 | switch (this) { 42 | case GT: 43 | return a > b; 44 | case GEQ: 45 | return a >= b; 46 | case LT: 47 | return a < b; 48 | case LEQ: 49 | return a <= b; 50 | case NEQ: 51 | return a != b; 52 | case EQ: 53 | default: 54 | return a == b; 55 | } 56 | // unreachable 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/monosat/api/java/monosat/NoModelException.java: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package monosat; 23 | 24 | import java.util.NoSuchElementException; 25 | /** 26 | * Unchecked runtime exception thrown when attempting to access the assignment of a literal, 27 | * bitvector, or graph property that does not have an assignment. 28 | */ 29 | public class NoModelException extends NoSuchElementException { 30 | public NoModelException(String message) { 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/monosat/api/java/monosat/TrivialContradictionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | package monosat; 23 | 24 | /** 25 | * Unchecked runtime exception thrown when a trivial contradiction, such as assertFalse(True), is 26 | * added to the solver. Such an assertion is usually an error, and the solver can be configured to 27 | * (in some cases) detect these errors and throw an exception. 28 | */ 29 | public class TrivialContradictionException extends RuntimeException { 30 | public TrivialContradictionException(String message) { 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/monosat/api/java/tests/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sambayless/monosat/fa810d432ae24b6abd5612725c3bf7c0871c07d2/src/monosat/api/java/tests/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /src/monosat/api/java/tests/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sambayless/monosat/fa810d432ae24b6abd5612725c3bf7c0871c07d2/src/monosat/api/java/tests/junit-4.12.jar -------------------------------------------------------------------------------- /src/monosat/api/java/tests/monosat/Constraints.java: -------------------------------------------------------------------------------- 1 | package monosat; 2 | 3 | import java.util.ArrayList; 4 | 5 | 6 | /** 7 | * Produces MonoSAT constraints for testing purposes. 8 | * These are not intended to be demonstrations of how to write constraints 9 | * effectively in the solver. 10 | */ 11 | public class Constraints { 12 | public static ArrayList> nqueens(Solver s, int n){ 13 | ArrayList> rows = new ArrayList>(); 14 | for(int i = 0;i row = new ArrayList(); 16 | for(int j = 0;j> cols = new ArrayList>(); 23 | for(int i = 0;i col = new ArrayList(); 25 | for(int j = 0;j row = rows.get(i); 35 | //each row must have a queen 36 | s.addClause(row); 37 | //each row must have exactly one queen 38 | s.assertAtMostOne(row); 39 | } 40 | 41 | for(int i = 0;i col = cols.get(i); 43 | //each col must have a queen 44 | s.addClause(col); 45 | //each col must have exactly one queen 46 | s.assertAtMostOne(col); 47 | } 48 | 49 | //each diagonal must have at most one queen 50 | for(int i = 0;i> rows = nqueens(s,n); 73 | ArrayList lits = new ArrayList<>(); 74 | rows.forEach(lits::addAll); 75 | 76 | s.assertPB(lits,Comparison.GEQ,n+1);//assert n+1 queens are enabled 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/monosat/api/java/tests/monosat/TestSuite.java: -------------------------------------------------------------------------------- 1 | package monosat; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | 6 | @RunWith(Suite.class) 7 | @Suite.SuiteClasses({ 8 | monosat.BitVectorTest.class, 9 | monosat.GraphTest.class, 10 | monosat.LogicTest.class, 11 | monosat.SolverTest.class, 12 | monosat.LitTest.class, 13 | monosat.PseudoBooleanTest.class, 14 | monosat.ResourceLimitTest.class 15 | }) 16 | public class TestSuite {} 17 | -------------------------------------------------------------------------------- /src/monosat/api/python/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /build/* 3 | -------------------------------------------------------------------------------- /src/monosat/api/python/README.md: -------------------------------------------------------------------------------- 1 | # Monosat Python Interface 2 | This package defines both a ctypes and (optional, but faster) cython API for MonoSAT 3 | To install, first compile monosat, with 4 | ''' 5 | cd ../../../../; cmake .; make 6 | ''' 7 | 8 | Then install the python api with just ctypes support: 9 | ''' 10 | $ sudo python3 setup.py install -f 11 | ''' 12 | 13 | If cython is available on your system (eg, with pip3 install cython), as well an appropriate compiler, 14 | and 'use_cython=True' is set in setup.py, then this should compile and install the cython API. 15 | Otherwise, it will install the (roughly 30% slower) ctypes api. 16 | You can force the use of the ctypes or cython api, by manually setting the use_cython variable in either setup.py or monosat/monosat_c.py 17 | -------------------------------------------------------------------------------- /src/monosat/api/python/monosat/__init__.py: -------------------------------------------------------------------------------- 1 | from monosat.logic import * 2 | from monosat.pbtheory import * 3 | from monosat.graphtheory import * 4 | from monosat.fsmtheory import * 5 | from monosat.bvtheory import * 6 | from monosat.solver import * 7 | -------------------------------------------------------------------------------- /src/monosat/api/python/monosat/manager.py: -------------------------------------------------------------------------------- 1 | from monosat.monosat_c import Monosat 2 | 3 | 4 | # Like singleton, but one instance per _solver_, not per process 5 | class Manager(type): 6 | 7 | def __call__(cls, *args, **kwargs): 8 | if cls not in Monosat()._getManagers(): 9 | inst = super(Manager, cls).__call__(*args, **kwargs) 10 | inst._solver = Monosat().getSolver() 11 | Monosat()._getManagers()[cls] = inst 12 | return Monosat()._getManagers()[cls] 13 | -------------------------------------------------------------------------------- /src/monosat/api/python/monosat/singleton.py: -------------------------------------------------------------------------------- 1 | # from http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python 2 | class Singleton(type): 3 | _instances = {} 4 | 5 | def __call__(cls, *args, **kwargs): 6 | if cls not in cls._instances: 7 | cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) 8 | return cls._instances[cls] 9 | -------------------------------------------------------------------------------- /src/monosat/api/python/tests/__init__.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import tests 3 | import tests.test_logic 4 | import tests.test_graph 5 | import tests.test_output 6 | -------------------------------------------------------------------------------- /src/monosat/api/python/tests/test_output.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import warnings 3 | 4 | import monosat 5 | import shutil, tempfile 6 | import os 7 | 8 | 9 | class TestOutput(unittest.TestCase): 10 | def test_output(self): 11 | # To write to an output file, create a new solver and pass it the name of a file to write to 12 | # All constraints created in that new solver will be copied to that file 13 | test_file = tempfile.NamedTemporaryFile() 14 | filename = test_file.name 15 | test_file.close() 16 | monosat.Monosat().newSolver(output_file=filename) 17 | a = monosat.Var() 18 | b = monosat.Var() 19 | c = monosat.Or(a, monosat.Not(b)) 20 | 21 | monosat.Assert(c) 22 | monosat.Assert(monosat.Not(c)) 23 | 24 | # trivial contradition, so result should be UNSAT 25 | result = monosat.Solve() 26 | self.assertFalse(result) 27 | 28 | monosat.Monosat().newSolver() # create a new solver, this time without any output file set. 29 | # solver now has no constraints, so it should be SAT 30 | self.assertTrue(monosat.Solve()) 31 | 32 | # read in the previously saved constraints (these can also be read in on the command line, eg ./monosat tutorial.gnf 33 | monosat.Monosat().loadConstraints(filename) 34 | result2 = monosat.Solve() 35 | self.assertEqual(result, result2) 36 | os.remove(filename) 37 | 38 | def test_setOutputFile(self): 39 | # this tests the deprecated setOutputFile interface 40 | test_file = tempfile.NamedTemporaryFile() 41 | filename = test_file.name 42 | test_file.close() 43 | monosat.Monosat().newSolver(arguments="-decide-theories") 44 | with warnings.catch_warnings(record=True) as w: 45 | warnings.simplefilter("always") 46 | monosat.Monosat().setOutputFile(output_file=filename) 47 | self.assertEqual(len(w), 1) 48 | self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) 49 | self.assertTrue("deprecated" in str(w[-1].message)) 50 | 51 | a = monosat.Var() 52 | b = monosat.Var() 53 | c = monosat.Or(a, monosat.Not(b)) 54 | 55 | monosat.Assert(c) 56 | monosat.Assert(monosat.Not(c)) 57 | 58 | # trivial contradition, so result should be UNSAT 59 | result = monosat.Solve() 60 | self.assertFalse(result) 61 | 62 | monosat.Monosat().newSolver() # create a new solver, this time without any output file set. 63 | # solver now has no constraints, so it should be SAT 64 | self.assertTrue(monosat.Solve()) 65 | 66 | # read in the previously saved constraints (these can also be read in on the command line, eg ./monosat tutorial.gnf 67 | monosat.Monosat().loadConstraints(filename) 68 | result2 = monosat.Solve() 69 | self.assertEqual(result, result2) 70 | os.remove(filename) 71 | 72 | 73 | if __name__ == '__main__': 74 | unittest.main() 75 | -------------------------------------------------------------------------------- /src/monosat/bv/BVTheory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * BVTheory.h 3 | * 4 | * Created on: Feb 17, 2015 5 | * Author: sam 6 | */ 7 | 8 | #ifndef BVTHEORY_H_ 9 | #define BVTHEORY_H_ 10 | 11 | #include "monosat/core/Theory.h" 12 | 13 | namespace Monosat { 14 | /** 15 | * Abstract interface to SMT theory solvers, as accessed by the BV solver 16 | */ 17 | class BVTheory { 18 | public: 19 | virtual ~BVTheory(){ 20 | } 21 | 22 | virtual int getTheoryIndexBV() = 0; 23 | 24 | virtual void enqueueBV(int bvID) = 0; 25 | 26 | virtual void backtrackBV(int bvID) = 0; 27 | 28 | //Optional interface, if optimized BV clause learning is supported 29 | virtual void rewindBV(int bvID){ 30 | 31 | } 32 | }; 33 | 34 | }; 35 | #endif /* BVTHEORY_H_ */ 36 | -------------------------------------------------------------------------------- /src/monosat/dgl/AllPairs.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #include "AllPairs.h" 23 | 24 | using namespace dgl; 25 | AllPairs::NullStatus AllPairs::nullStatus; 26 | -------------------------------------------------------------------------------- /src/monosat/dgl/AllPairs.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef ALLPAIRS_H_ 23 | #define ALLPAIRS_H_ 24 | 25 | #include 26 | 27 | namespace dgl { 28 | class AllPairs { 29 | public: 30 | 31 | struct NullStatus { 32 | void setReachable(int u, int v, bool reachable){ 33 | 34 | } 35 | 36 | void setMininumDistance(int u, int v, bool reachable, int distance){ 37 | 38 | } 39 | 40 | }; 41 | 42 | static NullStatus nullStatus; 43 | 44 | virtual ~AllPairs(){ 45 | }; 46 | 47 | virtual int numUpdates() const = 0; 48 | 49 | virtual void addSource(int s) = 0; 50 | 51 | virtual void update() = 0; 52 | 53 | virtual bool connected_unsafe(int from, int t) = 0; 54 | 55 | virtual bool connected_unchecked(int from, int t) = 0; 56 | 57 | virtual bool connected(int from, int t) = 0; 58 | 59 | virtual int distance(int from, int t) = 0; 60 | 61 | virtual int distance_unsafe(int from, int t) = 0; 62 | 63 | //Return a path of edges from source to 'to' 64 | virtual void getPath(int source, int to, std::vector& path_store) = 0; 65 | }; 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/monosat/dgl/ConnectedComponents.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #include "ConnectedComponents.h" 23 | 24 | using namespace dgl; 25 | ConnectedComponents::NullConnectedComponentsStatus ConnectedComponents::nullConnectedComponentsStatus; 26 | -------------------------------------------------------------------------------- /src/monosat/dgl/ConnectedComponents.h: -------------------------------------------------------------------------------- 1 | #ifndef CONNECTED_COMPONENTS_H_ 2 | #define CONNECTED_COMPONENTS_H_ 3 | 4 | #include 5 | #include 6 | 7 | /************************************************************************************************** 8 | The MIT License (MIT) 9 | 10 | Copyright (c) 2014, Sam Bayless 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 13 | associated documentation files (the "Software"), to deal in the Software without restriction, 14 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 15 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all copies or 19 | substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 22 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 24 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 25 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | **************************************************************************************************/ 27 | 28 | namespace dgl { 29 | class ConnectedComponents { 30 | public: 31 | 32 | struct NullConnectedComponentsStatus { 33 | void setConnected(int u, int v, bool connected){ 34 | 35 | } 36 | 37 | void setComponents(int components){ 38 | 39 | } 40 | }; 41 | 42 | static NullConnectedComponentsStatus nullConnectedComponentsStatus; 43 | 44 | virtual ~ConnectedComponents(){ 45 | }; 46 | 47 | virtual void printStats(){ 48 | 49 | } 50 | 51 | virtual void update() = 0; 52 | 53 | virtual void addConnectedCheck(int u, int v){ 54 | throw std::runtime_error("Not implemented"); 55 | } 56 | 57 | virtual int numComponents() = 0; 58 | 59 | //Get an arbitrary element from the given set 60 | virtual int getElement(int set){ 61 | throw std::runtime_error("Not implemented"); 62 | } 63 | 64 | //Get the component this element belongs to 65 | virtual int getComponent(int node) = 0; 66 | 67 | virtual bool connected(int from, int to) = 0; 68 | }; 69 | }; 70 | #endif 71 | -------------------------------------------------------------------------------- /src/monosat/dgl/Cycle.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef CYCLE_H_ 23 | #define CYCLE_H_ 24 | 25 | #include 26 | 27 | namespace dgl { 28 | class Cycle { 29 | public: 30 | 31 | bool marked; 32 | 33 | int stats_full_updates = 0; 34 | int stats_fast_updates = 0; 35 | int stats_fast_failed_updates = 0; 36 | int stats_skip_deletes = 0; 37 | int stats_skipped_updates = 0; 38 | int stats_num_skipable_deletions = 0; 39 | int64_t stats_history_clears = 0; 40 | double mod_percentage; 41 | 42 | double stats_full_update_time; 43 | double stats_fast_update_time; 44 | 45 | virtual ~Cycle(){ 46 | } 47 | 48 | //hint to the algorithm that any discovered cycles will be removed. 49 | virtual void forceDAG(){ 50 | 51 | } 52 | 53 | virtual bool hasDirectedCycle() = 0; 54 | 55 | virtual bool hasUndirectedCycle() = 0; 56 | 57 | virtual void update() = 0; 58 | 59 | virtual std::vector& getUndirectedCycle() = 0; 60 | 61 | virtual std::vector& getDirectedCycle() = 0; 62 | }; 63 | }; 64 | #endif /* REACH_H_ */ 65 | -------------------------------------------------------------------------------- /src/monosat/dgl/Distance.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #include "Distance.h" 23 | #include 24 | 25 | using namespace dgl; 26 | 27 | 28 | template<> 29 | double Distance::INF = std::numeric_limits::infinity(); 30 | template<> 31 | float Distance::INF = std::numeric_limits::infinity(); 32 | #ifdef __APPLE__ 33 | //work around to deal with missing long long in gmp... 34 | template<> 35 | mpq_class Distance::INF = std::numeric_limits::max()*std::numeric_limits::max();//hopefully big enough... 36 | template<> 37 | mpz_class Distance::INF = std::numeric_limits::max()*std::numeric_limits::max();//hopefully big enough... 38 | #else 39 | 40 | template<> 41 | mpq_class Distance::INF = std::numeric_limits::max();//hopefully big enough... 42 | template<> 43 | mpz_class Distance::INF = std::numeric_limits::max();//hopefully big enough... 44 | #endif 45 | -------------------------------------------------------------------------------- /src/monosat/dgl/DynamicConnectivityImpl.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef DYNAMIC_CONNECTIVITY_IMPL_H_ 23 | #define DYNAMIC_CONNECTIVITY_IMPL_H_ 24 | namespace dgl { 25 | class DynamicConnectivityImpl { 26 | public: 27 | 28 | DynamicConnectivityImpl(){ 29 | 30 | } 31 | 32 | virtual ~DynamicConnectivityImpl(){ 33 | 34 | } 35 | 36 | virtual int numComponents() = 0; 37 | 38 | virtual bool connected(int u, int v) = 0; 39 | 40 | virtual void addNode() = 0; 41 | 42 | virtual void addEdge(int from, int to, int edgeID) = 0; 43 | 44 | virtual bool edgeEnabled(int edgeid) const = 0; 45 | 46 | virtual void dbg_print() = 0; 47 | 48 | virtual bool setEdgeEnabled(int from, int to, int edgeid, bool enabled) = 0; 49 | }; 50 | }; 51 | #endif 52 | -------------------------------------------------------------------------------- /src/monosat/dgl/DynamicNodes.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | #ifndef DYNAMIC_NODES 22 | #define DYNAMIC_NODES 23 | 24 | #include 25 | #include 26 | 27 | class DynamicNodes { 28 | std::vector nodeStatus; 29 | int n_enabled = 0; 30 | int n_actualNodes = 0; 31 | public: 32 | void addNode(int nodeID){ 33 | assert(nodeID >= 0); 34 | if(nodeStatus.size() <= nodeID) 35 | nodeStatus.resize(nodeID + 1); 36 | nodeStatus[nodeID] = true; 37 | n_enabled++; 38 | n_actualNodes++; 39 | } 40 | 41 | int numEnabled() const{ 42 | return n_enabled; 43 | } 44 | 45 | int nodes() const{ 46 | return nodeStatus.size(); 47 | } 48 | 49 | bool nodeEnabled(int n) const{ 50 | return nodeStatus[n]; 51 | } 52 | 53 | void setNodeEnabled(int n, bool enabled){ 54 | if(nodeStatus[n] != enabled){ 55 | nodeStatus[n] = enabled; 56 | if(enabled){ 57 | n_enabled++; 58 | }else{ 59 | n_enabled--; 60 | } 61 | } 62 | assert(n_enabled >= 0); 63 | assert(n_enabled <= n_actualNodes); 64 | } 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/monosat/dgl/MinimumSpanningTree.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef MINIMUMSPANNINGTREE_H_ 23 | #define MINIMUMSPANNINGTREE_H_ 24 | 25 | #include 26 | 27 | namespace dgl { 28 | template 29 | class MinimumSpanningTree { 30 | public: 31 | 32 | struct NullStatus { 33 | void setMinimumSpanningTree(Weight& min_weight, bool connected){ 34 | 35 | } 36 | 37 | void inMinimumSpanningTree(int edge, bool in_tree){ 38 | 39 | } 40 | }; 41 | 42 | static NullStatus nullStatus; 43 | 44 | virtual ~MinimumSpanningTree(){ 45 | }; 46 | 47 | virtual void printStats(){ 48 | 49 | } 50 | 51 | virtual int numUpdates() const = 0; 52 | 53 | virtual void update() = 0; 54 | 55 | virtual bool dbg_uptodate() = 0; 56 | 57 | virtual bool dbg_mst() = 0; 58 | 59 | //Total weight of the mst (or infinite, if the graph is disconnected) 60 | virtual Weight& weight() = 0; 61 | 62 | //Sum of the weight of the mst of each tree in the forest 63 | virtual Weight& forestWeight() = 0; 64 | 65 | virtual std::vector& getSpanningTree() = 0; 66 | 67 | virtual int getParent(int node) = 0; 68 | 69 | virtual int getParentEdge(int node) = 0; 70 | 71 | virtual bool edgeInTree(int edgeid) = 0; 72 | 73 | virtual int numComponents() = 0; 74 | 75 | virtual int getComponent(int node) = 0; 76 | 77 | virtual int getRoot(int component = 0) = 0; 78 | }; 79 | 80 | template 81 | typename MinimumSpanningTree::NullStatus MinimumSpanningTree::nullStatus; 82 | }; 83 | 84 | #endif /* MINIMUMSPANNINGTREE_H_ */ 85 | -------------------------------------------------------------------------------- /src/monosat/dgl/Reach.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #include "Reach.h" 23 | 24 | using namespace dgl; 25 | Reach::NullStatus Reach::nullStatus; 26 | 27 | -------------------------------------------------------------------------------- /src/monosat/dgl/SteinerTree.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef STEINERTREE_H_ 23 | #define STEINERTREE_H_ 24 | 25 | #include 26 | 27 | namespace dgl { 28 | 29 | template 30 | class SteinerTree { 31 | public: 32 | 33 | struct NullStatus { 34 | 35 | void setMinimumSteinerTree(Weight min_weight){ 36 | 37 | } 38 | 39 | }; 40 | 41 | static NullStatus nullStatus; 42 | 43 | virtual ~SteinerTree(){ 44 | }; 45 | 46 | virtual void printStats(){ 47 | 48 | } 49 | 50 | virtual void update() = 0; 51 | 52 | //Total weight of the steiner tree (or infinite, if the graph is disconnected) 53 | virtual Weight& weight() = 0; 54 | 55 | virtual bool disconnected() = 0; 56 | 57 | virtual void getSteinerTree(std::vector& edges) = 0; 58 | }; 59 | 60 | template 61 | typename SteinerTree::NullStatus SteinerTree::nullStatus; 62 | }; 63 | #endif 64 | -------------------------------------------------------------------------------- /src/monosat/dgl/alg/LinkCutCost.cpp: -------------------------------------------------------------------------------- 1 | #include "LinkCutCost.h" 2 | #include 3 | #include 4 | #include 5 | 6 | template<> 7 | const int LinkCutCost::INF = INT_MAX / 2; 8 | template<> 9 | const int64_t LinkCutCost::INF = LONG_MAX / 2; 10 | template<> 11 | const mpq_class LinkCutCost::INF = LONG_MAX;//fix this... 12 | template<> 13 | const double LinkCutCost::INF = std::numeric_limits::infinity(); 14 | template<> 15 | const float LinkCutCost::INF = std::numeric_limits::infinity(); 16 | 17 | 18 | //template 19 | //const Weight LinkCutCost::INF=std::numeric_limits::infinity(); 20 | -------------------------------------------------------------------------------- /src/monosat/dgl/alg/Rnd.h: -------------------------------------------------------------------------------- 1 | /*******************************************************************************************[Rnd.h] 2 | Copyright (c) 2012, Niklas Sorensson 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 4 | associated documentation files (the "Software"), to deal in the Software without restriction, 5 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 6 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or 10 | substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 13 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 14 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 15 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 16 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | **************************************************************************************************/ 18 | 19 | #ifndef DGL_Minisat_Rnd_h 20 | #define DGL_Minisat_Rnd_h 21 | 22 | #include 23 | 24 | namespace dgl { 25 | namespace alg { 26 | 27 | // Generate a random double: 28 | static inline double drand(double& seed){ 29 | seed *= 1389796; 30 | int q = (int) (seed / 2147483647); 31 | seed -= (double) q * 2147483647; 32 | return seed / 2147483647; 33 | } 34 | 35 | // Generate a random integer: 36 | static inline int irand(double& seed, int size){ 37 | return (int) (drand(seed) * size); 38 | } 39 | 40 | // Randomly shuffle the contents of a vector: 41 | template 42 | static void randomShuffle(double& seed, V& xs){ 43 | for(int i = 0; i < xs.size(); i++){ 44 | int pick = i + irand(seed, xs.size() - i); 45 | auto tmp = xs[i]; 46 | xs[i] = xs[pick]; 47 | xs[pick] = tmp; 48 | } 49 | } 50 | 51 | // Randomly shuffle the contents of a vector: 52 | template 53 | static void randomShuffle(double& seed, std::vector& xs){ 54 | for(int i = 0; i < xs.size(); i++){ 55 | int pick = i + irand(seed, xs.size() - i); 56 | T tmp = xs[i]; 57 | xs[i] = xs[pick]; 58 | xs[pick] = tmp; 59 | } 60 | } 61 | 62 | 63 | //================================================================================================= 64 | } 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /src/monosat/dgl/alg/SearchTree.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef SEARCH_TREE_H 23 | #define SEARCH_TREE_H 24 | 25 | template 26 | class SearchTree { 27 | 28 | public: 29 | 30 | 31 | SearchTree(){ 32 | 33 | } 34 | 35 | virtual ~SearchTree(){ 36 | 37 | } 38 | 39 | virtual Node* findRoot(Node* of) = 0; 40 | 41 | virtual Node* findMin(Node* root) = 0; 42 | 43 | virtual Node* findMax(Node* root) = 0; 44 | 45 | //virtual void remove(Node * toRemove)=0; 46 | virtual Node* splitAfter(Node* splitAt) = 0; 47 | 48 | virtual Node* splitBefore(Node* splitAt) = 0; 49 | 50 | //All nodes in right must be (strictly) greater than all nodes in left 51 | virtual Node* concat(Node* left, Node* right) = 0; 52 | }; 53 | 54 | template 55 | class AugmentedSearchTree : public SearchTree { 56 | 57 | public: 58 | 59 | AugmentedSearchTree(){ 60 | 61 | } 62 | 63 | virtual ~AugmentedSearchTree(){ 64 | 65 | } 66 | 67 | //Returns the number of nodes in the subtree rooted at n (including n) 68 | virtual int size(Node* n) = 0; 69 | 70 | virtual Node* findRoot(Node* of) = 0; 71 | 72 | virtual Node* findMin(Node* root) = 0; 73 | 74 | virtual Node* findMax(Node* root) = 0; 75 | 76 | virtual int depth(Node* a) = 0; 77 | 78 | //Return -1 if a< b, 1 if a>b, 0 if either they are the same node, or not in the same tree. 79 | virtual int compare(Node* a, Node* b) = 0; 80 | 81 | //virtual void remove(Node * toRemove)=0; 82 | virtual Node* splitAfter(Node* splitAt) = 0; 83 | 84 | virtual Node* splitBefore(Node* splitAt) = 0; 85 | 86 | //All nodes in right must be (strictly) greater than all nodes in left 87 | virtual Node* concat(Node* left, Node* right) = 0; 88 | }; 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/monosat/fsm/alg/NFAAcceptor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sam on 13/03/16. 3 | // 4 | 5 | #ifndef MONOSAT_NFAACCEPTOR_H 6 | #define MONOSAT_NFAACCEPTOR_H 7 | 8 | #include "monosat/mtl/Vec.h" 9 | #include "monosat/fsm/alg/NFATypes.h" 10 | 11 | namespace Monosat { 12 | class NFAAcceptor { 13 | public: 14 | NFAAcceptor(){ 15 | 16 | } 17 | 18 | virtual ~NFAAcceptor(){ 19 | 20 | } 21 | 22 | virtual void update() = 0; 23 | 24 | virtual void setTrackStringAcceptance(int str, int state, bool trackPositiveAcceptance, 25 | bool trackNegativeAcceptance) = 0; 26 | 27 | virtual int numUpdates() const = 0;; 28 | 29 | virtual bool acceptsString(int string, int state) = 0; 30 | 31 | virtual bool getPath(int string, int state, vec& path) = 0; 32 | 33 | //Get an accepting path in the FSM, but don't include multiple copies of the same FSM transition 34 | virtual bool getAbstractPath(int string, int state, vec& path, bool reversed = false) = 0; 35 | }; 36 | }; 37 | #endif //MONOSAT_NFAACCEPTOR_H 38 | -------------------------------------------------------------------------------- /src/monosat/fsm/alg/NFATypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NFATypes.h 3 | * 4 | * Created on: Dec 21, 2014 5 | * Author: sam 6 | */ 7 | 8 | #ifndef NFATYPES_H_ 9 | #define NFATYPES_H_ 10 | 11 | 12 | struct NFATransition { 13 | int edgeID; 14 | int input; 15 | int output; 16 | }; 17 | 18 | struct FSMNullStatus { 19 | void accepts(int string, int state, int edgeID, int label){ 20 | 21 | } 22 | 23 | void accepts(int string, int state, int edgeID, int label, bool accepts){ 24 | 25 | } 26 | 27 | void generates(int string, bool generates){ 28 | 29 | } 30 | }; 31 | 32 | static FSMNullStatus fsmNullStatus; 33 | #endif /* NFATYPES_H_ */ 34 | -------------------------------------------------------------------------------- /src/monosat/graph/GraphTheoryTypes.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | #ifndef GRAPHTHEORYTYPES_H_ 23 | #define GRAPHTHEORYTYPES_H_ 24 | 25 | #include 26 | #include "monosat/core/SolverTypes.h" 27 | #include "monosat/mtl/Rnd.h" 28 | 29 | namespace Monosat { 30 | 31 | 32 | struct Edge { 33 | Var v; 34 | Var outerVar; 35 | int from; 36 | int to; 37 | int edgeID; 38 | int bvID; 39 | 40 | Edge(Var v, Var outerVar, int from, int to, int edgeID, int bvID = -1) : 41 | v(v), outerVar(outerVar), from(from), to(to), edgeID(edgeID), bvID(bvID){ //,weight(weight){ 42 | 43 | } 44 | 45 | Edge() : 46 | v(var_Undef), outerVar(var_Undef), from(-1), to(-1), edgeID(-1), bvID(-1){ //,weight(0){ 47 | 48 | } 49 | }; 50 | }; 51 | 52 | #endif /* GRAPHTHEORYTYPES_H_ */ 53 | -------------------------------------------------------------------------------- /src/monosat/mtl/IntTypes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************[IntTypes.h] 2 | Copyright (c) 2009-2010, Niklas Sorensson 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 7 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or 11 | substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 17 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | **************************************************************************************************/ 19 | 20 | #ifndef Minisat_IntTypes_h 21 | #define Minisat_IntTypes_h 22 | 23 | #ifdef __sun 24 | // Not sure if there are newer versions that support C99 headers. The 25 | // needed features are implemented in the headers below though: 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #else 32 | 33 | #include 34 | #include 35 | 36 | #endif 37 | 38 | #include 39 | 40 | //================================================================================================= 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/monosat/mtl/Rnd.h: -------------------------------------------------------------------------------- 1 | /*******************************************************************************************[Rnd.h] 2 | Copyright (c) 2012, Niklas Sorensson 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 4 | associated documentation files (the "Software"), to deal in the Software without restriction, 5 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 6 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or 10 | substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 13 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 14 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 15 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 16 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | **************************************************************************************************/ 18 | 19 | #ifndef Minisat_Rnd_h 20 | #define Minisat_Rnd_h 21 | 22 | #include "monosat/mtl/Vec.h" 23 | 24 | namespace Monosat { 25 | 26 | // Generate a random double: 27 | static inline double drand(double& seed){ 28 | seed *= 1389796; 29 | int q = (int) (seed / 2147483647); 30 | seed -= (double) q * 2147483647; 31 | return seed / 2147483647; 32 | } 33 | 34 | // Generate a random integer: 35 | static inline int irand(double& seed, int size){ 36 | return (int) (drand(seed) * size); 37 | } 38 | 39 | // Randomly shuffle the contents of a vector: 40 | template 41 | static void randomShuffle(double& seed, V& xs){ 42 | for(int i = 0; i < xs.size(); i++){ 43 | int pick = i + irand(seed, xs.size() - i); 44 | auto tmp = xs[i]; 45 | xs[i] = xs[pick]; 46 | xs[pick] = tmp; 47 | } 48 | } 49 | 50 | // Randomly shuffle the contents of a vector: 51 | template 52 | static void randomShuffle(double& seed, vec& xs){ 53 | for(int i = 0; i < xs.size(); i++){ 54 | int pick = i + irand(seed, xs.size() - i); 55 | T tmp = xs[i]; 56 | xs[i] = xs[pick]; 57 | xs[pick] = tmp; 58 | } 59 | } 60 | 61 | // Randomly shuffle a vector of a vector (ugly) 62 | template 63 | static void randomShuffle(double& seed, vec>& xs){ 64 | for(int i = 0; i < xs.size(); i++){ 65 | int pick = i + irand(seed, xs.size() - i); 66 | vec tmp; 67 | xs[i].moveTo(tmp); 68 | xs[pick].moveTo(xs[i]); 69 | tmp.moveTo(xs[pick]); 70 | } 71 | } 72 | 73 | //================================================================================================= 74 | }// namespace Minisat 75 | #endif 76 | -------------------------------------------------------------------------------- /src/monosat/mtl/XAlloc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************************[XAlloc.h] 2 | Copyright (c) 2009-2010, Niklas Sorensson 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 7 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or 11 | substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 17 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | **************************************************************************************************/ 19 | 20 | #ifndef Minisat_XAlloc_h 21 | #define Minisat_XAlloc_h 22 | 23 | #include 24 | #include 25 | 26 | namespace Monosat { 27 | 28 | //================================================================================================= 29 | // Simple layer on top of malloc/realloc to catch out-of-memory situtaions and provide some typing: 30 | 31 | class OutOfMemoryException : public std::exception { 32 | }; 33 | 34 | static inline void* xrealloc(void* ptr, size_t size){ 35 | void* mem = realloc(ptr, size); 36 | if(mem == NULL && errno == ENOMEM){ 37 | throw OutOfMemoryException(); 38 | }else 39 | return mem; 40 | } 41 | 42 | //================================================================================================= 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/monosat/pb/ADTs/VecAlloc.h: -------------------------------------------------------------------------------- 1 | #ifndef VecAlloc_h 2 | #define VecAlloc_h 3 | 4 | #include 5 | #include "Global.h" 6 | //================================================================================================= 7 | namespace Monosat { 8 | namespace PB { 9 | template 10 | class VecAlloc { 11 | 12 | union Slot { 13 | char data[sizeof(T)]; // (would have liked type 'T' here) 14 | Slot* next; 15 | }; 16 | 17 | Slot* table; 18 | int index; 19 | Slot* recycle; 20 | #ifdef DEBUG_PB 21 | int nallocs; 22 | #endif 23 | 24 | void newTable(void){ 25 | Slot* t = xmalloc(chunk_size); 26 | t[0].next = table; 27 | table = t; 28 | index = 1; 29 | } 30 | 31 | public: 32 | VecAlloc(void){ 33 | recycle = nullptr; 34 | table = nullptr; 35 | #ifdef DEBUG_PB 36 | nallocs = 0; 37 | #endif 38 | newTable(); 39 | } 40 | 41 | ~VecAlloc(void){ 42 | #ifdef DEBUG_PB 43 | //if (nallocs != 0) fprintf(stderr, "WARNING! VecAlloc detected leak of %d unit(s) of type '%s'.\n", nallocs, typeid(T).name()); 44 | if (nallocs != 0) fprintf(stderr, "WARNING! VecAlloc detected leak of %d unit(s) of size %lu.\n", nallocs, sizeof(T)); 45 | #endif 46 | Slot* curr, * next; 47 | curr = table; 48 | while(curr != nullptr) 49 | next = curr[0].next, 50 | xfree(curr), 51 | curr = next; 52 | } 53 | 54 | T* alloc(void){ 55 | #ifdef DEBUG_PB 56 | nallocs++; 57 | #endif 58 | if(recycle == nullptr){ 59 | if(index >= chunk_size) 60 | newTable(); 61 | return (T*) &table[index++]; 62 | }else{ 63 | T* tmp = (T*) recycle; 64 | recycle = (*recycle).next; 65 | return tmp; 66 | } 67 | } 68 | 69 | void free(T* ptr){ 70 | #ifdef DEBUG_PB 71 | nallocs--; 72 | #endif 73 | ((Slot*) ptr)->next = recycle; 74 | recycle = (Slot*) ptr; 75 | } 76 | }; 77 | } 78 | } 79 | //================================================================================================= 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/monosat/pb/Clausify.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************[Hardware_sorters.cc] 2 | Copyright (c) 2016, Sam Bayless 3 | Copyright (c) 2005-2010, Niklas Een, Niklas Sorensson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 8 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or 12 | substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 15 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 18 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | **************************************************************************************************/ 20 | #ifndef MONOSAT_CLAUSIFY_CONTEXT_H_H 21 | #define MONOSAT_CLAUSIFY_CONTEXT_H_H 22 | 23 | #include "monosat/core/SolverTypes.h" 24 | #include "monosat/pb/ADTs/FEnv.h" 25 | 26 | namespace Monosat { 27 | namespace PB { 28 | 29 | struct ClausifyContext { 30 | CMap occ; 31 | CMap vmap; 32 | CMap vmapp; 33 | 34 | ClausifyContext() : occ(0), vmap(var_Undef), vmapp(lit_Undef){ 35 | 36 | } 37 | /*CMap Clausifier::occ(0); 38 | CMap Clausifier::vmap(var_Undef); 39 | CMap Clausifier::vmapp(lit_Undef);*/ 40 | }; 41 | } 42 | } 43 | 44 | #endif //MONOSAT_CLAUSIFY_CONTEXT_H_H 45 | -------------------------------------------------------------------------------- /src/monosat/pb/Config_pb.cpp: -------------------------------------------------------------------------------- 1 | #include "Config_pb.h" 2 | 3 | using namespace Monosat::PB; 4 | static const char* _cat_pb = "PB"; 5 | 6 | Monosat::BoolOption Monosat::PB::opt_try(_cat_pb, "pb-try", 7 | "(hidden option -- if set, then \"try\" to parse, but don't output \"s UNKNOWN\" if you fail, instead exit with error code 5)", 8 | false); 9 | 10 | Monosat::IntOption Monosat::PB::opt_verbosity(_cat_pb, "pb-verb", 11 | "", 0, IntRange(0, 3)); 12 | Monosat::BoolOption Monosat::PB::opt_preprocess(_cat_pb, "pb-pre", "", true); 13 | Monosat::BoolOption Monosat::PB::opt_convert_weak(_cat_pb, "pb-convert-weak", "", true); 14 | Monosat::DoubleOption Monosat::PB::opt_bdd_thres(_cat_pb, "pb-bdd-threshold", "", 3, 15 | DoubleRange(0, false, HUGE_VAL, false)); 16 | Monosat::DoubleOption Monosat::PB::opt_sort_thres(_cat_pb, "pb-sort-threshold", "", 20, 17 | DoubleRange(0, false, HUGE_VAL, false)); 18 | Monosat::DoubleOption Monosat::PB::opt_goal_bias(_cat_pb, "pb-goal-bias", "", 3, 19 | DoubleRange(0, false, HUGE_VAL, false)); 20 | Monosat::Int64Option Monosat::PB::opt_goal(_cat_pb, "pb-goal-bias", "", 9223372036854775807LL, 21 | Int64Range(INT64_MIN, INT64_MAX)); 22 | Monosat::BoolOption Monosat::PB::opt_branch_pbvars(_cat_pb, "pb-branch-pbvars", "", false); 23 | Monosat::IntOption Monosat::PB::opt_polarity_sug(_cat_pb, "pb-polarity", "", 1, IntRange(-1, 1)); 24 | 25 | ConvertT Monosat::PB::opt_convert = ct_Mixed; 26 | ConvertT Monosat::PB::opt_convert_goal = ct_Undef; 27 | Command Monosat::PB::opt_command = cmd_Minimize; 28 | 29 | -------------------------------------------------------------------------------- /src/monosat/pb/Config_pb.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sam on 06/07/16. 3 | // 4 | 5 | #ifndef MONOSAT_CONFIG_PB_H 6 | #define MONOSAT_CONFIG_PB_H 7 | 8 | #include "monosat/pb/ADTs/Int.h" 9 | #include "monosat/pb/ADTs/Global.h" 10 | #include "monosat/utils/Options.h" 11 | 12 | 13 | namespace Monosat { 14 | namespace PB { 15 | enum SolverT { 16 | st_MiniSat, st_SatELite 17 | }; 18 | enum ConvertT { 19 | ct_Sorters, ct_Adders, ct_BDDs, ct_Mixed, ct_Undef 20 | }; 21 | enum Command { 22 | cmd_Minimize, cmd_FirstSolution, cmd_AllSolutions 23 | }; 24 | 25 | // -- output options: 26 | //these two moved to Global.h 27 | /*extern bool opt_satlive; 28 | extern bool opt_ansi;*/ 29 | 30 | extern IntOption opt_verbosity; 31 | extern BoolOption opt_try; 32 | 33 | // -- solver options: 34 | extern ConvertT opt_convert; 35 | extern ConvertT opt_convert_goal; 36 | extern BoolOption opt_convert_weak; 37 | extern DoubleOption opt_bdd_thres; 38 | extern DoubleOption opt_sort_thres; 39 | extern DoubleOption opt_goal_bias; 40 | extern Int64Option opt_goal; 41 | extern Command opt_command; 42 | extern BoolOption opt_branch_pbvars; 43 | extern IntOption opt_polarity_sug; 44 | extern BoolOption opt_preprocess; 45 | } 46 | } 47 | #endif //MONOSAT_CONFIG_PB_H 48 | -------------------------------------------------------------------------------- /src/monosat/pb/Debug.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************************[Debug.h] 2 | Copyright (c) 2005-2010, Niklas Een, Niklas Sorensson 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 7 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or 11 | substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 17 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | **************************************************************************************************/ 19 | 20 | #ifndef Debug_h 21 | #define Debug_h 22 | 23 | #include "monosat/core/SolverTypes.h" 24 | #include "PbSolver.h" 25 | #include "monosat/pb/ADTs/FEnv.h" 26 | 27 | 28 | //================================================================================================= 29 | namespace Monosat { 30 | namespace PB { 31 | 32 | extern vec* debug_names; 33 | 34 | void dump(Int num); 35 | 36 | void dump(Lit p); 37 | 38 | void dump(Formula f); 39 | 40 | void dump(const vec& ps, const vec& Cs); 41 | 42 | void dump(const vec& ps, const vec& Cs, const vec& assigns); 43 | 44 | void dump(const vec& ps, const vec& Cs); 45 | 46 | void dump(const Linear& pb, const vec& assigns); 47 | 48 | void dump(const Linear& pb); 49 | 50 | macro void dump(Linear* pb){dump(*pb);} 51 | } 52 | } 53 | 54 | //================================================================================================= 55 | #endif 56 | -------------------------------------------------------------------------------- /src/monosat/pb/Hardware.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************[Hardware.h] 2 | Copyright (c) 2005-2010, Niklas Een, Niklas Sorensson 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 7 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or 11 | substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 17 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | **************************************************************************************************/ 19 | 20 | #ifndef Hardware_h 21 | #define Hardware_h 22 | 23 | #include "PbSolver.h" 24 | #include "monosat/pb/ADTs/FEnv.h" 25 | 26 | //================================================================================================= 27 | namespace Monosat { 28 | namespace PB { 29 | 30 | int estimatedAdderCost(const Linear& c); 31 | 32 | void oddEvenSort(vec& fs); 33 | 34 | void rippleAdder(const vec& xs, const vec& ys, vec& out); 35 | 36 | void addPb(const vec& ps, const vec& Cs_, vec& out, int bits); 37 | 38 | void clausify(PbSolver& s, const vec& fs, vec& out); 39 | 40 | void clausify(PbSolver& s, const vec& fs); 41 | } 42 | } 43 | 44 | //================================================================================================= 45 | #endif 46 | -------------------------------------------------------------------------------- /src/monosat/pb/Pb.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2016, Sam Bayless 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 7 | associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 9 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 16 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 19 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | **************************************************************************************************/ 21 | 22 | 23 | #ifndef MONOSAT_PB_H 24 | #define MONOSAT_PB_H 25 | 26 | #include "monosat/core/SolverTypes.h" 27 | 28 | namespace Monosat { 29 | namespace PB { 30 | enum Ineq { 31 | LT = -2, 32 | LEQ = -1, 33 | EQ = 0, 34 | GEQ = 1, 35 | GT = 2 36 | }; 37 | 38 | //abstract interface to Psuedoboolean constraint solver 39 | class PBConstraintSolver { 40 | public: 41 | virtual ~PBConstraintSolver(){ 42 | 43 | } 44 | 45 | virtual bool addConstr(const vec& ps, const vec& Cs, int rhs, Ineq ineq) = 0; 46 | 47 | virtual Lit 48 | addConditionalConstr(const vec& ps, const vec& Cs, int rhs, Ineq ineq, Lit cond = lit_Undef) = 0; 49 | 50 | virtual void convert(){ 51 | 52 | } 53 | }; 54 | } 55 | } 56 | #endif //MONOSAT_PB_H 57 | -------------------------------------------------------------------------------- /src/monosat/pb/README.md: -------------------------------------------------------------------------------- 1 | MonosatPB 2 | --- 3 | MonosatPB is a fork of Minisat+ that has been altered for use with [MonoSAT](https://github.com/sambayless/monosat). 4 | If you are just looking for a pseudo-Boolean constraint solver, consider [Minisat+](https://github.com/niklasso/minisatp). 5 | 6 | Minisat+ was originally released with the following license: 7 | 8 | MiniSat+ -- Copyright (c) 2005-2010, Niklas Een, Niklas Sorensson 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a 11 | copy of this software and associated documentation files (the 12 | "Software"), to deal in the Software without restriction, including 13 | without limitation the rights to use, copy, modify, merge, publish, 14 | distribute, sublicense, and/or sell copies of the Software, and to 15 | permit persons to whom the Software is furnished to do so, subject to 16 | the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 25 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 26 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 27 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /tests/python/rnd_bv_eq.py: -------------------------------------------------------------------------------- 1 | import functools 2 | import math 3 | from monosat import * 4 | import os 5 | from random import shuffle 6 | import random 7 | import random 8 | import sys 9 | import itertools 10 | 11 | filename=None 12 | if __name__ == "__main__": 13 | seed = random.randint(1,100000) 14 | 15 | 16 | if len(sys.argv)>1: 17 | filename=sys.argv[1] 18 | if len(sys.argv)>2: 19 | seed=int(sys.argv[2]) 20 | 21 | 22 | Monosat.newSolver(output_file=filename) 23 | print("begin encode"); 24 | 25 | random.seed(seed) 26 | print("RandomSeed=" + str(seed)) 27 | 28 | width=4 29 | 30 | 31 | bvs = [] 32 | nbvs= 10 33 | 34 | 35 | 36 | 37 | for i in range(nbvs): 38 | bvs.append(BitVector(width)) 39 | 40 | pairs=[ (a,b) for a,b in itertools.combinations(range(nbvs), 2) if a!=b] 41 | neqs = len(pairs) 42 | print(len(pairs)) 43 | shuffle(pairs) 44 | eq_pairs = pairs 45 | print(eq_pairs) 46 | 47 | eqs=[] 48 | for a,b in eq_pairs: 49 | assert(a!=b) 50 | eqs.append(bvs[a]==bvs[b]) 51 | 52 | AssertEqualPB(eqs, len(eqs)//2); 53 | 54 | vals = [] 55 | for bv in bvs: 56 | n=random.randint(0,1<1: 17 | filename=sys.argv[1] 18 | if len(sys.argv)>2: 19 | seed=int(sys.argv[2]) 20 | 21 | 22 | print("begin encode"); 23 | 24 | Monosat().newSolver(filename) 25 | 26 | random.seed(seed) 27 | print("RandomSeed=" + str(seed)) 28 | 29 | width=4 30 | 31 | bvs = [] 32 | nbvs= 20 33 | nsubsets=5 34 | 35 | for i in range(nbvs): 36 | bvs.append(BitVector(width, random.randint(0,1<1: 17 | filename=sys.argv[1] 18 | if len(sys.argv)>2: 19 | seed=int(sys.argv[2]) 20 | 21 | 22 | print("begin encode"); 23 | Monosat.newSolver(output_file=filename) 24 | #seed = random.randint(1,100000) # 3538 25 | 26 | random.seed(seed) 27 | print("RandomSeed=" + str(seed)) 28 | 29 | width=4 30 | 31 | bvs = [] 32 | nbvs= 15 33 | nsubsets=6 34 | vals = [] 35 | for i in range(nbvs): 36 | r = random.randint(0,(1<1: 17 | filename=sys.argv[1] 18 | if len(sys.argv)>2: 19 | seed=int(sys.argv[2]) 20 | Monosat().newSolver("-debug-learnts=/tmp/test.learnts -debug-analysis",filename) 21 | 22 | print("begin encode"); 23 | 24 | random.seed(seed) 25 | print("RandomSeed=" + str(seed)) 26 | # 27 | width=4 28 | 29 | 30 | nbvs= 15 31 | nsubsets=8 32 | 33 | selects = [] 34 | for n in range(nbvs): 35 | selects.append(true() if random.random()>0.5 else false()) 36 | 37 | max_subsets=[] 38 | min_subsets=[] 39 | selecteds=[] 40 | for i in range(nsubsets): 41 | max_subset=[] 42 | min_subset=[] 43 | selected=[] 44 | selecteds.append(selected) 45 | max_subsets.append(max_subset) 46 | min_subsets.append(min_subset) 47 | for v in selects: 48 | select = Var() 49 | selected.append(select) 50 | max_subset.append(If(select,v,false())) #1<1: 71 | filename=sys.argv[1] 72 | if len(sys.argv)>2: 73 | seed=int(sys.argv[2]) 74 | 75 | r =run(seed,filename) 76 | if r: 77 | sys.exit(10) 78 | else: 79 | sys.exit(20) -------------------------------------------------------------------------------- /tests/python/rnd_diophantine.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | import functools 4 | import math 5 | import os 6 | import random 7 | import random 8 | import sys 9 | 10 | def run(seed,filename): 11 | Monosat().newSolver(filename) 12 | if filename is not None: 13 | print("Writing to %s"%(filename)) 14 | 15 | 16 | random.seed(seed) 17 | print("RandomSeed=" + str(seed)) 18 | 19 | bitwidth=8 20 | n_equations=3 21 | n_vars=4 22 | max_co = 10 23 | 24 | vars=[] 25 | for i in range(n_vars): 26 | vars.append(BitVector(bitwidth)) 27 | 28 | for i in range(n_equations): 29 | coefficients=[] 30 | for c in range(n_vars): 31 | coefficients.append(random.randint(0,3)) 32 | val = random.randint(0,max_co*n_vars) 33 | rhs = BitVector(bitwidth, val) 34 | sum = BitVector(bitwidth,0) 35 | 36 | for j in range(len(coefficients)): 37 | for k in range( coefficients[j]): 38 | sum = sum + ( vars[j]) #simulation multiplication for now 39 | Assert(sum==rhs) 40 | print(str(i) + ": " + str(coefficients) + " = " + str(val) ) 41 | 42 | result =Solve() 43 | 44 | print("Result is " + str(result)) 45 | 46 | if(result): 47 | 48 | for i in range(len(vars)): 49 | print(str(i) + "= " + str(vars[i].value())) 50 | return result 51 | 52 | if __name__ == "__main__": 53 | seed = random.randint(1,100000) 54 | filename=None 55 | 56 | if len(sys.argv)>1: 57 | filename=sys.argv[1] 58 | if len(sys.argv)>2: 59 | seed=int(sys.argv[2]) 60 | 61 | r =run(seed,filename) 62 | if r: 63 | sys.exit(10) 64 | else: 65 | sys.exit(20) -------------------------------------------------------------------------------- /tests/python/rnd_diophantine_01.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | 3 | import functools 4 | import math 5 | import os 6 | import random 7 | import random 8 | import sys 9 | 10 | print("Generate random 0-1 diophantine equation") 11 | 12 | seed = random.randint(1,100000) 13 | 14 | random.seed(seed) 15 | print("RandomSeed=" + str(seed)) 16 | 17 | bitwidth=8 18 | n_equations=3 19 | n_vars=3 20 | max_co = 10 21 | 22 | vars=[] 23 | for i in range(n_vars): 24 | vars.append(BitVector(bitwidth)) 25 | 26 | for i in range(n_equations): 27 | coefficients=[] 28 | for c in range(n_vars): 29 | coefficients.append(random.randint(0,1)) 30 | val = random.randint(0,max_co*n_vars) 31 | rhs = BitVector(bitwidth, val) 32 | sum = BitVector(bitwidth,0) 33 | 34 | for j in range(len(coefficients)): 35 | if coefficients[j]>0: 36 | sum = sum + ( vars[j]) 37 | Assert(sum==rhs) 38 | print(str(i) + ": " + str(coefficients) + " = " + str(val) ) 39 | 40 | result =Solve() 41 | 42 | print("Result is " + str(result)) 43 | 44 | if(result): 45 | 46 | for i in range(len(vars)): 47 | print(str(i) + "= " + str(vars[i].value())) 48 | 49 | 50 | -------------------------------------------------------------------------------- /tests/python/rnd_pb_opt.py: -------------------------------------------------------------------------------- 1 | from monosat import * 2 | import functools 3 | import math 4 | from monosat import * 5 | import os 6 | from random import shuffle 7 | import random 8 | import random 9 | import sys 10 | import itertools 11 | 12 | filename=None 13 | if __name__ == "__main__": 14 | seed = random.randint(1,100000) 15 | if len(sys.argv)>1: 16 | filename=sys.argv[1] 17 | if len(sys.argv)>2: 18 | seed=int(sys.argv[2]) 19 | 20 | Monosat().newSolver(filename) 21 | 22 | print("begin encode"); 23 | 24 | random.seed(seed) 25 | print("RandomSeed=" + str(seed)) 26 | # 27 | width=4 28 | 29 | 30 | nbvs= 15 31 | nsubsets=8 32 | 33 | selects = [] 34 | for n in range(nbvs): 35 | selects.append(true() if random.random()>0.5 else false()) 36 | 37 | max_subsets=[] 38 | min_subsets=[] 39 | selecteds=[] 40 | for i in range(nsubsets): 41 | 42 | max_subset=[] 43 | min_subset=[] 44 | selected=[] 45 | selecteds.append(selected) 46 | max_subsets.append(max_subset) 47 | min_subsets.append(min_subset) 48 | weights = [] 49 | for v in selects: 50 | weights.append(random.randint(-10,10)) 51 | select = Var() 52 | selected.append(select) 53 | max_subset.append(If(select,v,false())) #1<