Submitted:
25 June 2024
Posted:
26 June 2024
You are already at the latest version
Abstract
Keywords:
1. Introduction
- We introduce novel strategies for solving the TSP and mTSP using visual reasoning of MLLM alone, bypassing traditional numerical data like node coordinates or distance matrices.
- We present MLLM as a multi-agent system—Initializer, Critic, and optionally Scorer agents—that iteratively refines routes. The Initializer suggests routes visually, the Critic improves them iteratively, and the Scorer evaluates them based on visual clarity and efficiency.
- By leveraging iterative refinement, our approach minimizes route intersections, optimizes lengths, and ensures comprehensive node coverage without relying on numerical computations.
2. Related Work
3. Materials and Methods
3.1. Multi-Agent 1
3.2. Multi-Agent 2

3.3. Prompts Engineering
| Rule | Prompt |
| Initializer agent | f”““ Inspect the provided image and find routes for {num_salesmen} salesmen starting from the depot, which is marked with a black square. Ensure that: - All nodes are visited once by only one salesman. - Each salesman starts from the depot and returns to the depot. - Minimize intersections between the different routes and within the same route. - Each route should cover a cluster of points. - The routes should be as short as possible. Output the sequences for the routes in the following format: <<start>> “““ for i in range(1, num_salesmen + 1): prompt += f”Salesman{i}: Depot-Node1-Node2-...-Depot\n” prompt += “<<end>>\n\nDo not include any additional explanations or text. Use only the output format specified above.” |
| Critic agent | f”““ Inspect the provided image and find routes for {num_salesmen} salesmen starting from the depot, which is marked with a black square. Ensure that: - All nodes are visited once by only one salesman. - Each salesman starts from the depot and returns to the depot. - Minimize intersections between the different routes and within the same route. - Each route should cover a cluster of points. - The routes should be as short as possible. - Aim to improve upon the current routes shown in the image by further reducing intersections and optimizing the travel distance. Output the sequences for the routes in the following format: <<start>> “““ for i in range(1, num_salesmen + 1): prompt += f”Salesman{i}: Depot-Node1-Node2-...-Depot\n” prompt += “<<end>>\n\nDo not include any additional explanations or text. Use only the output format specified above.” |
| Score agent | Examine the provided images, each representing different solutions for the same TSP. Evaluate each image against the following criteria to select the best solution: 1. Complete Node Coverage: Ensure all nodes are visited exactly once. Prefer routes that miss the fewest nodes. 2. Minimized Crossing Lines: Fewer crossing lines generally indicate a shorter total distance. 3. Route Clarity: The path should be easy to follow visually, with minimal overlapping lines. 4. Starting and Ending Point: The route should start and end at node 0. Rank each image based on these criteria and output the score for each image. The image IDs range from 1 to 7, corresponding to the first to the last image. Output only the image ID and its score, formatted as follows: <<image1: score, image2: score, …, image7: score>>. Then, select the best image and output its ID formatted as follows: <<the best route: ID>>. A higher score indicates a better solution. Please adhere strictly to this format without additional commentary. |
3.4. Initializer Agent Prompt
- Starting Point: The prompt specifies that the routes must start and end at a depot, marked as a black square in the image. This sets a clear starting and returning point for each salesman’s route.
- Node Visitation: It’s stipulated that all nodes must be visited exactly once by only one salesman, ensuring that the task covers all designated points without overlap between salesmen.
- Route Efficiency: The prompt demands minimizing intersections within and between routes. This aims to reduce potential route conflicts and ensures that the paths taken are as efficient as possible.
- Cluster Coverage: Each route should cover a cluster of points, implying that the agent should look for logical groupings of close nodes to form each route, enhancing practicality and efficiency.
- Route Length: The emphasis is also on keeping routes short, prioritizing direct paths and proximity among nodes within a route.
- Output Format: The expected output format is very structured, asking for the route of each salesman to be listed sequentially from the depot, through each node, and back to the depot. The format is specified to begin with <<start>> and end with <<end>>, and only the routes are to be listed without any additional text or explanation.
3.5. Critic Agent Prompt
- Initial Instructions: Like the Initializer agent, the Critic starts with the same basic guidelines regarding the depot, unique node visits by each salesman, minimizing route intersections, and covering clustered points.
- Optimization Focus: The key addition for the Critic is the instruction to “improve upon the current routes shown in the image by further reducing intersections and optimizing the travel distance.” This pushes the agent to look for enhancements over the already suggested routes, focusing on increased efficiency and reduced travel distances.
- Output Format: The format for output remains structured and specific. The Critic must list each salesman’s route starting and ending at the depot in a precise sequence without additional commentary. The sequence is strictly formatted from the depot to the last node and back, maintaining clarity and consistency.
3.6. Score Agent Prompt
-
Evaluation Criteria:
- ○
- Complete Node Coverage: This ensures all nodes are visited precisely once, emphasizing routes that don’t skip any nodes.
- ○
- Minimized Crossing Lines: Routes with fewer intersections are preferred as they generally suggest a shorter overall path.
- ○
- Route Clarity: The paths should be straightforward to trace visually, with minimal overlapping, which enhances the readability and practicality of the route.
- ○
- Starting and Ending Point: It’s essential that the route begins and ends at the same point, labeled as node 0, ensuring a closed loop that is typical for TSP solutions.
- Scoring and Ranking: Each route is assigned a score based on how well it meets the above criteria. The scores are directly related to the route’s efficiency and clarity. The prompt specifies that each image representing a different route solution should be scored and then listed with its corresponding score, maintaining a clear format for easy comparison.
- Output: The scores are to be formatted concisely: <<image1: score, image2: score, …, image7: score>>. Additionally, the highest-scoring route is to be highlighted as the best solution with its specific ID in the format: <<the best route: ID>>.
- Format and Procedure: The agent is instructed to strictly adhere to the output format without adding any supplementary explanations or textual content. This structured approach ensures that the outputs are standardized and focused solely on the numerical scoring and ranking.
3.7. Test Data
3.8. Ground Truth Solutions
4. Results
4.1. Multi-Agent 1 Solution Quality
4.2. Multi-Agent 1 Example 1
4.3. Multi-Agent 1 Example 2

4.4. Multi-Agent 2 Solutions Quality


4.5. Multi-Agent 2 Example 1

4.6. Multi-Agent 2 Example 2
5. Conclusion
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Liu, S.; Chen, C.; Qu, X.; Tang, K.; Ong, Y.-S. Large Language Models as Evolutionary Optimizers 2023.
- Yang, C.; Wang, X.; Lu, Y.; Liu, H.; Le, Q. V; Zhou, D.; Chen, X. Large Language Models as Optimizers 2023.
- Xu, X.; Yuan, H.; Liptrott, M.; Trovati, M. Two Phase Heuristic Algorithm for the Multiple-Travelling Salesman Problem. Soft comput 2018, 22, 6567–6581.
- Cheikhrouhou, O.; Khoufi, I. A Comprehensive Survey on the Multiple Traveling Salesman Problem: Applications, Approaches and Taxonomy. Comput Sci Rev 2021, 40, 100369.
- Mersmann, O.; Bischl, B.; Trautmann, H.; Wagner, M.; Bossek, J.; Neumann, F. A Novel Feature-Based Approach to Characterize Algorithm Performance for the Traveling Salesperson Problem. Ann Math Artif Intell 2013, 69, 151–182, . [CrossRef]
- Ouaarab, A.; Ahiod, B.; Yang, X.-S. Random-Key Cuckoo Search for the Travelling Salesman Problem. Soft comput 2014, 19, 1099–1106, . [CrossRef]
- Sun, Y. Generalization of Machine Learning for Problem Reduction: A Case Study on Travelling Salesman Problems. 2020, . [CrossRef]
- Zheng, J.; He, K.; Zhou, J.; Yan, J.; Li, C.-M. Reinforced Lin-Kernighan-Helsgaun Algorithms for the Traveling Salesman Problems. 2022, . [CrossRef]
- Gutiérrez, S.; Cruz, N.; Calvo, H.; Moreno-Armendáriz, M.A. The Mexican Magical Towns Traveling Salesman Problem: Preliminary Results. Research in Computing Science 2017, 138, 159–168, . [CrossRef]
- O’Neil, M.A.; Burtscher, M. Rethinking the Parallelization of Random-Restart Hill Climbing: A Case Study in Optimizing a 2-Opt TSP Solver for GPU Execution. 2015, . [CrossRef]
- Wang, Y. Statistical Analysis of Frequency Graph for Traveling Salesman Problem. Journal of Intelligent & Fuzzy Systems 2015, 28, 1109–1118, . [CrossRef]
- Wang, J. Reinforcement Learning for the Traveling Salesman Problem: Performance Comparison of Three Algorithms. The Journal of Engineering 2023, 2023, . [CrossRef]
- Faigl, J.; Hollinger, G.A. Self-Organizing Map for the Prize-Collecting Traveling Salesman Problem. 2014, 281–291, . [CrossRef]
- Sahai, T.; Ziessler, A.; Klus, S.; Dellnitz, M. Continuous Relaxations for the Traveling Salesman Problem. Nonlinear Dyn 2019, 97, 2003–2022, . [CrossRef]
- Akhand, M.A.H.; Ayon, S.I.; Shahriyar, S.A.; Siddique, N.; Adeli, H. Discrete Spider Monkey Optimization for Travelling Salesman Problem. Appl Soft Comput 2020, 86, 105887, . [CrossRef]
- Guang, R.; Khodadian, S. Linear Function Approximation as a Resource Efficient Method to Solve the Travelling Salesman Problem. Journal of Student Research 2022, 10, . [CrossRef]
- Mandal, R.K.; Mukherjee, P.; Maitra, M. Solving Travelling Salesman Problem Using Artificial Immune System Optimization (AISO). Journal of Scientific Research 2022, 66, 114–120, . [CrossRef]
- Chen, Y.; Yang, J. Research on Traveling Salesman Problem Based on the Ant Colony Optimization Algorithm and Genetic Algorithm. The Open Automation and Control Systems Journal 2015, 7, 1329–1334, . [CrossRef]
- Barán, B.; Gómez, O.M. Omicron ACO. A New Ant Colony Optimization Algorithm. Clei Electronic Journal 2018, 8, . [CrossRef]
- Shahadat, A.S.B.; Akhand, M.A.H.; Kamal, A.S. Visibility Adaptation in Ant Colony Optimization for Solving Traveling Salesman Problem. Mathematics 2022, 10, 2448, . [CrossRef]
- Xu, H.; Lan, H. An Adaptive Layered Clustering Framework With Improved Genetic Algorithm for Solving Large-Scale Traveling Salesman Problems. 2023, . [CrossRef]
- Herrera, B.A.L. de M.; Coelho, L. d. S.; Steiner, M.T.A. Quantum Inspired Particle Swarm Combined With Lin-Kernighan-Helsgaun Method to the Traveling Salesman Problem. Pesquisa Operacional 2015, 35, 465–488, . [CrossRef]
- Evangelos, S.; Papalitsas, C.; Andronikos, T. Experimental Analysis of Quantum Annealers and Hybrid Solvers Using Benchmark Optimization Problems. 2022, . [CrossRef]
- El-Samak, A.F.; Ashour, W.M. Optimization of Traveling Salesman Problem Using Affinity Propagation Clustering and Genetic Algorithm. Journal of Artificial Intelligence and Soft Computing Research 2015, 5, 239–245, . [CrossRef]
- Mzili, I.; Mzili, T.; Riffi, M.E. Efficient Routing Optimization With Discrete Penguins Search Algorithm for MTSP. Decision Making Applications in Management and Engineering 2023, 6, 730–743, . [CrossRef]
- Jaradat, S.; Alhadidi, T.I.; Ashqar, H.I.; Hossain, A.; Elhenawy, M. Exploring Traffic Crash Narratives in Jordan Using Text Mining Analytics. arXiv preprint arXiv:2406.09438 2024.
- Radwan, A.; Amarneh, M.; Alawneh, H.; Ashqar, H.I.; AlSobeh, A.; Magableh, A.A.A.R. Predictive Analytics in Mental Health Leveraging LLM Embeddings and Machine Learning Models for Social Media Analysis. International Journal of Web Services Research (IJWSR) 2024, 21, 1–22.
- Ashqar, H.I.; Alhadidi, T.I.; Elhenawy, M.; Khanfar, N.O. The Use of Multimodal Large Language Models to Detect Objects from Thermal Images: Transportation Applications.; 2024.
- Alhadidi, T.I.; Jaber, A.; Jaradat, S.; Ashqar, H.I.; Elhenawy, M. Object Detection Using Oriented Window Learning Vi-Sion Transformer: Roadway Assets Recognition.; 2024.
- Tami, M.A.; Ashqar, H.I.; Elhenawy, M. Using Multimodal Large Language Models for Automated Detection of Traffic Safety Critical Events.; 2024.
- Jiang, M.; Ruan, Y.; Huang, S.; Liao, S.; Pitis, S.; Grosse, R.B.; Ba, J. Calibrating Language Models via Augmented Prompt Ensembles. 2023.
- Pitis, S.; Zhang, M.R.; Wang, A.; Ba, J. Boosted Prompt Ensembles for Large Language Models 2023.
- Kojima, T.; Gu, S.S.; Reid, M.; Matsuo, Y.; Iwasawa, Y. Large Language Models Are Zero-Shot Reasoners 2022.
- Min, S.; Lyu, X.; Holtzman, A.; Artetxe, M.; Lewis, M.; Hajishirzi, H.; Zettlemoyer, L. Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? 2022.
- Brown, T.B.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. Language Models Are Few-Shot Learners 2020.
- Zhang, Z.; Zhang, A.; Li, M.; Smola, A. Automatic Chain of Thought Prompting in Large Language Models 2022.
- Wei, J.; Wang, X.; Schuurmans, D.; Bosma, M.; Ichter, B.; Xia, F.; Chi, E.; Le, Q.; Zhou, D. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 2022.
- Wang, X.; Wei, J.; Schuurmans, D.; Le, Q.; Chi, E.; Narang, S.; Chowdhery, A.; Zhou, D. Self-Consistency Improves Chain of Thought Reasoning in Language Models 2022.
- Wu, J.; Gan, W.; Chen, Z.; Wan, S.; Yu, P.S. Multimodal Large Language Models: A Survey 2023.
- Huang, Y.; Zhang, W.; Feng, L.; Wu, X.; Tan, K.C. How Multimodal Integration Boost the Performance of Llm for Optimization: Case Study on Capacitated Vehicle Routing Problems. arXiv preprint arXiv:2403.01757 2024.
- Huang, Z.; Shi, G.; Sukhatme, G.S. From Words to Routes: Applying Large Language Models to Vehicle Routing 2024.
- Deudon, M.; Cournut, P.; Lacoste, A.; Adulyasak, Y.; Rousseau, L.-M. Learning Heuristics for the Tsp by Policy Gradient. In Proceedings of the Integration of Constraint Programming, Artificial Intelligence, and Operations Research: 15th International Conference, CPAIOR 2018, Delft, The Netherlands, June 26–29, 2018, Proceedings 15; Springer, 2018; pp. 170–181.
- Chen, W.; Zhang, Y.; Zhou, Y. Integrated Scheduling of Zone Picking and Vehicle Routing Problem with Time Windows in the Front Warehouse Mode. Comput Ind Eng 2022, 163, 107823.
- Elhenawy, M.; Abdelhay, A.; Alhadidi, T.I.; Ashqar, H.I.; Jaradat, S.; Jaber, A.; Glaser, S.; Rakotonirainy, A. Eyeballing Combinatorial Problems: A Case Study of Using Multimodal Large Language Models to Solve Traveling Salesman Problems. 2024.
- Masoud, M.; Abdelhay, A.; Elhenawy, M. Exploring Combinatorial Problem Solving with Large Language Models: A Case Study on the Travelling Salesman Problem Using GPT-3.5 Turbo. 2024.




| problem size | p-value | number of pairs | p-value | number of pairs | p-value | number of pairs |
| 10 | 0.0010 | 27 | 0.0002 | 24 | 0.0004 | 29 |
| 15 | 0.0003 | 27 | 0.0001 | 28 | 0.0020 | 22 |
| 20 | 0.0004 | 24 | 0.0002 | 20 | 0.0010 | 22 |
| 25 | 0.0156 | 28 | 0.0005 | 18 | 0.0156 | 19 |
| 30 | 0.0020 | 16 | 0.0156 | 20 | 0.1250 | 10 |
| 35 | 0.5000 | 9 | 1.0000 | 7 | 0.0313 | 13 |
| m=1 | m=2 | m=3 | ||||||
|---|---|---|---|---|---|---|---|---|
| problem size | p-value | number of pairs | p-value | number of pairs | p-value | number of pairs | ||
| 10 | 0.0004 | 30 | 0.0001 | 30 | <0.0001 | 30 | ||
| 15 | 0.0001 | 28 | 0.0002 | 26 | 0.0001 | 25 | ||
| 20 | 0.0001 | 24 | 0.0005 | 20 | 0.0039 | 19 | ||
| 25 | 0.0020 | 19 | 0.0002 | 19 | 0.0005 | 19 | ||
| 30 | 0.0020 | 15 | 0.0078 | 16 | 0.1250 | 21 | ||
| 35 | 0.0313 | 17 | 0.1250 | 16 | 0.0625 | 14 | ||
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).