MA-GTS: A Multi-Agent Framework for Solving Complex Graph Problems in Real-World Applications

Zike Yuan, Ming Liu, Hui Wang, Bing Qin

Abstract

Graph-theoretic problems arise in real-world applications like logistics, communication networks, and traffic optimization. These problems are often complex, noisy, and irregular, posing challenges for traditional algorithms. Large language models offer potential solutions but face several challenges, including limited accuracy, input length constraints, and suboptimal algorithm selection. To address these challenges, we propose MA-GTS (Multi-Agent Graph Theory Solver), a multi-agent framework that decomposes these complex problems through agent collaboration. MA-GTS maps the implicitly expressed text-based graph data into clear, structured graph representations and dynamically selects the most suitable algorithm based on problem constraints and graph structure scale. We validate MA-GTS using the G-REAL dataset, a real-world-inspired graph theory dataset we created. Experimental results show that MA-GTS outperforms state-of-the-art methods in cost-effectiveness, accuracy, and scalability, achieving strong results on multiple benchmarks (G-REAL 93.6%, GraCoRe 96.9% NL-Graph 98.4%) with robust performance on both closed- and open-source base models.

Introduction

Graph theory is the backbone of modern logistics, network routing, and traffic optimization. However, a significant gap exists between clean textbook problems and real-world scenarios, which are often characterized by "textual noise"—irrelevant details, implicit structures, and non-standard naming conventions. While Large Language Models (LLMs) excel at understanding context, they struggle with the rigorous computation required for NP-hard graph problems due to reasoning limits, context constraints, and sensitivity to noise.

MA-GTS (Multi-Agent Graph Theory Solver) bridges this gap by orchestrating a team of specialized LLM agents. Instead of attempting to solve complex math directly, the framework transforms messy natural language into structured graph problems and solves them using surgical algorithmic precision.

Methodology: The MA-GTS Architecture

MA-GTS utilizes a hierarchical three-layer architecture designed to separate problem comprehension from mathematical execution. This modular approach allows the system to maintain the flexibility of natural language processing while leveraging the reliability of classical algorithms.

The hierarchical three-layer architecture of MA-GTS, comprising Information Extraction, Knowledge Integration, and Algorithm Execution layers.

1. Information Extraction Layer (IEL)

This layer consists of three specialized agents—Textual, Problem, and Structure—that collaborate to filter noise. They identify the core problem type (e.g., Shortest Path or Traveling Salesman) and extract raw graph data from the input text.

2. Knowledge Integration Layer (KIL)

Acting as the system's architect, the Graph Theory Agent queries a specialized Knowledge Base to select the most efficient algorithm based on the graph's scale and constraints. It standardizes the extracted data into a clean digital format, such as an adjacency list.

3. Algorithm Execution Layer (AEL)

The "Engineer" agent retrieves the selected algorithm from a pre-built Python library and executes it via a code interpreter. A self-check mechanism ensures the final solution adheres to all original problem constraints.

Experimental Setup and Datasets

The framework was evaluated on three primary benchmarks:

  • G-REAL: A new dataset simulating real-world scenarios (e.g., delivery logistics, Wi-Fi allocation) with heavy textual noise and randomized node names to prevent models from relying on prior knowledge.
  • GraCoRe: A benchmark focused on graph comprehension and reasoning.
  • NL-Graph: A dataset of graph problems expressed in natural language.

Results and Discussion

MA-GTS demonstrates superior performance across accuracy, cost-efficiency, and scalability metrics compared to state-of-the-art reasoning models like OpenAI’s o3-mini.

Accuracy and Scalability

On the complex G-REAL Traveling Salesman Problem (TSP) task, MA-GTS achieved 94.9% accuracy, whereas o3-mini (relying on internal Chain-of-Thought reasoning) achieved only 12.9%. Furthermore, while standard LLM performance typically plummets as graph size increases, MA-GTS remains stable because its underlying Python algorithms are not subject to the memory or logic fatigue inherent in neural networks.

Cost Efficiency

By delegating computation to code rather than internal reasoning tokens, MA-GTS is significantly more economical. For instance, in Vertex Cover problems, MA-GTS reduced inference costs by nearly 20x compared to o3-mini.

Comparison of token usage and pricing between o3-mini and MA-GTS, highlighting the significant cost reduction achieved by the multi-agent framework.

Conclusion

MA-GTS shifts the role of the LLM from a calculator to an orchestrator. By explicitly handling noise removal and delegating heavy lifting to a Python library, the framework achieves high accuracy even in cluttered real-world scenarios. Future work will focus on expanding the framework to even larger graphs and optimizing the tool-invocation capabilities of open-source models to match the performance of closed-source counterparts.

Summary updated

Abstract

Graph-theoretic problems arise in real-world applications like logistics, communication networks, and traffic optimization.These problems are often complex, noisy, and irregular, posing challenges for traditional algorithms.Large language models offer potential solutions but face several challenges, including limited accuracy, input length constraints, and suboptimal algorithm selection.To address these challenges, we propose MA-GTS (Multi-Agent Graph Theory Solver), a multi-agent framework that decomposes these complex problems through agent collaboration.MA-GTS maps the implicitly expressed textbased graph data into clear, structured graph representations and dynamically selects the most suitable algorithm based on problem constraints and graph structure scale.We validate MA-GTS using the G-REAL dataset, a real-world-inspired graph theory dataset we created.Experimental results show that MA-GTS outperforms state-of-the-art methods in cost-effectiveness, accuracy, and scalability, achieving strong results on multiple benchmarks (G-REAL 93.6%, GraCoRe 96.9% NL-Graph 98.4%) with robust performance on both closed-and open-source base models.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
G-REALMA-GTSaccuracy93.6%+81.8 vs baselineDataset-level result; the paper identifies final computed-solution accuracy as its prim…
Source quote
L5: We validate MA-GTS using the G-REAL dataset, a real-world-inspired graph theory dataset we created. Experimental results show that MA-GTS outperforms state-of-the-art methods in cost-effectiveness, accuracy, and scalability, achieving strong results on multiple benchmarks (G-REAL 93.6%, GraCoRe 96.9% NLGraph 98.4%) with robust performance on both closed- and open-source base models. MA-GTS and G-REAL are open-sourced at \href{https://github.com/ZIKEYUAN/MA-GTS.git}{https://github.com/ZIKEYUAN/MA-GTS.git}.
GraCoReMA-GTSaccuracy96.9%Dataset-level result; evaluation includes TSP, shortest-path, and cycle sub-tasks. The …
Source quote
L5: We validate MA-GTS using the G-REAL dataset, a real-world-inspired graph theory dataset we created. Experimental results show that MA-GTS outperforms state-of-the-art methods in cost-effectiveness, accuracy, and scalability, achieving strong results on multiple benchmarks (G-REAL 93.6%, GraCoRe 96.9% NLGraph 98.4%) with robust performance on both closed- and open-source base models. MA-GTS and G-REAL are open-sourced at \href{https://github.com/ZIKEYUAN/MA-GTS.git}{https://github.com/ZIKEYUAN/MA-GTS.git}.
NLGraphMA-GTSaccuracy98.4%Dataset-level result; evaluation includes TSP, shortest-path, and cycle sub-tasks. The …
Source quote
L5: We validate MA-GTS using the G-REAL dataset, a real-world-inspired graph theory dataset we created. Experimental results show that MA-GTS outperforms state-of-the-art methods in cost-effectiveness, accuracy, and scalability, achieving strong results on multiple benchmarks (G-REAL 93.6%, GraCoRe 96.9% NLGraph 98.4%) with robust performance on both closed- and open-source base models. MA-GTS and G-REAL are open-sourced at \href{https://github.com/ZIKEYUAN/MA-GTS.git}{https://github.com/ZIKEYUAN/MA-GTS.git}.
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
GraCoRe TSPo3-mini baselineaccuracy79.7%nodes=8-25
Source quote
L233: To evaluate the performance of LLMs and MA-GTS on real-world graph theory problems, we constructed the G-REAL dataset. As shown in Table \ref{tab:2}, the performance of existing LLMs on the G-REAL dataset is suboptimal. To validate the effectiveness of this dataset, we compared it with the TSP problem from the GraCoRe Benchmark, testing problems with node sizes ranging from 8 to 25, consistent with the scale of G-REAL. From this comparison, we observe that on the G-REAL dataset, which includes text complexity, added text noise, and node name shuffling, the o3-mini model performs poorly, with its accuracy dropping from 79.7% in GraCoRe to 11.8%. In contrast, the MA-GTS framework appears unaffected by the complexities of real-world graph theory problems, maintaining performance above 90%. This result indirectly supports the validity of the G-REAL dataset and shows the stability of the MA-GTS.
G-REALo3-mini baselineaccuracy11.8%nodes=8-25
Source quote
L233: To evaluate the performance of LLMs and MA-GTS on real-world graph theory problems, we constructed the G-REAL dataset. As shown in Table \ref{tab:2}, the performance of existing LLMs on the G-REAL dataset is suboptimal. To validate the effectiveness of this dataset, we compared it with the TSP problem from the GraCoRe Benchmark, testing problems with node sizes ranging from 8 to 25, consistent with the scale of G-REAL. From this comparison, we observe that on the G-REAL dataset, which includes text complexity, added text noise, and node name shuffling, the o3-mini model performs poorly, with its accuracy dropping from 79.7% in GraCoRe to 11.8%. In contrast, the MA-GTS framework appears unaffected by the complexities of real-world graph theory problems, maintaining performance above 90%. This result indirectly supports the validity of the G-REAL dataset and shows the stability of the MA-GTS.
BibTeX
@misc{yuan2025ma,
  author = {Zike Yuan and Ming Liu and Hui Wang and Bing Qin},
  title = {{MA-GTS: A Multi-Agent Framework for Solving Complex Graph Problems in Real-World Applications}},
  year = {2025},
  eprint = {2502.18540},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.18540},
}
Figure