## 4 Case Study
### Implementation  
To demonstrate that LLMs can be successfully integrated with optimization in semi-structured decision making, we developed a prototype implementation using ChatGTP-4o [40], a version of OpenAI's language model that was released in May 2024, along with a heuristic for the park-and-multi-loop vehicle routing and scheduling problem with autonomous delivery robots [31] and LangChain [41], a powerful framework that facilitates seamless interaction between LLMs and other applications. The prototype architecture comprises several layers, including the following:  
* The _User Interface Layer_, which provides a user-friendly dashboard for interacting with the system. Users can initiate optimization tasks, visualize the results of the analysis performed by the LLM, and provide high-level directions in natural language.
* _Orchestration Middleware_, based on the LangChain Python library, which acts as the intermediary between the LLM and the Java application implementing the optimization algorithm. It coordinates the data flow, ensuring that insights from the LLM are appropriately applied to the optimization model.
* The _LLM Integration Layer_, which provides access to the LLM for processing natural language prompts and generating responses through API.
* The _Optimization Layer_, which implements the VRS algorithm presented in [31]. It exposes RESTful endpoints for initiating optimization tasks, receiving weights \(w_{2}\) and \(w_{3}\) from the LLM, and retrieving optimization results.  
The interaction between stakeholders, the LLM, and the optimization algorithm is illustrated in Figure 4.  
In this case study, the role of the LLM was twofold: (1) to serve as a constructive heuristic for the location selection component, embedding stakeholder preferences, and (2) to adjust the parameters of a multi-objective metaheuristic [31] for optimizing vehicle routing and scheduling.  
In an initial phase, the LLM was given a prompt-before-prompt describing the decision in terms of entities and relationships among them. We also outlined the PSS constructive heuristic to be implemented, as well as the role of weights \(w_{2}\) and \(w_{3}\) in the parameterized heuristic [31], which are used to control the trade-off between objectives \(z_{2}\) and \(z_{3}\).  
As a PSS constructive heuristic, we implemented a simple procedure. We asked the LLM to divide the service territory in a 3 \(\times\) 3 grid with given values of latitude and longitude at the borders. For a given \(k\), the LLM was required to select the parking slots according to two criteria: assuring a balanced customer/parking slot ratio for each sub-zone (_parking slot density_ criterion), and maximizing the proximity of the selected parking slots to customers (_parking slot average distance from customer_ criterion).  
After examining the solution to the VRS problem for a certain set of parking slots, the decision makers can ask--on the basis of their preferences--to increase or reduce a certain objective, the replacement of a specific parking slot with a valid alternative, etc. The LLM reviews the requests and possibly modifies \(z_{1}=k\), identifies a new pool of parking slots, and sets different weights for \(z_{2}\) and \(z_{3}\). Then, the optimization module generates a new solution to the VRS problem, and so on.