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.
- 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).
- 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.
- 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.
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