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

Zike Yuan, Ming Liu, Hui Wang, Bing Qin · DOI

Abstract

Graph-theoretic problems are fundamental to industrial optimization, yet solving them from natural language descriptions remains a challenge for both traditional algorithms and modern Large Language Models (LLMs). We present MA-GTS (Multi-Agent Graph Theory Solver), a hierarchical framework that bridges this gap. By decomposing the problem into specialized layers for information extraction, knowledge integration, and code execution, MA-GTS achieves over 90% accuracy on complex benchmarks like G-REAL. Furthermore, MA-GTS demonstrates significant cost-efficiency, reducing inference expenses by up to 20 times compared to monolithic reasoning models like OpenAI’s o3-mini while maintaining superior structural robustness.

Introduction

From delivery logistics (Traveling Salesman Problem) to wireless channel allocation (Graph Coloring), graph problems are ubiquitous. However, applying formal algorithms in real-world scenarios is hindered by two main factors: the lack of structured data in natural language inputs and the mathematical unreliability of LLMs when handling NP-hard problems. Existing LLM-based approaches often struggle with context window limitations, "hallucinations" in pathfinding, and a lack of domain-specific algorithmic knowledge.

Methodology: The MA-GTS Framework

MA-GTS addresses these challenges through a three-layer hierarchical architecture designed to "divide and conquer" the translation from text to solution.

The three-layer architecture of MA-GTS: Information Extraction, Knowledge Integration, and Algorithm Execution.
  1. Information Extraction Layer (IEL): This layer utilizes three specialized agents to strip noise from the input. The Textual Information Agent extracts semantic context, the Problem Information Agent identifies constraints and objectives, and the Structure Information Agent maps raw data into a formal graph format (nodes and edges).
  2. Knowledge Integration Layer (KIL): Serving as the system's reasoning core, this layer consults a Graph Theory Knowledge Base. It analyzes the graph's properties (e.g., scale and density) to select the most appropriate algorithm, ensuring that the chosen method is computationally feasible for the specific instance.
  3. Algorithm Execution Layer (AEL): Rather than generating a solution through probabilistic text, the Algorithm Solving Agent invokes verified code from a curated Algorithm Library. This code is executed in a secure interpreter, followed by a self-check process to validate the feasibility of the final output.

Evaluation and Datasets

The framework was evaluated against three primary benchmarks:

  • G-REAL: A novel dataset simulating real-world complexity with noisy, story-based descriptions and randomized node names to prevent memorization.
  • GraCoRe: A benchmark focused on graph comprehension and complex reasoning.
  • NLGraph: A standard dataset for basic graph-theoretic tasks.

Key Results and Discussion

MA-GTS demonstrates a significant performance leap over monolithic models. It achieved 93.6% accuracy on G-REAL, 96.9% on GraCoRe, and 98.4% on NLGraph. On the particularly challenging Traveling Salesman Problem (TSP) within G-REAL, MA-GTS outperformed o3-mini by 82%.

Efficiency and Cost-Effectiveness

A critical advantage of the multi-agent approach is its efficiency. By using targeted agent calls rather than massive "hidden" reasoning chains, MA-GTS significantly reduces token consumption and cost.

Comparison of input/output tokens and pricing between o3-mini and MA-GTS (GPT-4o-mini) across various graph problems.

As shown in the table above, MA-GTS (built on GPT-4o-mini) is approximately 10 to 20 times cheaper than o3-mini. For instance, solving a TSP instance cost $0.0047 with MA-GTS compared to $0.0244 with o3-mini, despite the former providing a more accurate and verifiable result.

Structural Robustness

The framework exhibits high stability as graph size increases. While standard LLMs like o3-mini show a sharp decline in performance on tasks with more than 20 nodes, MA-GTS maintains its accuracy by offloading the mathematical heavy lifting to formal Python-based algorithms. This confirms the philosophy that LLMs are best utilized as scene interpreters and tool invokers rather than raw calculators.

Limitations and Future Work

Despite its success, MA-GTS faces scaling challenges. Current evaluations were limited to graphs of up to 40 nodes; future research will explore its performance on massive industrial graphs with thousands of nodes. Additionally, the orchestration of multiple agents introduces computational overhead that may impact real-time applications. Expanding the framework to support a wider diversity of hybrid graph constraints remains a priority for future development.

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