lkh-rs 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lkh_rs-0.1.0/.github/workflows/ci.yml +56 -0
- lkh_rs-0.1.0/.github/workflows/python.yml +55 -0
- lkh_rs-0.1.0/.github/workflows/release.yml +194 -0
- lkh_rs-0.1.0/.gitignore +26 -0
- lkh_rs-0.1.0/CHANGELOG.md +36 -0
- lkh_rs-0.1.0/Cargo.lock +973 -0
- lkh_rs-0.1.0/Cargo.toml +47 -0
- lkh_rs-0.1.0/LICENSE +21 -0
- lkh_rs-0.1.0/PKG-INFO +244 -0
- lkh_rs-0.1.0/README.md +229 -0
- lkh_rs-0.1.0/benches/solve.rs +15 -0
- lkh_rs-0.1.0/build.demo.unix.yaml +16 -0
- lkh_rs-0.1.0/build.demo.win.yaml +14 -0
- lkh_rs-0.1.0/build.osx.yaml +19 -0
- lkh_rs-0.1.0/build.rs +304 -0
- lkh_rs-0.1.0/build.unix.yaml +19 -0
- lkh_rs-0.1.0/build.win.yaml +19 -0
- lkh_rs-0.1.0/build.yaml +19 -0
- lkh_rs-0.1.0/docs/fastapi.md +40 -0
- lkh_rs-0.1.0/docs/performance.md +27 -0
- lkh_rs-0.1.0/docs/python.md +133 -0
- lkh_rs-0.1.0/docs/release.md +53 -0
- lkh_rs-0.1.0/docs/safety.md +25 -0
- lkh_rs-0.1.0/docs/wasm.md +88 -0
- lkh_rs-0.1.0/examples/fastapi_backend/README.md +54 -0
- lkh_rs-0.1.0/examples/fastapi_backend/app.py +370 -0
- lkh_rs-0.1.0/examples/fastapi_backend/case_catalog.py +661 -0
- lkh_rs-0.1.0/examples/fastapi_backend/requirements.txt +3 -0
- lkh_rs-0.1.0/examples/fastapi_backend/static/index.html +670 -0
- lkh_rs-0.1.0/examples/python/solve_programmatic.py +91 -0
- lkh_rs-0.1.0/examples/raw_ffi.rs +12 -0
- lkh_rs-0.1.0/examples/solve_parameter_file.rs +16 -0
- lkh_rs-0.1.0/examples/solve_programmatic.rs +79 -0
- lkh_rs-0.1.0/pyproject.toml +24 -0
- lkh_rs-0.1.0/python/lkh_rs/__init__.py +648 -0
- lkh_rs-0.1.0/python/lkh_rs/_native.pyi +32 -0
- lkh_rs-0.1.0/python/lkh_rs/py.typed +0 -0
- lkh_rs-0.1.0/source_code/.gitignore +7 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-2_USER_GUIDE.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-3_PARAMETERS.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-3_REPORT.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH_Genetic.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH_REPORT.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/POPMUSIC_REPORT.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/TSPLIB_DOC.pdf +0 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/Makefile +4 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/README.txt +248 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Activate.c +31 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddCandidate.c +47 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddExtraCandidates.c +50 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddTourCandidates.c +82 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AdjustCandidateSet.c +60 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AdjustClusters.c +58 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AllocateStructures.c +110 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Ascent.c +210 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BIT.c +319 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best2OptMove.c +129 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best3OptMove.c +202 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best4OptMove.c +341 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best5OptMove.c +789 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BestKOptMove.c +244 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BestSpecialOptMove.c +758 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between.c +30 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between_SL.c +44 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between_SSL.c +62 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BridgeGain.c +270 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BuildKDTree.c +129 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/C.c +220 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CTSP_InitialTour.c +52 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CVRP_InitialTour.c +242 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CandidateReport.c +52 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ChooseInitialTour.c +218 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Connect.c +63 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateCandidateSet.c +190 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateDelaunayCandidateSet.c +108 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateNNCandidateSet.c +65 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateQuadrantCandidateSet.c +525 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Create_POPMUSIC_CandidateSet.c +721 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Delaunay.c +594 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance.c +266 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_MTSP.c +50 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_SOP.c +11 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_SPECIAL.c +32 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ERXT.c +151 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Excludable.c +22 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Exclude.c +22 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FindTour.c +181 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FixedOrCommonCandidates.c +28 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip.c +85 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip_SL.c +369 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip_SSL.c +593 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Forbidden.c +93 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FreeStructures.c +92 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GCTSP_InitialTour.c +59 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Gain23.c +355 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GenerateCandidates.c +158 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Genetic.c +283 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GeoConversion.c +53 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GetTime.c +38 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GreedyTour.c +417 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Hashing.c +75 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Heap.c +156 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/BIT.h +24 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/CLARIST.h +33 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Delaunay.h +47 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/GainType.h +32 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Genetic.h +38 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/GeoConversion.h +21 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Hashing.h +29 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Heap.h +20 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/LKH.h +655 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Segment.h +77 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Sequence.h +39 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/gpx.h +77 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Improvement.c +45 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsBackboneCandidate.c +18 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsCandidate.c +18 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsCommonEdge.c +20 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsPossibleCandidate.c +61 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/KSwapKick.HUNT.c +144 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/KSwapKick.c +81 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LKH.c +240 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LKHmain.c +267 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LinKernighan.c +208 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP2TSP.c +144 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_InitialTour.c +115 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_Report.c +41 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_WriteSolution.c +55 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make2OptMove.c +15 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make3OptMove.c +27 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make4OptMove.c +49 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make5OptMove.c +256 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MakeKOptMove.c +108 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Makefile +97 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeTourWithBestTour.c +34 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourCLARIST.c +582 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourGPX2.c +197 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourIPT.c +278 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Minimum1TreeCost.c +74 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MinimumSpanningTree.c +110 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/NormalizeNodeList.c +24 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/NormalizeSegmentList.c +28 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/OrderCandidateSet.c +234 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PCTSP_InitialTour.c +120 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PCTSP_RepairTour.c +121 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PDPTW_Reduce.c +43 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PatchCycles.c +313 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_1_PDTSP.c +29 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_ACVRP.c +56 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_BWTSP.c +45 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CBTSP.c +42 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CBnTSP.c +37 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CCCTSP.c +42 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CCVRP.c +56 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CTSP.c +33 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CTSP_D.c +31 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CVRP.c +52 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CVRPTW.c +54 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CluVRP.c +76 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_GCTSP.c +48 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_KTSP.c +18 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_M1_PDTSP.c +7 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MLP.c +42 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MSCTSP.c +44 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MTSP.c +108 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_M_PDTSP.c +44 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OKTSP.c +17 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OP.c +29 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OVRP.c +48 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PCTSP.c +89 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PC_TSP.c +48 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDPTW.c +72 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSP.c +50 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSPF.c +52 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSPL.c +43 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PTP.c +32 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PTSP.c +113 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_RCTVRP.c +60 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_SOP.c +56 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TOP.c +33 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TRP.c +42 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPDL.c +32 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPMD.c +124 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPPD.c +26 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPTW.c +27 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPB.c +45 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPBTW.c +56 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPPD.c +69 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PrintParameters.c +220 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Random.c +78 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadCandidates.c +74 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadEdges.c +78 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadLine.c +44 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadParameters.c +1297 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadPenalties.c +55 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadProblem.c +2788 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RecordBestTour.c +19 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RecordBetterTour.c +49 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RemoveFirstActive.c +23 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ResetCandidateSet.c +48 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RestoreTour.c +31 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SFCTour.c +176 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SINTEF_WriteSolution.c +44 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_InitialTour.c +104 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_RepairTour.c +79 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_Report.c +7 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/STTSP2TSP.c +102 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SegmentSize.c +135 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Sequence.c +176 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveCompressedSubproblem.c +40 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveDelaunaySubproblems.c +226 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKCenterSubproblems.c +106 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKMeansSubproblems.c +271 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKarpSubproblems.c +128 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveRoheSubproblems.c +248 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSFCSubproblems.c +94 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSubproblem.c +368 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSubproblemBorderProblems.c +252 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveTourSegmentSubproblems.c +87 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Statistics.c +113 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/StatusReport.c +28 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/StoreTour.c +45 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SymmetrizeCandidateSet.c +21 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TOP_WriteSolution.c +88 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPDL_InitialTour.c +71 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPTW_MakespanCost.c +20 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPTW_Reduce.c +50 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TrimCandidateSet.c +31 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/VRPB_Reduce.c +15 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WriteCandidates.c +47 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WritePenalties.c +34 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WriteTour.c +152 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/akef +1 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/eprintf.c +20 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/fscanint.c +36 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/gpx.c +1833 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/printff.c +16 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/pr2392.par +5 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/pr2392.tsp +2402 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/whizzkids96.atsp +128 -0
- lkh_rs-0.1.0/source_code/LKH-3.0.14/whizzkids96.par +9 -0
- lkh_rs-0.1.0/source_code/LKHDemo/.gitignore +2 -0
- lkh_rs-0.1.0/source_code/LKHDemo/CMakeLists.txt +29 -0
- lkh_rs-0.1.0/source_code/LKHDemo/Makefile +4 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/GetTime.c +37 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/INCLUDE/demo.h +9 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/INCLUDE/demo2.h +9 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/LKHmain.c +17 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/Makefile +32 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/demo.c +10 -0
- lkh_rs-0.1.0/source_code/LKHDemo/SRC/demo2.c +10 -0
- lkh_rs-0.1.0/source_code/LKHDemo/test.sh +29 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/Makefile +4 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Activate.c +29 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddCandidate.c +47 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddExtraCandidates.c +48 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddTourCandidates.c +82 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AdjustCandidateSet.c +60 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AdjustClusters.c +58 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AllocateStructures.c +110 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Ascent.c +202 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BIT.c +319 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best2OptMove.c +129 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best3OptMove.c +202 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best4OptMove.c +341 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best5OptMove.c +789 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BestKOptMove.c +244 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BestSpecialOptMove.c +758 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between.c +30 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between_SL.c +44 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between_SSL.c +62 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BridgeGain.c +270 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BuildKDTree.c +129 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/C.c +220 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CTSP_InitialTour.c +46 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CVRP_InitialTour.c +242 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CandidateReport.c +49 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ChooseInitialTour.c +204 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Connect.c +63 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateCandidateSet.c +189 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateDelaunayCandidateSet.c +108 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateNNCandidateSet.c +65 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateQuadrantCandidateSet.c +525 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Create_POPMUSIC_CandidateSet.c +736 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Delaunay.c +594 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance.c +266 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_MTSP.c +47 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_SOP.c +11 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_SPECIAL.c +32 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ERXT.c +151 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Excludable.c +22 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Exclude.c +22 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FindTour.c +171 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FixedOrCommonCandidates.c +27 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip.c +85 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip_SL.c +369 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip_SSL.c +593 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Forbidden.c +78 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FreeStructures.c +91 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Gain23.c +348 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GenerateCandidates.c +158 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Genetic.c +284 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GeoConversion.c +53 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GetTime.c +37 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GreedyTour.c +418 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Hashing.c +75 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Heap.c +156 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/BIT.h +24 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/CLARIST.h +35 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Delaunay.h +47 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/GainType.h +32 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Genetic.h +38 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/GeoConversion.h +21 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Hashing.h +29 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Heap.h +20 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/LKH.h +610 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Segment.h +77 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Sequence.h +39 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/gpx.h +77 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Improvement.c +40 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsBackboneCandidate.c +18 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsCandidate.c +18 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsCommonEdge.c +20 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsPossibleCandidate.c +61 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/KSwapKick.c +81 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LKH.c +222 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LKHmain.c +244 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LinKernighan.c +198 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP2TSP.c +102 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_InitialTour.c +115 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_Report.c +41 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_WriteSolution.c +45 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make2OptMove.c +15 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make3OptMove.c +27 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make4OptMove.c +49 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make5OptMove.c +256 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MakeKOptMove.c +108 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Makefile +85 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeTourWithBestTour.c +34 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourCLARIST.c +538 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourGPX2.c +181 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourIPT.c +263 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Minimum1TreeCost.c +74 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MinimumSpanningTree.c +110 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/NormalizeNodeList.c +24 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/NormalizeSegmentList.c +28 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/OrderCandidateSet.c +234 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PDPTW_Reduce.c +43 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PatchCycles.c +313 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_1_PDTSP.c +29 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_ACVRP.c +56 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_BWTSP.c +45 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CCVRP.c +56 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CTSP.c +33 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CVRP.c +51 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CVRPTW.c +54 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_KTSP.c +18 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_M1_PDTSP.c +7 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_MLP.c +42 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_MTSP.c +108 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_M_PDTSP.c +44 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_OVRP.c +48 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDPTW.c +72 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSP.c +50 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSPF.c +52 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSPL.c +43 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_RCTVRP.c +60 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_SOP.c +56 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TRP.c +42 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPDL.c +32 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPPD.c +26 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPTW.c +27 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPB.c +45 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPBTW.c +56 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPPD.c +69 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PrintParameters.c +204 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Random.c +78 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadCandidates.c +74 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadEdges.c +78 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadLine.c +44 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadParameters.c +1236 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadPenalties.c +56 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadProblem.c +2265 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RecordBestTour.c +19 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RecordBetterTour.c +49 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RemoveFirstActive.c +23 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ResetCandidateSet.c +48 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RestoreTour.c +31 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SFCTour.c +176 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SINTEF_WriteSolution.c +44 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_InitialTour.c +92 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_RepairTour.c +79 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_Report.c +7 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/STTSP2TSP.c +102 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SegmentSize.c +135 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Sequence.c +176 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveCompressedSubproblem.c +40 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveDelaunaySubproblems.c +226 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKCenterSubproblems.c +106 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKMeansSubproblems.c +271 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKarpSubproblems.c +128 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveRoheSubproblems.c +248 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSFCSubproblems.c +94 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSubproblem.c +368 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSubproblemBorderProblems.c +252 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveTourSegmentSubproblems.c +87 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Statistics.c +109 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/StatusReport.c +29 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/StoreTour.c +45 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SymmetrizeCandidateSet.c +21 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPDL_InitialTour.c +71 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPTW_MakespanCost.c +20 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPTW_Reduce.c +50 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TrimCandidateSet.c +31 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/VRPB_Reduce.c +15 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WriteCandidates.c +47 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WritePenalties.c +34 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WriteTour.c +109 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/eprintf.c +20 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/fscanint.c +36 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/gpx.c +1830 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/printff.c +16 -0
- lkh_rs-0.1.0/source_code/LKHWin-3.0.9/resource.h +14 -0
- lkh_rs-0.1.0/source_code/pr2392.par +6 -0
- lkh_rs-0.1.0/source_code/pr2392.tsp +2399 -0
- lkh_rs-0.1.0/source_code/wrapper.h +3 -0
- lkh_rs-0.1.0/src/.gitignore +1 -0
- lkh_rs-0.1.0/src/error.rs +50 -0
- lkh_rs-0.1.0/src/lib.rs +85 -0
- lkh_rs-0.1.0/src/main.rs +33 -0
- lkh_rs-0.1.0/src/problem.rs +919 -0
- lkh_rs-0.1.0/src/python.rs +136 -0
- lkh_rs-0.1.0/src/solver.rs +1272 -0
- lkh_rs-0.1.0/tests/cli.rs +19 -0
- lkh_rs-0.1.0/tests/fixtures/tiny.par +7 -0
- lkh_rs-0.1.0/tests/fixtures/tiny.tsp +11 -0
- lkh_rs-0.1.0/tests/solve.rs +168 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
CARGO_TERM_COLOR: always
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
rust:
|
|
17
|
+
name: Rust (${{ matrix.os }})
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
28
|
+
with:
|
|
29
|
+
components: rustfmt
|
|
30
|
+
|
|
31
|
+
- uses: Swatinem/rust-cache@v2
|
|
32
|
+
|
|
33
|
+
- name: Install bindgen dependencies (Ubuntu)
|
|
34
|
+
if: runner.os == 'Linux'
|
|
35
|
+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
|
|
36
|
+
|
|
37
|
+
- name: Install bindgen dependencies (Windows)
|
|
38
|
+
if: runner.os == 'Windows'
|
|
39
|
+
uses: KyleMayes/install-llvm-action@v2
|
|
40
|
+
with:
|
|
41
|
+
version: "18"
|
|
42
|
+
|
|
43
|
+
- name: Format
|
|
44
|
+
run: cargo fmt --check
|
|
45
|
+
|
|
46
|
+
- name: Check
|
|
47
|
+
run: cargo check --all-targets
|
|
48
|
+
|
|
49
|
+
- name: Check raw FFI feature
|
|
50
|
+
run: cargo check --all-targets --features unsafe-ffi
|
|
51
|
+
|
|
52
|
+
- name: Test
|
|
53
|
+
run: cargo test --features unsafe-ffi
|
|
54
|
+
|
|
55
|
+
- name: Package verification
|
|
56
|
+
run: cargo package
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Python wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
CARGO_TERM_COLOR: always
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
wheels:
|
|
18
|
+
name: Wheels (${{ matrix.os }})
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.11"
|
|
31
|
+
|
|
32
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
33
|
+
|
|
34
|
+
- name: Install bindgen dependencies (Ubuntu)
|
|
35
|
+
if: runner.os == 'Linux'
|
|
36
|
+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
|
|
37
|
+
|
|
38
|
+
- name: Install bindgen dependencies (Windows)
|
|
39
|
+
if: runner.os == 'Windows'
|
|
40
|
+
uses: KyleMayes/install-llvm-action@v2
|
|
41
|
+
with:
|
|
42
|
+
version: "18"
|
|
43
|
+
|
|
44
|
+
- name: Build wheels
|
|
45
|
+
uses: PyO3/maturin-action@v1
|
|
46
|
+
with:
|
|
47
|
+
command: build
|
|
48
|
+
args: --release --features python-extension-module --compatibility pypi --out dist
|
|
49
|
+
manylinux: "2014"
|
|
50
|
+
|
|
51
|
+
- name: Smoke test wheel
|
|
52
|
+
shell: bash
|
|
53
|
+
run: |
|
|
54
|
+
python -m pip install dist/*.whl
|
|
55
|
+
python -c "import lkh_rs; print(lkh_rs.solve_parameter_file('tests/fixtures/tiny.par'))"
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
CARGO_TERM_COLOR: always
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release-plan:
|
|
16
|
+
name: Release plan
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
outputs:
|
|
19
|
+
publish: ${{ steps.plan.outputs.publish }}
|
|
20
|
+
version: ${{ steps.plan.outputs.version }}
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
26
|
+
|
|
27
|
+
- name: Check package version and registry state
|
|
28
|
+
id: plan
|
|
29
|
+
shell: bash
|
|
30
|
+
run: |
|
|
31
|
+
set -euo pipefail
|
|
32
|
+
version="$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json,sys; print(json.load(sys.stdin)["packages"][0]["version"])')"
|
|
33
|
+
python_version="$(python3 - <<'PY'
|
|
34
|
+
import tomllib
|
|
35
|
+
with open("pyproject.toml", "rb") as fh:
|
|
36
|
+
print(tomllib.load(fh)["project"]["version"])
|
|
37
|
+
PY
|
|
38
|
+
)"
|
|
39
|
+
if [ "$version" != "$python_version" ]; then
|
|
40
|
+
echo "Cargo.toml version $version does not match pyproject.toml version $python_version" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
if ! grep -Eq "^## $version([[:space:]-]|$)" CHANGELOG.md; then
|
|
44
|
+
echo "CHANGELOG.md must contain a release entry for $version" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
crate_published=0
|
|
49
|
+
if cargo search '^lkh-rs$' --limit 20 | grep -Eq '^lkh-rs = "'"$version"'"'; then
|
|
50
|
+
crate_published=1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
python_published=0
|
|
54
|
+
status="$(curl -fsS -o /tmp/pypi-lkh-rs.json -w '%{http_code}' https://pypi.org/pypi/lkh-rs/json || true)"
|
|
55
|
+
if [ "$status" = "200" ] && python3 - "$version" /tmp/pypi-lkh-rs.json <<'PY'
|
|
56
|
+
import json
|
|
57
|
+
import sys
|
|
58
|
+
version = sys.argv[1]
|
|
59
|
+
path = sys.argv[2]
|
|
60
|
+
with open(path, "r", encoding="utf-8") as fh:
|
|
61
|
+
data = json.load(fh)
|
|
62
|
+
raise SystemExit(0 if version in data.get("releases", {}) else 1)
|
|
63
|
+
PY
|
|
64
|
+
then
|
|
65
|
+
python_published=1
|
|
66
|
+
elif [ "$status" != "200" ] && [ "$status" != "404" ]; then
|
|
67
|
+
echo "Could not query PyPI for lkh-rs: HTTP $status" >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
if [ "$crate_published" -ne "$python_published" ]; then
|
|
72
|
+
echo "Version $version is published on only one registry; refusing to continue" >&2
|
|
73
|
+
exit 1
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
publish=1
|
|
77
|
+
if [ "$crate_published" -eq 1 ] && [ "$python_published" -eq 1 ]; then
|
|
78
|
+
publish=0
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
82
|
+
echo "publish=$publish" >> "$GITHUB_OUTPUT"
|
|
83
|
+
|
|
84
|
+
python-wheels:
|
|
85
|
+
name: Python wheels (${{ matrix.os }})
|
|
86
|
+
runs-on: ${{ matrix.os }}
|
|
87
|
+
needs: [release-plan]
|
|
88
|
+
if: needs.release-plan.outputs.publish == '1'
|
|
89
|
+
strategy:
|
|
90
|
+
fail-fast: false
|
|
91
|
+
matrix:
|
|
92
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
93
|
+
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v4
|
|
96
|
+
|
|
97
|
+
- uses: actions/setup-python@v5
|
|
98
|
+
with:
|
|
99
|
+
python-version: "3.11"
|
|
100
|
+
|
|
101
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
102
|
+
|
|
103
|
+
- name: Install bindgen dependencies (Ubuntu)
|
|
104
|
+
if: runner.os == 'Linux'
|
|
105
|
+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
|
|
106
|
+
|
|
107
|
+
- name: Install bindgen dependencies (Windows)
|
|
108
|
+
if: runner.os == 'Windows'
|
|
109
|
+
uses: KyleMayes/install-llvm-action@v2
|
|
110
|
+
with:
|
|
111
|
+
version: "18"
|
|
112
|
+
|
|
113
|
+
- name: Build wheels
|
|
114
|
+
uses: PyO3/maturin-action@v1
|
|
115
|
+
with:
|
|
116
|
+
command: build
|
|
117
|
+
args: --release --features python-extension-module --compatibility pypi --out dist
|
|
118
|
+
manylinux: "2014"
|
|
119
|
+
|
|
120
|
+
- name: Upload wheel artifacts
|
|
121
|
+
uses: actions/upload-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
name: python-wheels-${{ runner.os }}
|
|
124
|
+
path: dist/*.whl
|
|
125
|
+
|
|
126
|
+
python-sdist:
|
|
127
|
+
name: Python sdist
|
|
128
|
+
runs-on: ubuntu-latest
|
|
129
|
+
needs: [release-plan]
|
|
130
|
+
if: needs.release-plan.outputs.publish == '1'
|
|
131
|
+
|
|
132
|
+
steps:
|
|
133
|
+
- uses: actions/checkout@v4
|
|
134
|
+
|
|
135
|
+
- uses: actions/setup-python@v5
|
|
136
|
+
with:
|
|
137
|
+
python-version: "3.11"
|
|
138
|
+
|
|
139
|
+
- name: Build source distribution
|
|
140
|
+
uses: PyO3/maturin-action@v1
|
|
141
|
+
with:
|
|
142
|
+
command: sdist
|
|
143
|
+
args: --out dist
|
|
144
|
+
|
|
145
|
+
- name: Upload sdist artifact
|
|
146
|
+
uses: actions/upload-artifact@v4
|
|
147
|
+
with:
|
|
148
|
+
name: python-sdist
|
|
149
|
+
path: dist/*.tar.gz
|
|
150
|
+
|
|
151
|
+
pypi:
|
|
152
|
+
name: Publish to PyPI
|
|
153
|
+
runs-on: ubuntu-latest
|
|
154
|
+
needs: [release-plan, python-wheels, python-sdist]
|
|
155
|
+
if: needs.release-plan.outputs.publish == '1'
|
|
156
|
+
environment: pypi
|
|
157
|
+
permissions:
|
|
158
|
+
contents: read
|
|
159
|
+
id-token: write
|
|
160
|
+
|
|
161
|
+
steps:
|
|
162
|
+
- name: Download Python artifacts
|
|
163
|
+
uses: actions/download-artifact@v4
|
|
164
|
+
with:
|
|
165
|
+
path: dist
|
|
166
|
+
merge-multiple: true
|
|
167
|
+
|
|
168
|
+
- name: Publish
|
|
169
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
170
|
+
with:
|
|
171
|
+
packages-dir: dist
|
|
172
|
+
|
|
173
|
+
crates-io:
|
|
174
|
+
name: Publish to crates.io
|
|
175
|
+
runs-on: ubuntu-latest
|
|
176
|
+
needs: [release-plan, pypi]
|
|
177
|
+
if: needs.release-plan.outputs.publish == '1'
|
|
178
|
+
environment: crates.io
|
|
179
|
+
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
|
|
183
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
184
|
+
|
|
185
|
+
- uses: Swatinem/rust-cache@v2
|
|
186
|
+
|
|
187
|
+
- name: Install bindgen dependencies
|
|
188
|
+
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
|
|
189
|
+
|
|
190
|
+
- name: Package verification
|
|
191
|
+
run: cargo package
|
|
192
|
+
|
|
193
|
+
- name: Publish
|
|
194
|
+
run: cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"
|
lkh_rs-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug/
|
|
4
|
+
target/
|
|
5
|
+
|
|
6
|
+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
7
|
+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
8
|
+
Cargo.lock
|
|
9
|
+
|
|
10
|
+
# These are backup files generated by rustfmt
|
|
11
|
+
**/*.rs.bk
|
|
12
|
+
|
|
13
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
14
|
+
*.pdb
|
|
15
|
+
|
|
16
|
+
# Python extension build artifacts produced by maturin develop
|
|
17
|
+
__pycache__/
|
|
18
|
+
*.py[cod]
|
|
19
|
+
python/lkh_rs/_native*.so
|
|
20
|
+
|
|
21
|
+
# LKH C sources may be built manually while debugging.
|
|
22
|
+
source_code/LKH-*/LKH
|
|
23
|
+
source_code/LKH-*/SRC/OBJ/
|
|
24
|
+
|
|
25
|
+
.idea
|
|
26
|
+
.vscode
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
## 0.1.0 - 2026-07-09
|
|
6
|
+
|
|
7
|
+
Initial public release candidate.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Safe serialized Rust API around LKH's process-global C solver state.
|
|
12
|
+
- Parameter-file solving through `solve_parameter_file`.
|
|
13
|
+
- Programmatic in-memory routing API with typed Python and Rust facades.
|
|
14
|
+
- Python package built with PyO3 and maturin.
|
|
15
|
+
- FastAPI JSON demo backend with a browser route visualizer and real LKH case
|
|
16
|
+
catalog loading.
|
|
17
|
+
- Rust examples and Python examples for programmatic solves.
|
|
18
|
+
- CI workflows for Rust checks/tests and Python wheel builds across Linux,
|
|
19
|
+
macOS, and Windows.
|
|
20
|
+
- Release workflow for publishing Python wheels/sdist to PyPI and the Rust
|
|
21
|
+
crate to crates.io from `main` after version and registry-state checks.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Reset LKH file-related globals before each parameter-file solve so settings
|
|
26
|
+
such as `INITIAL_TOUR_FILE` cannot leak between cases.
|
|
27
|
+
- Release the Python GIL while native solves are running.
|
|
28
|
+
- Report mTSP `MINMAX` objectives using LKH's penalty objective rather than the
|
|
29
|
+
aggregate tour cost in the FastAPI demo.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Documented FastAPI as the browser integration path and recorded current Wasm
|
|
34
|
+
limitations.
|
|
35
|
+
- Documented subprocess isolation requirements for service workloads because
|
|
36
|
+
upstream LKH can still terminate the current process on some malformed inputs.
|