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.
Files changed (437) hide show
  1. lkh_rs-0.1.0/.github/workflows/ci.yml +56 -0
  2. lkh_rs-0.1.0/.github/workflows/python.yml +55 -0
  3. lkh_rs-0.1.0/.github/workflows/release.yml +194 -0
  4. lkh_rs-0.1.0/.gitignore +26 -0
  5. lkh_rs-0.1.0/CHANGELOG.md +36 -0
  6. lkh_rs-0.1.0/Cargo.lock +973 -0
  7. lkh_rs-0.1.0/Cargo.toml +47 -0
  8. lkh_rs-0.1.0/LICENSE +21 -0
  9. lkh_rs-0.1.0/PKG-INFO +244 -0
  10. lkh_rs-0.1.0/README.md +229 -0
  11. lkh_rs-0.1.0/benches/solve.rs +15 -0
  12. lkh_rs-0.1.0/build.demo.unix.yaml +16 -0
  13. lkh_rs-0.1.0/build.demo.win.yaml +14 -0
  14. lkh_rs-0.1.0/build.osx.yaml +19 -0
  15. lkh_rs-0.1.0/build.rs +304 -0
  16. lkh_rs-0.1.0/build.unix.yaml +19 -0
  17. lkh_rs-0.1.0/build.win.yaml +19 -0
  18. lkh_rs-0.1.0/build.yaml +19 -0
  19. lkh_rs-0.1.0/docs/fastapi.md +40 -0
  20. lkh_rs-0.1.0/docs/performance.md +27 -0
  21. lkh_rs-0.1.0/docs/python.md +133 -0
  22. lkh_rs-0.1.0/docs/release.md +53 -0
  23. lkh_rs-0.1.0/docs/safety.md +25 -0
  24. lkh_rs-0.1.0/docs/wasm.md +88 -0
  25. lkh_rs-0.1.0/examples/fastapi_backend/README.md +54 -0
  26. lkh_rs-0.1.0/examples/fastapi_backend/app.py +370 -0
  27. lkh_rs-0.1.0/examples/fastapi_backend/case_catalog.py +661 -0
  28. lkh_rs-0.1.0/examples/fastapi_backend/requirements.txt +3 -0
  29. lkh_rs-0.1.0/examples/fastapi_backend/static/index.html +670 -0
  30. lkh_rs-0.1.0/examples/python/solve_programmatic.py +91 -0
  31. lkh_rs-0.1.0/examples/raw_ffi.rs +12 -0
  32. lkh_rs-0.1.0/examples/solve_parameter_file.rs +16 -0
  33. lkh_rs-0.1.0/examples/solve_programmatic.rs +79 -0
  34. lkh_rs-0.1.0/pyproject.toml +24 -0
  35. lkh_rs-0.1.0/python/lkh_rs/__init__.py +648 -0
  36. lkh_rs-0.1.0/python/lkh_rs/_native.pyi +32 -0
  37. lkh_rs-0.1.0/python/lkh_rs/py.typed +0 -0
  38. lkh_rs-0.1.0/source_code/.gitignore +7 -0
  39. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-2_USER_GUIDE.pdf +0 -0
  40. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-3_PARAMETERS.pdf +0 -0
  41. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH-3_REPORT.pdf +0 -0
  42. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH_Genetic.pdf +0 -0
  43. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/LKH_REPORT.pdf +0 -0
  44. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/POPMUSIC_REPORT.pdf +0 -0
  45. lkh_rs-0.1.0/source_code/LKH-3.0.14/DOC/TSPLIB_DOC.pdf +0 -0
  46. lkh_rs-0.1.0/source_code/LKH-3.0.14/Makefile +4 -0
  47. lkh_rs-0.1.0/source_code/LKH-3.0.14/README.txt +248 -0
  48. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Activate.c +31 -0
  49. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddCandidate.c +47 -0
  50. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddExtraCandidates.c +50 -0
  51. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AddTourCandidates.c +82 -0
  52. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AdjustCandidateSet.c +60 -0
  53. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AdjustClusters.c +58 -0
  54. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/AllocateStructures.c +110 -0
  55. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Ascent.c +210 -0
  56. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BIT.c +319 -0
  57. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best2OptMove.c +129 -0
  58. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best3OptMove.c +202 -0
  59. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best4OptMove.c +341 -0
  60. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Best5OptMove.c +789 -0
  61. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BestKOptMove.c +244 -0
  62. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BestSpecialOptMove.c +758 -0
  63. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between.c +30 -0
  64. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between_SL.c +44 -0
  65. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Between_SSL.c +62 -0
  66. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BridgeGain.c +270 -0
  67. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/BuildKDTree.c +129 -0
  68. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/C.c +220 -0
  69. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CTSP_InitialTour.c +52 -0
  70. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CVRP_InitialTour.c +242 -0
  71. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CandidateReport.c +52 -0
  72. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ChooseInitialTour.c +218 -0
  73. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Connect.c +63 -0
  74. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateCandidateSet.c +190 -0
  75. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateDelaunayCandidateSet.c +108 -0
  76. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateNNCandidateSet.c +65 -0
  77. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/CreateQuadrantCandidateSet.c +525 -0
  78. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Create_POPMUSIC_CandidateSet.c +721 -0
  79. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Delaunay.c +594 -0
  80. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance.c +266 -0
  81. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_MTSP.c +50 -0
  82. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_SOP.c +11 -0
  83. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Distance_SPECIAL.c +32 -0
  84. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ERXT.c +151 -0
  85. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Excludable.c +22 -0
  86. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Exclude.c +22 -0
  87. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FindTour.c +181 -0
  88. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FixedOrCommonCandidates.c +28 -0
  89. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip.c +85 -0
  90. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip_SL.c +369 -0
  91. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Flip_SSL.c +593 -0
  92. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Forbidden.c +93 -0
  93. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/FreeStructures.c +92 -0
  94. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GCTSP_InitialTour.c +59 -0
  95. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Gain23.c +355 -0
  96. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GenerateCandidates.c +158 -0
  97. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Genetic.c +283 -0
  98. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GeoConversion.c +53 -0
  99. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GetTime.c +38 -0
  100. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/GreedyTour.c +417 -0
  101. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Hashing.c +75 -0
  102. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Heap.c +156 -0
  103. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/BIT.h +24 -0
  104. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/CLARIST.h +33 -0
  105. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Delaunay.h +47 -0
  106. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/GainType.h +32 -0
  107. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Genetic.h +38 -0
  108. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/GeoConversion.h +21 -0
  109. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Hashing.h +29 -0
  110. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Heap.h +20 -0
  111. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/LKH.h +655 -0
  112. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Segment.h +77 -0
  113. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/Sequence.h +39 -0
  114. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/INCLUDE/gpx.h +77 -0
  115. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Improvement.c +45 -0
  116. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsBackboneCandidate.c +18 -0
  117. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsCandidate.c +18 -0
  118. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsCommonEdge.c +20 -0
  119. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/IsPossibleCandidate.c +61 -0
  120. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/KSwapKick.HUNT.c +144 -0
  121. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/KSwapKick.c +81 -0
  122. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LKH.c +240 -0
  123. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LKHmain.c +267 -0
  124. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/LinKernighan.c +208 -0
  125. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP2TSP.c +144 -0
  126. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_InitialTour.c +115 -0
  127. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_Report.c +41 -0
  128. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MTSP_WriteSolution.c +55 -0
  129. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make2OptMove.c +15 -0
  130. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make3OptMove.c +27 -0
  131. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make4OptMove.c +49 -0
  132. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Make5OptMove.c +256 -0
  133. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MakeKOptMove.c +108 -0
  134. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Makefile +97 -0
  135. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeTourWithBestTour.c +34 -0
  136. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourCLARIST.c +582 -0
  137. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourGPX2.c +197 -0
  138. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MergeWithTourIPT.c +278 -0
  139. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Minimum1TreeCost.c +74 -0
  140. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/MinimumSpanningTree.c +110 -0
  141. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/NormalizeNodeList.c +24 -0
  142. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/NormalizeSegmentList.c +28 -0
  143. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/OrderCandidateSet.c +234 -0
  144. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PCTSP_InitialTour.c +120 -0
  145. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PCTSP_RepairTour.c +121 -0
  146. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PDPTW_Reduce.c +43 -0
  147. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PatchCycles.c +313 -0
  148. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_1_PDTSP.c +29 -0
  149. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_ACVRP.c +56 -0
  150. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_BWTSP.c +45 -0
  151. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CBTSP.c +42 -0
  152. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CBnTSP.c +37 -0
  153. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CCCTSP.c +42 -0
  154. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CCVRP.c +56 -0
  155. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CTSP.c +33 -0
  156. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CTSP_D.c +31 -0
  157. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CVRP.c +52 -0
  158. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CVRPTW.c +54 -0
  159. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_CluVRP.c +76 -0
  160. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_GCTSP.c +48 -0
  161. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_KTSP.c +18 -0
  162. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_M1_PDTSP.c +7 -0
  163. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MLP.c +42 -0
  164. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MSCTSP.c +44 -0
  165. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_MTSP.c +108 -0
  166. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_M_PDTSP.c +44 -0
  167. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OKTSP.c +17 -0
  168. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OP.c +29 -0
  169. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_OVRP.c +48 -0
  170. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PCTSP.c +89 -0
  171. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PC_TSP.c +48 -0
  172. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDPTW.c +72 -0
  173. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSP.c +50 -0
  174. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSPF.c +52 -0
  175. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PDTSPL.c +43 -0
  176. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PTP.c +32 -0
  177. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_PTSP.c +113 -0
  178. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_RCTVRP.c +60 -0
  179. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_SOP.c +56 -0
  180. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TOP.c +33 -0
  181. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TRP.c +42 -0
  182. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPDL.c +32 -0
  183. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPMD.c +124 -0
  184. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPPD.c +26 -0
  185. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_TSPTW.c +27 -0
  186. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPB.c +45 -0
  187. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPBTW.c +56 -0
  188. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Penalty_VRPPD.c +69 -0
  189. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/PrintParameters.c +220 -0
  190. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Random.c +78 -0
  191. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadCandidates.c +74 -0
  192. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadEdges.c +78 -0
  193. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadLine.c +44 -0
  194. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadParameters.c +1297 -0
  195. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadPenalties.c +55 -0
  196. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ReadProblem.c +2788 -0
  197. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RecordBestTour.c +19 -0
  198. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RecordBetterTour.c +49 -0
  199. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RemoveFirstActive.c +23 -0
  200. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/ResetCandidateSet.c +48 -0
  201. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/RestoreTour.c +31 -0
  202. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SFCTour.c +176 -0
  203. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SINTEF_WriteSolution.c +44 -0
  204. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_InitialTour.c +104 -0
  205. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_RepairTour.c +79 -0
  206. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SOP_Report.c +7 -0
  207. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/STTSP2TSP.c +102 -0
  208. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SegmentSize.c +135 -0
  209. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Sequence.c +176 -0
  210. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveCompressedSubproblem.c +40 -0
  211. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveDelaunaySubproblems.c +226 -0
  212. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKCenterSubproblems.c +106 -0
  213. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKMeansSubproblems.c +271 -0
  214. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveKarpSubproblems.c +128 -0
  215. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveRoheSubproblems.c +248 -0
  216. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSFCSubproblems.c +94 -0
  217. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSubproblem.c +368 -0
  218. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveSubproblemBorderProblems.c +252 -0
  219. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SolveTourSegmentSubproblems.c +87 -0
  220. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/Statistics.c +113 -0
  221. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/StatusReport.c +28 -0
  222. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/StoreTour.c +45 -0
  223. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/SymmetrizeCandidateSet.c +21 -0
  224. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TOP_WriteSolution.c +88 -0
  225. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPDL_InitialTour.c +71 -0
  226. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPTW_MakespanCost.c +20 -0
  227. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TSPTW_Reduce.c +50 -0
  228. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/TrimCandidateSet.c +31 -0
  229. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/VRPB_Reduce.c +15 -0
  230. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WriteCandidates.c +47 -0
  231. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WritePenalties.c +34 -0
  232. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/WriteTour.c +152 -0
  233. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/akef +1 -0
  234. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/eprintf.c +20 -0
  235. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/fscanint.c +36 -0
  236. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/gpx.c +1833 -0
  237. lkh_rs-0.1.0/source_code/LKH-3.0.14/SRC/printff.c +16 -0
  238. lkh_rs-0.1.0/source_code/LKH-3.0.14/pr2392.par +5 -0
  239. lkh_rs-0.1.0/source_code/LKH-3.0.14/pr2392.tsp +2402 -0
  240. lkh_rs-0.1.0/source_code/LKH-3.0.14/whizzkids96.atsp +128 -0
  241. lkh_rs-0.1.0/source_code/LKH-3.0.14/whizzkids96.par +9 -0
  242. lkh_rs-0.1.0/source_code/LKHDemo/.gitignore +2 -0
  243. lkh_rs-0.1.0/source_code/LKHDemo/CMakeLists.txt +29 -0
  244. lkh_rs-0.1.0/source_code/LKHDemo/Makefile +4 -0
  245. lkh_rs-0.1.0/source_code/LKHDemo/SRC/GetTime.c +37 -0
  246. lkh_rs-0.1.0/source_code/LKHDemo/SRC/INCLUDE/demo.h +9 -0
  247. lkh_rs-0.1.0/source_code/LKHDemo/SRC/INCLUDE/demo2.h +9 -0
  248. lkh_rs-0.1.0/source_code/LKHDemo/SRC/LKHmain.c +17 -0
  249. lkh_rs-0.1.0/source_code/LKHDemo/SRC/Makefile +32 -0
  250. lkh_rs-0.1.0/source_code/LKHDemo/SRC/demo.c +10 -0
  251. lkh_rs-0.1.0/source_code/LKHDemo/SRC/demo2.c +10 -0
  252. lkh_rs-0.1.0/source_code/LKHDemo/test.sh +29 -0
  253. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/Makefile +4 -0
  254. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Activate.c +29 -0
  255. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddCandidate.c +47 -0
  256. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddExtraCandidates.c +48 -0
  257. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AddTourCandidates.c +82 -0
  258. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AdjustCandidateSet.c +60 -0
  259. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AdjustClusters.c +58 -0
  260. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/AllocateStructures.c +110 -0
  261. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Ascent.c +202 -0
  262. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BIT.c +319 -0
  263. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best2OptMove.c +129 -0
  264. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best3OptMove.c +202 -0
  265. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best4OptMove.c +341 -0
  266. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Best5OptMove.c +789 -0
  267. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BestKOptMove.c +244 -0
  268. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BestSpecialOptMove.c +758 -0
  269. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between.c +30 -0
  270. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between_SL.c +44 -0
  271. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Between_SSL.c +62 -0
  272. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BridgeGain.c +270 -0
  273. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/BuildKDTree.c +129 -0
  274. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/C.c +220 -0
  275. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CTSP_InitialTour.c +46 -0
  276. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CVRP_InitialTour.c +242 -0
  277. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CandidateReport.c +49 -0
  278. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ChooseInitialTour.c +204 -0
  279. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Connect.c +63 -0
  280. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateCandidateSet.c +189 -0
  281. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateDelaunayCandidateSet.c +108 -0
  282. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateNNCandidateSet.c +65 -0
  283. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/CreateQuadrantCandidateSet.c +525 -0
  284. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Create_POPMUSIC_CandidateSet.c +736 -0
  285. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Delaunay.c +594 -0
  286. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance.c +266 -0
  287. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_MTSP.c +47 -0
  288. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_SOP.c +11 -0
  289. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Distance_SPECIAL.c +32 -0
  290. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ERXT.c +151 -0
  291. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Excludable.c +22 -0
  292. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Exclude.c +22 -0
  293. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FindTour.c +171 -0
  294. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FixedOrCommonCandidates.c +27 -0
  295. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip.c +85 -0
  296. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip_SL.c +369 -0
  297. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Flip_SSL.c +593 -0
  298. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Forbidden.c +78 -0
  299. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/FreeStructures.c +91 -0
  300. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Gain23.c +348 -0
  301. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GenerateCandidates.c +158 -0
  302. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Genetic.c +284 -0
  303. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GeoConversion.c +53 -0
  304. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GetTime.c +37 -0
  305. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/GreedyTour.c +418 -0
  306. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Hashing.c +75 -0
  307. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Heap.c +156 -0
  308. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/BIT.h +24 -0
  309. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/CLARIST.h +35 -0
  310. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Delaunay.h +47 -0
  311. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/GainType.h +32 -0
  312. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Genetic.h +38 -0
  313. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/GeoConversion.h +21 -0
  314. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Hashing.h +29 -0
  315. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Heap.h +20 -0
  316. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/LKH.h +610 -0
  317. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Segment.h +77 -0
  318. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/Sequence.h +39 -0
  319. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/INCLUDE/gpx.h +77 -0
  320. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Improvement.c +40 -0
  321. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsBackboneCandidate.c +18 -0
  322. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsCandidate.c +18 -0
  323. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsCommonEdge.c +20 -0
  324. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/IsPossibleCandidate.c +61 -0
  325. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/KSwapKick.c +81 -0
  326. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LKH.c +222 -0
  327. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LKHmain.c +244 -0
  328. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/LinKernighan.c +198 -0
  329. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP2TSP.c +102 -0
  330. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_InitialTour.c +115 -0
  331. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_Report.c +41 -0
  332. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MTSP_WriteSolution.c +45 -0
  333. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make2OptMove.c +15 -0
  334. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make3OptMove.c +27 -0
  335. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make4OptMove.c +49 -0
  336. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Make5OptMove.c +256 -0
  337. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MakeKOptMove.c +108 -0
  338. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Makefile +85 -0
  339. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeTourWithBestTour.c +34 -0
  340. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourCLARIST.c +538 -0
  341. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourGPX2.c +181 -0
  342. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MergeWithTourIPT.c +263 -0
  343. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Minimum1TreeCost.c +74 -0
  344. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/MinimumSpanningTree.c +110 -0
  345. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/NormalizeNodeList.c +24 -0
  346. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/NormalizeSegmentList.c +28 -0
  347. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/OrderCandidateSet.c +234 -0
  348. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PDPTW_Reduce.c +43 -0
  349. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PatchCycles.c +313 -0
  350. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_1_PDTSP.c +29 -0
  351. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_ACVRP.c +56 -0
  352. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_BWTSP.c +45 -0
  353. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CCVRP.c +56 -0
  354. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CTSP.c +33 -0
  355. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CVRP.c +51 -0
  356. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_CVRPTW.c +54 -0
  357. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_KTSP.c +18 -0
  358. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_M1_PDTSP.c +7 -0
  359. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_MLP.c +42 -0
  360. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_MTSP.c +108 -0
  361. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_M_PDTSP.c +44 -0
  362. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_OVRP.c +48 -0
  363. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDPTW.c +72 -0
  364. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSP.c +50 -0
  365. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSPF.c +52 -0
  366. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_PDTSPL.c +43 -0
  367. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_RCTVRP.c +60 -0
  368. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_SOP.c +56 -0
  369. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TRP.c +42 -0
  370. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPDL.c +32 -0
  371. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPPD.c +26 -0
  372. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_TSPTW.c +27 -0
  373. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPB.c +45 -0
  374. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPBTW.c +56 -0
  375. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Penalty_VRPPD.c +69 -0
  376. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/PrintParameters.c +204 -0
  377. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Random.c +78 -0
  378. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadCandidates.c +74 -0
  379. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadEdges.c +78 -0
  380. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadLine.c +44 -0
  381. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadParameters.c +1236 -0
  382. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadPenalties.c +56 -0
  383. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ReadProblem.c +2265 -0
  384. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RecordBestTour.c +19 -0
  385. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RecordBetterTour.c +49 -0
  386. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RemoveFirstActive.c +23 -0
  387. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/ResetCandidateSet.c +48 -0
  388. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/RestoreTour.c +31 -0
  389. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SFCTour.c +176 -0
  390. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SINTEF_WriteSolution.c +44 -0
  391. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_InitialTour.c +92 -0
  392. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_RepairTour.c +79 -0
  393. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SOP_Report.c +7 -0
  394. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/STTSP2TSP.c +102 -0
  395. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SegmentSize.c +135 -0
  396. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Sequence.c +176 -0
  397. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveCompressedSubproblem.c +40 -0
  398. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveDelaunaySubproblems.c +226 -0
  399. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKCenterSubproblems.c +106 -0
  400. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKMeansSubproblems.c +271 -0
  401. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveKarpSubproblems.c +128 -0
  402. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveRoheSubproblems.c +248 -0
  403. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSFCSubproblems.c +94 -0
  404. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSubproblem.c +368 -0
  405. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveSubproblemBorderProblems.c +252 -0
  406. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SolveTourSegmentSubproblems.c +87 -0
  407. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/Statistics.c +109 -0
  408. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/StatusReport.c +29 -0
  409. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/StoreTour.c +45 -0
  410. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/SymmetrizeCandidateSet.c +21 -0
  411. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPDL_InitialTour.c +71 -0
  412. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPTW_MakespanCost.c +20 -0
  413. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TSPTW_Reduce.c +50 -0
  414. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/TrimCandidateSet.c +31 -0
  415. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/VRPB_Reduce.c +15 -0
  416. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WriteCandidates.c +47 -0
  417. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WritePenalties.c +34 -0
  418. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/WriteTour.c +109 -0
  419. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/eprintf.c +20 -0
  420. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/fscanint.c +36 -0
  421. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/gpx.c +1830 -0
  422. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/SRC/printff.c +16 -0
  423. lkh_rs-0.1.0/source_code/LKHWin-3.0.9/resource.h +14 -0
  424. lkh_rs-0.1.0/source_code/pr2392.par +6 -0
  425. lkh_rs-0.1.0/source_code/pr2392.tsp +2399 -0
  426. lkh_rs-0.1.0/source_code/wrapper.h +3 -0
  427. lkh_rs-0.1.0/src/.gitignore +1 -0
  428. lkh_rs-0.1.0/src/error.rs +50 -0
  429. lkh_rs-0.1.0/src/lib.rs +85 -0
  430. lkh_rs-0.1.0/src/main.rs +33 -0
  431. lkh_rs-0.1.0/src/problem.rs +919 -0
  432. lkh_rs-0.1.0/src/python.rs +136 -0
  433. lkh_rs-0.1.0/src/solver.rs +1272 -0
  434. lkh_rs-0.1.0/tests/cli.rs +19 -0
  435. lkh_rs-0.1.0/tests/fixtures/tiny.par +7 -0
  436. lkh_rs-0.1.0/tests/fixtures/tiny.tsp +11 -0
  437. 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 }}"
@@ -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.