OSCR

Solving multi-depot closed-path multiple traveling salesman problem using k-means++ hierarchical clustering and neural combinatorial networks.

Code ↔ Paper

8 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 8 matches
  1. [1] § Proposed method › Cluster refinement in KHC-NCN ↔ clustering.py, lines 7–84 · score 0.89 · donor clusters, singleton cluster, singleton node, cluster refinement, nearest cluster, target cluster
  2. [2] § Experimental studies › Experimental setup › Neural TSP solver component ↔ nets/graph_encoder.py, lines 183–215 · score 0.69 · multi head attention, feed forward, graph, layer, encoder, masked
  3. [3] § Proposed method › The proposed KHC-NCN algorithm ↔ solving_MTSP_one_instance.py, lines 14–53 · score 0.63 · end2end_solver, cluster refinement, MDCP MTSP, iteratively, sub, KHC
  4. [4] § Proposed method › Tour merging in KHC-NCN ↔ merge_sub_tours.py, lines 99–132 · score 0.63 · nearest inter tour, sub tour, clusters, edges, node
  5. [5] § Experimental studies › Experimental setup › Neural TSP solver component ↔ problems/vrp/encode-attend-navigate/Neural_Reinforce.py, lines 103–239 · score 0.62 · blocks, attends, stack, permutation, encoded, layer
  6. [6] § Proposed method › The proposed KHC-NCN algorithm ↔ solving_MTSP_one_instance.py, lines 14–53 · score 0.60 · end2end_solver, sub clusters, MDCP MTSP, KHC NCN, model
  7. [7] § Experimental studies › Comparison with LKH-3 and POMO ↔ LKH-3.0.8/SRC/INCLUDE/LKH.h, lines 80–164 · score 0.60 · TSP transformation, cost matrix, customer, segmented, sub, depot
  8. [8] § Proposed method › Tour merging in KHC-NCN ↔ merge_sub_tours.py, lines 99–132 · score 0.59 · farthest insertion, sub tours, centroids, cluster, TSP, nodes

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 158 lines · 5.9 KB · no license · 2 matches

  1. import argparse
  2. import os
  3. import math
  4. import numpy as np
  5. import time
  6. from tqdm import tqdm
  7. from clustering import k_means_plusplus_clustering_sklearn,clusterRefinement
  8. from neural_end2end_solver import end2end_solver,make_opts
  9. from common import HyperparametersConfig, TSP_tour_distance, loadDataFormTSPLibFile
  10. from end2end_model.kool2019.utils import load_model
  11. from merge_sub_tours import merge
  12. def KHC_NCN_MDCP_MTSP(mdcp_mtsp,salesman_m,ideal_cluster_size,alpha,model, random_seed=1234):
  13. # load config parameters
  14. config=HyperparametersConfig("config.ini")
  15. opts=make_opts()
  16. # clusters <- k-means++(mdcp_mtsp, salesman_m)
  17. clusters=k_means_plusplus_clustering_sklearn(mdcp_mtsp, salesman_m, max_iterations=config.max_clustering_iter, n_jobs=config.n_jobs, random_seed=random_seed)
  18. clusters=clusterRefinement(clusters,True)
  19. cluster_data_list=[]
  20. for c in clusters:
  21. cluster_data_list.append(np.copy(c["points"]))
  22. allTours=[]
  23. for tsp in tqdm(cluster_data_list):
  24. if tsp.shape[0]<=standard_cluster_size*(1+alpha):
  25. result_dict=end2end_solver(tsp,model,opts,normalize=True)
  26. allTours.append(result_dict["sorted_tsp_data"])
  27. else:
  28. k=math.floor(tsp.shape[0]/standard_cluster_size)
  29. if tsp.shape[0]-k*standard_cluster_size>standard_cluster_size*alpha:
  30. k=k+1
  31. sub_clusters=k_means_plusplus_clustering_sklearn(tsp, k, config.max_clustering_iter, config.n_jobs)
  32. sub_clusters=clusterRefinement(sub_clusters,False)
  33. # solve each cluster with end2end Model and merge the results
  34. subTours=[]
  35. for sub_cluster in sub_clusters:
  36. tmp_tsp_data=np.array(sub_cluster['points'])
  37. sub_tour_result_dict=end2end_solver(tmp_tsp_data,model,opts,normalize=True)
  38. sub_tour_result_dict["center"]=sub_cluster['centroid']
  39. subTours.append(sub_tour_result_dict)
  40. # merge the results
  41. merged_tour=merge(subTours)
  42. allTours.append(merged_tour)
  43. return allTours
  44. def solve_one_MTSP_with_different_K(data_file,model_path,standard_cluster_size,m_list,alpha,log_tag, random_seed=1234):
  45. m_list=[m_list[0]] + m_list
  46. ## load model
  47. end2end_model, _ = load_model(model_path)
  48. different_m_results=[]
  49. different_m_time_consumed_list=[]
  50. _,mdcp_mtsp_data=loadDataFormTSPLibFile(data_file)
  51. mdcp_mtsp=np.array(mdcp_mtsp_data)
  52. for m in tqdm(m_list):
  53. time_start=int(round(time.time()*1000))
  54. fixed_m_allTours=KHC_NCN_MDCP_MTSP(mdcp_mtsp,salesman_m=m,ideal_cluster_size=standard_cluster_size,alpha=alpha,model=end2end_model, random_seed=random_seed)
  55. total_distance=0
  56. for r in fixed_m_allTours:
  57. total_distance+=TSP_tour_distance(r)
  58. different_m_results.append(total_distance)
  59. end_time=int(round(time.time()*1000))
  60. time_consumed=end_time-time_start
  61. print("----------cluster sizes: m={}---------------".format(m))
  62. for r in fixed_m_allTours:
  63. print("cluster size:{}".format(len(r)))
  64. print("----------end cluster sizes---------------")
  65. print("total distance: {}".format(total_distance))
  66. print("time consumed: {} ms".format(time_consumed))
  67. different_m_time_consumed_list.append(time_consumed)
  68. return different_m_results[1:], different_m_time_consumed_list[1:]
  69. if __name__ == "__main__":
  70. config=HyperparametersConfig("config.ini")
  71. model_path=config.model
  72. standard_cluster_size=config.standard_cluster_size
  73. alpha=config.scaling_factor
  74. parser = argparse.ArgumentParser(
  75. description="Run MTSP experiment with user-provided data_file and k_list."
  76. )
  77. parser.add_argument(
  78. "--data_file", "-d", required=True, type=str,
  79. help="Path to the TSP/MTSP data file, e.g., data/eil76.tsp"
  80. )
  81. parser.add_argument(
  82. "--k_list", "-k", required=True, nargs='+',type=int,
  83. help="List of cluster sizes, e.g. -k 2 3 4 5"
  84. )
  85. parser.add_argument(
  86. "--random_seed", "-r", required=False,type=int,
  87. help="RandomSeed, e.g. 1234; default: None, meaning random"
  88. )
  89. args = parser.parse_args()
  90. data_file = args.data_file
  91. if not os.path.exists(data_file):
  92. raise FileNotFoundError(f"Data file not found: {data_file}")
  93. k_list = args.k_list
  94. print("data_file:", data_file)
  95. print("k_list:", k_list)
  96. if args.random_seed is not None:
  97. random_seed=args.random_seed
  98. print("random_seed:", random_seed)
  99. else:
  100. print("random_seed: default, using system time.")
  101. random_seed=int(time.time())
  102. pure_data_file_name=data_file.split("/")[-1].split(".")[0]
  103. k_list_str="_".join([str(k) for k in k_list])
  104. timestamp=time.strftime("%Y%m%d%H%M%S", time.localtime())
  105. log_tag="{}_TSP{}Model_m_{}_{}".format(pure_data_file_name, standard_cluster_size, k_list_str, timestamp)
  106. if not os.path.exists(data_file):
  107. raise FileNotFoundError(f"Data file not found: {data_file}")
  108. different_m_results, different_m_time_consumed_list=solve_one_MTSP_with_different_K(data_file,model_path,standard_cluster_size,k_list,alpha,log_tag, random_seed=random_seed)
  109. result_file_name="{}.txt".format(log_tag)
  110. log_dir="logs"
  111. if not os.path.exists(log_dir):
  112. os.makedirs(log_dir)
  113. with open(os.path.join(log_dir, result_file_name), "w") as f:
  114. for m, total_distance, time_consumed in zip(k_list, different_m_results, different_m_time_consumed_list):
  115. f.write("m={}; total_distance={}; time_consumed={} ms\n".format(m, total_distance, time_consumed))
  116. # print results
  117. print("-------------------Results-------------------")
  118. for m, total_distance, time_consumed in zip(k_list, different_m_results, different_m_time_consumed_list):
  119. print("m={}; total_distance={}; time_consumed={} ms".format(m, total_distance, time_consumed))

solving_MTSP_one_instance.py at commit 310a9cc, no license · at the source

Overview

Authors: Chun-Sheng Zhao1,2, Li-Pei Wong2, Chey Fung2
  1. School of Computer Science and Engineering, Sichuan University of Science & Engineering,Zigong, 643000 Sichuan China
  2. School of Computer Sciences, Universiti Sains Malaysia,11800 USM Gelugor, Pulau Pinang Malaysia
Journal: Scientific reports, volume 16, issue 1, article 15631
Dates: received 15 August 2025; accepted 23 March 2026; published online 2 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41598-026-45824-3 · PMID 41927696 · PMCID PMC13187187 · OpenAlex W7147148148
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: methods / tools (subfield)
Methods: Machine learning
Keywords: Engineering, Mathematics and computing
Topic: Vehicle Routing Optimization Methods (Industrial and Manufacturing Engineering, Engineering), according to OpenAlex
Funding: Ministry of Higher Education Malaysia (Fundamental Research Grant Scheme) (FRGS/1/2020/ICT02/USM/02/2)
Citations: not cited yet (Europe PMC); 64 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

Its files are read in the Code ↔ Paper reader above, with 8 matches between paragraphs and lines of code.

Zhao-Chunsheng/MDCP-MTSP-KHC-NCN

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 310a9cca9bd3d2c98be043283128b14c0ef29d50, 8 May 2026
Languages: Python (70), Jupyter (2), Shell (2), C++ (1)
Size: 166 files, 75 scripts
Software Heritage: not archived
Found in: the appendix
Holds: README, CITATION.cff, environment (end2end_model/kool2019/environment.yml), tests, 2 notebooks
Not found: license file, continuous integration, documentation
Tools: PyTorch (31 files), NumPy (28 files), Matplotlib (4 files), scikit-learn (3 files), SciPy (3 files), TensorFlow (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
76 files

wouterkool/attention-learn-to-route

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: c9abf41ac2f878a55b20dc7e829bc942bb999631, 9 January 2024
Languages: Python (64), Jupyter (2), Shell (2), C++ (1)
Size: 145 files, 69 scripts
Software Heritage: archived
Found in: the appendix
Holds: README, license file, environment (environment.yml), tests, 2 notebooks
Not found: CITATION.cff, continuous integration, documentation
Tools: PyTorch (29 files), NumPy (22 files), Matplotlib (4 files), SciPy (3 files), scikit-learn (2 files), TensorFlow (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
71 files

yd-kwon/POMO

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: d7c3d6ea580499a53e874fe9e065f69e799a8551, 2 October 2022
Languages: Python (38), Jupyter (6)
Size: 77 files, 44 scripts
Software Heritage: not archived
Found in: the appendix
Holds: README, tests, 6 notebooks
Not found: license file, CITATION.cff, environment file, continuous integration, documentation
Tools: NumPy (24 files), PyTorch (22 files), Matplotlib (4 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
45 files

fikisipi/elkai

License: other
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: dbdd81256410d8c790b95459d07eaf6227f0e620, 23 December 2024
Languages: C (156), C/C++ (13), Python (10)
Size: 196 files, 179 scripts
Software Heritage: not archived
Found in: the appendix
Holds: README, license file, environment (pyproject.toml), tests, continuous integration
Not found: CITATION.cff, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
181 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 367 scripts, each with its path and the digest of its content;
  • 8 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • no repository, dataset or request procedure was recognized in it

Read it in the paper: doi.org/10.1038/s41598-026-45824-3.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 2 keywords, 1 funder, 36 references.

Cite

This paper

Zhao, C.-S., Wong, L.-P., & Fung, C. (2026). Solving multi-depot closed-path multiple traveling salesman problem using k-means++ hierarchical clustering and neural combinatorial networks. Scientific reports, 16(1), 15631. https://doi.org/10.1038/s41598-026-45824-3

BibTeX

@article{zhao2026solving,
author = {Zhao, Chun-Sheng and Wong, Li-Pei and Fung, Chey},
title = {{Solving multi-depot closed-path multiple traveling salesman problem using k-means++ hierarchical clustering and neural combinatorial networks}},
journal = {Scientific reports},
year = {2026},
month = apr,
volume = {16},
number = {1},
pages = {15631},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-45824-3},
url = {https://doi.org/10.1038/s41598-026-45824-3},
pmid = {41927696},
pmcid = {PMC13187187}
}

RIS

TY - JOUR
AU - Zhao, Chun-Sheng
AU - Wong, Li-Pei
AU - Fung, Chey
TI - Solving multi-depot closed-path multiple traveling salesman problem using k-means++ hierarchical clustering and neural combinatorial networks
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/04/02
VL - 16
IS - 1
SP - 15631
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-45824-3
UR - https://doi.org/10.1038/s41598-026-45824-3
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-45824-3",
"type": "article-journal",
"title": "Solving multi-depot closed-path multiple traveling salesman problem using k-means++ hierarchical clustering and neural combinatorial networks",
"container-title": "Scientific reports",
"author": [
{
"family": "Zhao",
"given": "Chun-Sheng"
},
{
"family": "Wong",
"given": "Li-Pei"
},
{
"family": "Fung",
"given": "Chey"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "15631",
"DOI": "10.1038/s41598-026-45824-3",
"PMID": "41927696",
"PMCID": "PMC13187187",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-45824-3",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
2
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.3390/biomimetics11070516 [code]
Evolutionary, Neural, or LLM-Driven Heuristic Generation? A Unified Ant Colony Optimization Benchmark for Nature-Inspired Routing Heuristics on the TSP and CVRP.
Journal: Biomimetics (Basel, Switzerland)
In common: PyTorch, scikit-learn, SciPy, 2 other tools, methods / tools, 1 reference
[2] doi:10.7554/elife.110588 [code]
Opening the black box toward a modular approach to spike sorting.
Journal: eLife
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[3] doi:10.1126/sciadv.aed3650 [code]
Truthful visualizations for mass spectrometry imaging enable high-spatial-resolution interactive &lt;i&gt;m/z&lt;/i&gt; mapping and exploration.
Journal: Science advances
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[4] doi:10.1038/s41592-026-03194-8 [code]
Beyond benchmarking: an expert-guided consensus approach to spatially aware clustering.
Journal: Nature methods
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[5] doi:10.21203/rs.3.rs-9676637/v1 [code]
A Comprehensive Benchmarking of Spatial Deconvolution and Domain Detection Methods across Diverse Tissues and Spatial Transcriptomic Technologies
Journal: Research Square (preprint)
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[6] doi:10.1016/j.isci.2026.116168 [code]
See the small lesions: Frequency-guided spatial debiasing GAN for multimodal medical image fusion.
Journal: iScience
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[7] doi:10.1038/s41586-026-10658-6 [code]
An AI system to help scientists write expert-level empirical software.
Journal: Nature
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[8] doi:10.1002/nbm.70263 [code]
Cross-Site Generalization of CNN-Based $$ {B}_1^{+} $$ Mapping in UHF MRI.
Journal: NMR in biomedicine
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[9] doi:10.1371/journal.pone.0347671 [code]
RMETNet: A cross-subject motor imagery EEG signal classification model based on TSLANet and riemannian geometry features.
Journal: PloS one
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools
[10] doi:10.1371/journal.pone.0346575 [code]
Statistically valid explainable black-box machine learning: applications in sex classification across species using brain imaging.
Journal: PloS one
In common: TensorFlow, PyTorch, scikit-learn, 3 other tools, methods / tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.