Large Language Models as End-to-end Combinatorial Optimization Solvers
Preprint
Abstract
Combinatorial optimization (CO) problems, central to decision-making scenarios like logistics and manufacturing, are traditionally solved using problem-specific algorithms requiring significant domain expertise. While large language models (LLMs) have shown promise in automating CO problem solving, existing approaches rely on intermediate steps such as code generation or solver invocation, limiting their generality and accessibility. This paper introduces a novel framework that empowers LLMs to serve as end-to-end CO solvers by directly mapping natural language problem descriptions to solutions. We propose a two-stage training strategy: supervised fine-tuning (SFT) imparts LLMs with solution generation patterns from domain-specific solvers, while a feasibility-and-optimality-aware reinforcement learning (FOARL) process explicitly mitigates constraint violations and refines solution quality. Evaluation across seven NP-hard CO problems shows that our method achieves a high feasibility rate and reduces the average optimality gap to 1.03-8.20% by tuning a 7B-parameter LLM, surpassing both general-purpose LLMs (e.g., GPT-4o), reasoning models (e.g., DeepSeek-R1), and domain-specific heuristics. Our method establishes a unified language-based pipeline for CO without extensive code execution or manual architectural adjustments for different problems, offering a general and language-driven alternative to traditional solver design while maintaining relative feasibility guarantees.Keywords
All Related Versions
This publication has 16 references indexed in Scilit:
- Large language models for combinatorial optimization of design structure matrixProceedings of the Design Society, 2025
- A generalist medical language model for disease diagnosis assistanceNature Medicine, 2025
- A Graph-Neural-Network-Powered Solver Framework for Graph Optimization ProblemsIEEE Transactions on Neural Networks and Learning Systems, 2024
- Combinatorial optimization methods for yarn dyeing planningFlexible Services and Manufacturing Journal, 2024
- Mathematical discoveries from program search with large language modelsNature, 2023
- Learning to select operators in meta-heuristics: An integration of Q-learning into the iterated greedy algorithm for the permutation flowshop scheduling problemEuropean Journal of Operational Research, 2022
- Operating room planning and surgical case scheduling: a review of literatureJournal of Combinatorial Optimization, 2018
- An efficient evolutionary algorithm for the orienteering problemComputers & Operations Research, 2018
- A review of dynamic vehicle routing problemsEuropean Journal of Operational Research, 2013
- Benchmarks for basic scheduling problemsEuropean Journal of Operational Research, 1993