TLDR: This research introduces a Knowledge Graph-based Retrieval-Augmented Generation (KG-RAG) framework for selecting optimal algorithms for the complex Facility Layout Problem (FLP). By constructing a domain-specific knowledge graph and employing a multi-faceted retrieval mechanism (graph, vector, and cluster-based search), the framework provides relevant evidence to a Large Language Model (LLM). This allows the LLM to generate accurate, data-driven, and explainable algorithm recommendations. The KG-RAG method significantly outperforms commercial LLM chatbots, achieving 100% recommendation accuracy and superior reasoning quality, while also incorporating a continuous learning loop for ongoing improvement.
The Facility Layout Problem (FLP) is a critical challenge in industrial engineering and operations research. It involves strategically placing facilities like machines or departments within a given space to optimize performance metrics, such as minimizing material handling costs or maximizing safety. An effective layout can significantly reduce operating costs, sometimes by 20% to 50%. However, FLP is an NP-hard optimization problem, meaning its computational complexity grows exponentially with size, and it often involves multiple conflicting objectives and various constraints. This complexity makes selecting the most suitable solution algorithm a highly specialized task, typically requiring deep expert knowledge.
Traditional approaches to FLP algorithm selection have included static decision-support methods, flowcharts, and data-driven meta-learning techniques. While these have offered some improvements, they often lack the adaptability for new algorithms or dynamic problem definitions. The rise of Large Language Models (LLMs) like Google Gemini has introduced new possibilities, but these general-purpose models often struggle with domain-specific problems, leading to issues like ‘hallucinations’ (plausible but incorrect responses) and weak domain adaptation.
Introducing the KG-RAG Framework
To address these limitations, researchers have developed a novel recommendation method based on a Knowledge Graph-based Retrieval-Augmented Generation (KG-RAG) framework. This framework aims to make expert knowledge accessible and provide data-driven recommendations for algorithm selection in FLP. The core idea is to ground LLMs with structured, verifiable knowledge from a domain-specific knowledge graph, enhancing accuracy and interpretability.
How the KG-RAG Method Works
The proposed KG-RAG method operates through a multi-stage pipeline:
-
Knowledge Graph Construction: A domain-specific knowledge graph is built from published literature and datasets of solved FLP instances. This graph transforms flat, tabular data into an interconnected network of entities (problems, methods, objectives, constraints) and their relationships. It also includes automated clustering (e.g., by problem scale or objective type) and vector-based embeddings for conceptual search.
-
User Query Input: The process begins with a user defining their FLP, specifying objectives, number of facilities, and constraints. This input can be flexible, accommodating diverse problem characteristics.
-
Hybrid Evidence Retrieval: To gather comprehensive evidence, the method employs three parallel retrieval strategies from the Neo4j Knowledge Graph:
-
Graph-based Search: A precise, structured search using Cypher queries dynamically built from user inputs. This search includes flexible filtering (e.g., a ±25% range for the number of facilities), performance-oriented ordering to prioritize relevant and high-performing solutions, and adaptive fallback mechanisms for unprecedented problem scales.
-
Vector-based Search: The user’s free-text problem description is converted into a vector, which is then used to perform a similarity search against indexed problem nodes in the knowledge graph, finding conceptually similar problems.
-
Cluster-based Search: This analyzes high-level trends by identifying common patterns and top algorithms associated with specific scale and objective clusters relevant to the user’s query.
-
-
LLM-Powered Recommendation: The retrieved evidence from all three channels is compiled into a contextualized dossier. This dossier, along with the original user query, is then passed to a Google Gemini LLM. The LLM is prompted to act as an expert analyst, synthesizing the provided data to generate a final recommendation, including the algorithm, its parameters, suitable problem representation, and constraint handling techniques. Crucially, it also provides a clear, evidence-driven explanation, significantly reducing the risk of hallucinations.
-
Continuous Learning: The framework incorporates an intelligent feedback loop. When users submit new solved problem cases, the system learns and integrates this information into the knowledge graph, ensuring its long-term relevance and accuracy.
Comparative Evaluation and Results
The KG-RAG method was rigorously evaluated against a baseline model, which used the same Google Gemini LLM but was provided with the raw CSV dataset as its knowledge source. Across five diverse, real-world FLP test cases, the KG-RAG method achieved 100% recommendation accuracy and a perfect 5/5 reasoning score. In contrast, the baseline LLM achieved only 20% accuracy and an average reasoning score of 3.4/5. The baseline often failed due to its inability to perform high-level frequency analysis or understand explicit relationships between problem characteristics and algorithms, leading to factually incorrect suggestions.
The superior performance of the KG-RAG method stems from its ability to synthesize multiple layers of evidence—from specific problem instances to higher-level trends from clusters—and its explicit querying capabilities for multi-objective problems. This ensures that the recommendations are not only accurate but also transparent and reliably justified by the provided data.
Also Read:
- Language Models Tackle Complex Optimization Challenges End-to-End
- CogAtom: Building Advanced Math Problems to Elevate AI Reasoning
Conclusion
This research introduces a powerful and adaptive solution for algorithm selection in the Facility Layout Problem. By integrating a structured knowledge graph with the advanced reasoning capabilities of LLMs, the KG-RAG framework provides explainable, high-quality, and data-driven recommendations. While currently domain-specific to FLP, the framework’s continuous learning loop ensures its adaptability and future potential for other complex optimization problems. For more details, you can refer to the full research paper here.


