1. Introduction
With the advent of major transformations in the urban environment, new difficulties also arise for the movement of vehicles and people. The creation of new forms of business, which offer greater facilities to consumers, tends to promote new flows, increasing the number of vehicles in circulation and directly impacting the conditions of the roads and their users. These challenges also become aggravating for pollution (atmospheric, visual, and sound) and traffic caused by road insufficiency, which leads to higher costs related to time, fuel, and wear of the fleet. Given this, the logistics process becomes increasingly complex, requiring that the decisions related to it are made in an increasingly agile manner, aiming at the provision of quality services in a profitable way for those who use or offer them [
1].
When seeking to understand and improve the logistics system within cities, two terms are very important: City Logistics and Last Mile Logistics. Even though they are interrelated, each of these has its particularities and approaches the urban environment in a different way. According to [
2], synthesizing definitions from other authors, City Logistics seeks to optimize all stages of transport among vehicles and people by considering factors directly linked to urban centers, such as environmental and road infrastructure, aligned with clean technologies aimed at mitigating harms; Last Mile Logistics comprises the phase responsible for the last stage of the logistics process, directly analyzing the delivery of goods to the customer. This step is often the costliest and most challenging in the distribution chain, due to the fragmentation of deliveries and the need for greater flexibility [
3]. To meet the frequent need for more agile, effective, and flexible decisions in the transport system, seeking to meet gradually more specific places and requirements, computational solutions have been applied to the logistics process, aiming to maximize profit and minimize costs. Among them, the VRP stands out; it is aimed at optimizing transport routes, taking into account factors such as minimizing distances traveled, travel time, and operating costs. It is worth noting that this is a problem of an operational–tactical level. However, the increasing complexity of urban environments and the various constraints imposed, such as vehicle capacity, time windows for deliveries, and variable road conditions, make VRP solutions challenging, requiring a lot of computational power to obtain optimal solutions. Although it is linked to these difficulties of resolution, the VRP is still very advantageous for transport, logistics, distribution, and storage applications, such as deliveries in large urban centers with access restrictions, traffic, and fast delivery requirements. To address these challenges, the so-called metaheuristics, such as ACO, have been widely used. These techniques provide efficient solutions to complex problems, performing a search for optimal results, avoiding the use of exact methods that are often unfeasible due to the complexity of the problems involved [
4,
5]. The existing metaheuristic algorithms include algorithms that rely on natural or biological phenomena for solving complex problems. ACO and its optimization variations are based on the behavior of ants during the formation of optimal routes in the search for food by positive feedback that simulates the deposition of a pheromone on the ground by an ant and its use as a clue for the other ants to follow the same path, now strongly marked, increasing the likelihood that more efficient paths will be found over time (iterations). Within the ACO simulation, each iteration simulates this process using agents (artificial ants) and their collaborative behavior (pheromone deposition), which creates a trail of future information and directly influences the next steps. This process allows the algorithm to escape local minima and converge to quality solutions even in very complex problems such as the VRP. Variations in ACO (presented in the next sections) also incorporate different strategies to improve the efficiency of the algorithm by adapting it to different types of optimization problems [
6,
7].
ACO has proven to be a powerful tool for route and road infrastructure planners, supporting decision-making in the transportation sector. In the case of the VRP, the ability to implement solutions for complex problems with numerous variables and constraints—such as capacity and time restrictions—enables the optimization of routes and logistical operations. Regarding road infrastructure, it contributes to determining the location of service points, as well as road network planning [
6,
7,
8].
The potential applications of ACO concepts in two areas of Transportation Engineering—logistics and road infrastructure—motivated the development of this research. In the case of logistics, ACO can be applied to routing problems, especially in delivery operations and their interaction with urban logistics, particularly in the last mile. For studies related to road infrastructure, the study of ant behavior enables the proposal of locational analyses, such as determining the placement of service stations to support highway users.
This paper proposes the use of the Ant Colony Optimization (ACO) metaheuristic to determine the optimal locations for service stations along highways.
The goal is to balance profit maximization with cost minimization while also considering the level of service provided to users (both the driver and their vehicle).
The research contribution is derived from the results obtained.
A strong relationship is observed between vehicle efficiency and the standard deviation of the error between the actual and optimal coordinate values.
Vehicles with higher efficiency yield more accurate results, with a smaller gap between the optimal and actual values.
This finding serves as a starting point for the proposed application and future studies aimed at further improving the simulation model.
4. Methodology
This section highlights the methodology employed in this work. The stage of an ACO metaheuristic for a classic VRP is considered in
Figure 3.
4.1. Application of the ACO Metaheuristic in the Allocation of Service Stations on Highways
The model was developed in Python based on the modeling of the proposed scenario using the stages of the ACO metaheuristic, adapting it to the concepts of Transport Engineering, seeking a comparison between the points already built and those provided by the study method defined in Equation (5).
where
ρ∈0,1: parameter regulating the reduction of τij(t);
τij(t): intensity of the pheromone present at the edge (i,j) at the t-th iteration;
Q: amount of pheromone deposited by an ant for an entire solution;
RL: real distance;
RO: optimal distance.
From Equation (5), the parameters were adjusted to the variables intrinsic to Transport Engineering, as presented in
Table 1.
In the Ant Colony Optimization (ACO) framework, Equation (5) defines an adjusted parameter linking pheromone reinforcement to key ACO variables. Here, given by an equation such as Equation (2), represents the updated pheromone level on edge (vi,vj), with as the evaporation rate and Δτij as the deposited pheromone (often ). The denominator measures the net pheromone increase beyond a persistence-adjusted baseline . Thus, the ratio normalizes (Q) against the difference, dynamically adjusting pheromone reinforcement. A larger reduces , indicating weaker reinforcement, while a value close to increases it, enhancing sensitivity.
The description of this study, involving the route between Limeira and São Paulo via the Bandeirantes Highway (SP348), proposes an analysis related to logistics and transport system planning, a context in which ACO is often applied.
Figure 4 depicts the route calculated in this study.
The described approach considers the optimization of the choice of gas stations along the route, a task analogous to classical routing problems. In this scenario, the algorithm can be modeled so that the ants represent simulated vehicles that travel the route, depositing pheromones at the stations that best meet the established conditions, such as energy efficiency and proximity to the fuel or battery capacity limit. These decision points (gas stations) can be treated as nodes of a graph, where ants choose paths based on probabilistic criteria associated with characteristics such as distance, remaining energy, and accumulated pheromone intensity.
The adjustable parameters described in this study, such as pheromone decay and energy consumption per kilometer, are directly related to the elements of ACO. Decay control, for example, reflects the volatility of pheromone trails, allowing the algorithm to maintain a balance between exploring new solutions and intensifying around the most promising routes. Similarly, energy consumption per kilometer can be included as a constraint or a decision factor in the model, affecting the ants’ simulated choices.
In the context of ACO, a system with high entropy would be associated with a broad exploration of the solution space, avoiding early convergence to an optimal location. Thus, entropy provides an indicator of the quality of the search performed by the algorithm. The proposal to test different scenarios in the study, such as changes in traffic patterns or variations in operational parameters, aligns with the flexibility of ACO to adapt to different input conditions.
The practical application of ACO to the problem of the highway may involve the identification of the best gas stations throughout the route, considering both the minimization of travel time and the maximization of energy efficiency. In addition, the model can be adjusted to incorporate real constraints, such as the proximity of stations to the carriageway, contributing to the achievement of viable solutions in the context of road transport. Nevertheless, the study shows how ACO can be an effective tool to address challenges related to logistics and optimization in transportation systems.
4.2. Modeling Freight Costs: A Contemporary Integration of Physics, Regression, and Entropy
Modeling freight costs is a complex challenge requiring the integration of spatial, temporal, and economic variables, often grounded in physical analogies and advanced statistical methods. This study proposes an interdisciplinary framework combining Newtonian dynamics, gravitational models, linear regression, and entropy, aligning with recent trends in transportation and logistics research. A gravitational analogy is introduced in Equation (6), adapted from [
17]; this formulation is refined by [
18] for transportation modeling. Solving for
,
where
Using time as an independent variable, Equation (7) can be used to model the money-related variable.
where
y(t): money-related variable at time t;
: variable of space with time;
: intercept, representing the y value when x is zero;
: coefficient associated with the time variable;
: Factor Error.
Freight cost Cf is modeled using linear regression [
19]. Transforming Equation (7) for the cost of freight, we obtain Equation (8)
where uncertainty in ϵt is analyzed via conditional entropy. Using entropy can be explored in the context of information theory, as in Equation (9):
where
H is the conditional entropy of the error variable ϵt with the knowledge of the distance and traffic time;
P (ϵt|Distance, timeTraffic)] regression represents the relationship between freight cost, distance, and traffic time;
dist(1) refers to the distance traveled in a specific unit (e.g., kilometers or miles), typically the physical distance between two points, such as the origin and the first destination (indicated by “(1)”). In the context of “distance traffic” (traffic distance), it may represent the effective distance on a route subject to traffic conditions.
|Distance, timeTraffic represents the time spent in traffic, measured in units such as minutes or hours. This term captures the effect of traffic conditions (congestion, average speed, etc.) on the total cost. In the context of “distance traffic”, it refers to the additional or variable time associated with the distance traveled in a traffic-affected environment.
E is the economic reliability factor.
In Equation (9), H measures residual uncertainty, and E[log P (ϵt|Distance, timeTraffic)] is the expectation. This aligns with modern applications in transportation [
20] for modeling flow uncertainties.
The differential entropy H(ϵt) = ) depends exclusively on the variance σ2, reflecting that the uncertainty of a normal distribution increases with the dispersion of values. The constant terms 2π (e) emerge from the structure of the Gaussian:
2π is related to the normalization constant of the PDF.
e: (the base of natural logarithms) reflects the property of the normal distribution as the maximum entropy distribution for a fixed variance.
It should be noted that H(ϵt) can be negative for σ2 < , a typical behavior of differential entropy, which is not lower-bounded like discrete entropy.
The entropy of ϵt can be estimated as in Rashedi et al. [
20], assuming ϵ
t~N (0,
):
This framework introduces an innovative approach to freight transport cost modeling, integrating principles of physics, economics, and information theory, grounded in the recent literature. It contributes to advancements in Transport Engineering and logistics, emphasizing the need for empirical validation to enhance mobility systems and operational efficiency.
5. Results and Discussion
As described, values considered appropriate for popular Brazilian vehicles were used to obtain the results and are thus considered the standard vehicles in this study. The variation in the yield/range values is adopted to verify the behavior of the results, while the other parameters remain fixed:
Q = 47 Liters (tank capacity of a passenger vehicle), and τij(t) = 10% of tank capacity (minimum fuel level in the tank for refueling to occur).
The relationship between the economic reliability factor (ERF) and fuel efficiency is established based on the difference between the estimated optimal value and the real value obtained. Such a difference reflects the accuracy and reliability of the economic model in predicting fuel consumption performance under practical conditions and is an essential indicator for assessing the efficiency of projected results and their adherence to real operating conditions. This relationship is directly linked to fuel efficiency indices, as higher performance values result in a proportional reduction in standard deviations in economic reliability factors, as shown in
Figure 4. This provides a more precise and accurate analysis of fuel efficiency.
An important consideration when employing the Ant Colony Optimization (ACO) metaheuristic is its effectiveness in solving problems that involve cost minimization or maximization, such as fuel consumption evaluation. By simulating the collective behavior of ants and employing a pheromone updating mechanism, ACO is capable of exploring a variety of solutions aimed at improving fuel efficiency. In this context, the objective is to enhance performance while reducing the variability of economic factors in transportation systems.
In order to achieve this, the algorithm must be calibrated based on the values obtained from Equation (2), prioritizing solutions that exhibit both a higher standard deviation of the Economic Risk Factor (ERF) and improved fuel efficiency.
Accordingly, the search process favors solutions that yield higher performance and lower ERF variability, thereby contributing to the continuous improvement of system efficiency. The employed algorithm enables the exploration of new configurations, as well as the iterative refinement of previously identified solutions, aiming to achieve a balance between innovation and optimization.
In this scenario, the logarithmic regression that models the relationship between yield and ratio serves as a guide to adjust preferences, guiding the system towards a convergence of more sustainable and economically efficient solutions.
The ACO metaheuristic not only complements ERF analysis but also provides a powerful tool for optimizing complex efficiency and economic problems.
Table 2 and
Figure 4 show the results of the analysis of the RL/(RO ratio, fundamental for the calculation of the optimal x coordinate, considering the coordinates of the gas stations collected along the Bandeirantes Highway and the standard fuel yields of vehicles from the Brazilian popular fleet. The table presents the values of the standard deviation of the RL/OL ratio for each level of fuel efficiency, analyzed in a range from 5 km/L to 20 km/L.
Figure 4 graphically illustrates this relationship, showing a direct correlation between the standard deviation and fuel yield. It appears that this relationship can be applied to achieve good allocation results in two ways: (i) data collection for a more robust set of information, which implies a decrease in the standard deviation; (ii) stations with more frequent access of vehicles with a greater range can be reflected in the final result of the solution (ideal solution).
Figure 5 shows the standard deviations of the different yield values and their regression line.
5.1. Optimizing Freight Transport Routes Using Ant Colony Optimization: A Multi-Faceted Approach with Distance, Cost, and Entropy Analysis
This pseudocode implements an Ant Colony Optimization (ACO) metaheuristic to determine the most efficient freight transport route between Limeira and São Paulo, considering fuel constraints and intermediate stops along the SP-348 highway. The algorithm minimizes travel distance while accounting for refueling needs, using pheromone-based decision-making. Additionally, it calculates freight flow based on a gravitational model, estimates transport costs as a function of distance and traffic time, and computes entropy to assess variability. The accompanying visualizations include a map of the optimized route with labeled stops (
Figure 6), a bar chart comparing real versus optimized distances (
Figure 7), a curve showing freight cost as a function of distance with the optimized point highlighted (
Figure 8), and an entropy plot illustrating the relationship between error variance and system uncertainty, emphasizing the chosen variance value (
Figure 9).
Initialize parameters: α, β, ρ, Q, number of ants, and pheromone levels τ
While stopping condition not met do:
For each ant do:
Construct a solution (route) based on τ and heuristic η
end for
Evaluate all constructed solutions
Update pheromone trails:
τ ← (1 − ρ) × τ + Δ τ (from best solutions)
Store best global solution
end while
Return best solution found
Figure 6 presents the spatial representation of the optimized route. In this figure, the points indicate the locations of refueling stations along the route, while the line illustrates the path identified by the ACO algorithm. This representation allows us to verify that the metaheuristic selected intermediate stations to optimize fuel consumption and minimize travel costs.
Figure 7 provides a comparative analysis of the direct distance between Limeira and São Paulo versus the final distance obtained through the ACO algorithm. In this bar chart, the actual real-world distance between the two cities is represented by a gray bar, while the optimized route distance calculated by ACO is shown in green.
The x-axis categorizes these two distances as follows: “Real Distance”, which corresponds to approximately 150 km, and “Optimized Distance”, which is significantly shorter (e.g., 76.12 km). The y-axis measures distance in kilometers.
This difference arises because the optimized distance is calculated using Euclidean distances based on UTM coordinates, which only consider straight-line measurements between given points. As a result, the ACO algorithm underestimates the actual length of the SP-348 highway. This suggests two possible explanations: (1) the provided waypoints represent only a partial segment of the highway, or (2) the ACO algorithm prioritizes the shortest possible route since it assumes that vehicles have sufficient fuel autonomy and do not require additional detours for refueling.
This graph highlights a key limitation of the model: the simplified spatial representation does not fully capture the real-world road network, which includes curves, junctions, and other logistical constraints.
Figure 8 relates the traveled distance to the freight cost. The blue curve represents the variation in transportation costs as the distance increases, following a fitted linear model. The vertical red line marks the distance optimized by ACO, indicating where the proposed solution falls within the cost function. This graph reinforces that, despite a slight increase in total distance, optimization can lead to cost reductions by avoiding excessive fuel expenses and unplanned stoppages.
Figure 9 examines the behavior of system entropy as a function of error variance (εt). The purple curve represents the increase in entropy as the variability in transport costs rises. The vertical red line indicates the standard error variance value (εt = 3).
The graph shows that data variability is directly associated with increased uncertainty in transportation costs, reinforcing the need to reduce fluctuations and seek greater predictability in the logistics decision-making process.
The analysis of the graphs indicates that the application of the Ant Colony Optimization (ACO) metaheuristic contributes to route optimization by considering factors such as fuel consumption and operational costs. The algorithm identifies routes that balance energy efficiency and economic viability, not necessarily favoring the shortest path.
Table 2 showcases a comparison between ACO and generic algorithms.
Moreover, the modeling of costs and entropies in relation to financial predictability, combined with the appropriate definition of constraints, allows for a more accurate calibration of the algorithm based on real-world activity data, thereby enhancing its practical relevance.
5.2. Benchmark Comparison with Generic Algorithms
To validate the effectiveness of the Ant Colony Optimization (ACO) model, we conducted a comparative analysis with two generic algorithms commonly used in routing problems: Dijkstra’s shortest path algorithm and the Nearest Neighbor heuristic. These benchmarks were chosen due to their simplicity, wide usage in classical optimization problems, and ability to provide a reference for evaluating the added value of ACO.
Table 2 summarizes the results. While Dijkstra and Nearest Neighbor focus on geometric proximity and greedy choices, respectively, ACO integrates dynamic constraints such as fuel range and pheromone memory. As shown in
Table 3, ACO achieved a significantly shorter total path (76.12 km), compared to 102.60 km with Dijkstra and 104.53 km with Nearest Neighbor.
The capability of Ant Colony Optimization (ACO) to address complex logistical challenges is clearly demonstrated in this study. This research provides an innovative and relevant contribution to the management of complex logistics operations. The comparison reinforces the applicability of the ACO model in real-world logistics scenarios, particularly in optimizing fuel supply chains for road transport systems. This approach becomes even more strategic in the context of electric vehicles, where efficient placement of charging stations is essential to ensure route feasibility and operational optimization, enabling more informed and effective decision-making for logistics managers.
5.3. Sensitivy Analysis
Given the relevance of the parameters that govern the behavior of the Ant Colony Optimization (ACO) metaheuristic, particularly α (relative importance of the pheromone trail), β (relative importance of the heuristic information), ρ (pheromone evaporation rate), and Q (pheromone deposit intensity), it is essential to investigate the model’s sensitivity to variations in these elements. As highlighted by the reviewer, the initial absence of a sensitivity analysis could compromise the understanding of the algorithm’s robustness and stability.
Accordingly, this section presents a sensitivity analysis aimed at evaluating the individual impact of each parameter on the optimization model’s performance, in terms of both solution quality and convergence rate. This approach is fundamental not only for justifying the choices made during the algorithm’s calibration but also for demonstrating the consistency of the results under different parameter configurations. In this context, the analysis considers the 12 optimization results (RO) obtained by the method, which serve as the basis for assessing the effects of parameter variation. The following subsections present the observed effects of varying each of the four analyzed parameters.
The first parameter to be modified was ρ (pheromone evaporation rate). In this case, values ranging from 20 to 5 were analyzed (15 different scenarios), representing the average fuel consumption in kilometers per liter. The results indicate that as the average fuel efficiency decreases (i.e., below 15 km/L), the optimization result tends to increase when compared to the previously obtained reference result. Conversely, when fuel efficiency remains above this threshold, the optimization result tends to be lower than the reference result.
With respect to the pheromone trail parameter τij, the sensitivity analysis reveals that when its value is below 0.1 (specifically in the range of 0.025 to 0.075), the difference in the obtained solution (PO) compared to the previous result tends to be minimal. However, as τij increases beyond 0.1 (ranging from 0.125 to 0.525), the value of PO tends to increase in comparison to the previous result, with variations ranging from 0.16 to 3.43 units, corresponding to a relative increase between 0.057% and 0.0981%. These findings suggest that higher pheromone trail values may lead to less efficient solutions, likely due to excessive reinforcement of early paths, thereby reducing the algorithm’s exploratory capacity.
Regarding the vehicle’s fuel tank capacity parameter Q, the sensitivity analysis indicates that capacities ranging from 35 to 46 L tend to produce higher optimization results compared to the current baseline case, with increases ranging from 0.078% to 0.005%. In contrast, when the tank capacity exceeds 47 L, the optimization results tend to be lower than the baseline, with variations between 0.005% and 0.033%. These outcomes suggest that increasing the tank capacity beyond the baseline may enhance route efficiency by reducing the number of required refueling stops, while lower capacities may constrain route planning and increase overall costs.
This sensitivity analysis highlights the crucial role that parameter calibration plays in the performance of the ACO algorithm. Variations in ρ, τij, and Q demonstrated measurable impacts on solution quality, reinforcing the need for careful parameter tuning to ensure algorithmic robustness. The observed trends confirm that suboptimal parameter values can lead to performance degradation, while appropriate adjustments can enhance efficiency. Therefore, sensitivity analysis is not only a diagnostic tool but also a guiding step in model refinement. These insights support the validity of the chosen configuration and contribute to the reliability of the optimization results.
6. Conclusions
This study demonstrated the effectiveness of the Ant Colony Optimization (ACO) metaheuristic in solving problems related to Vehicle Routing and service station allocation, offering more robust and adaptable solutions for complex logistics challenges. The introduction of the economic reliability factor (ERF) represented a significant advance in route analysis, enabling a more accurate assessment of the economic and operational feasibility of the proposed solutions. The practical application on the Bandeirantes Highway illustrated the flexibility of the model, reinforcing the potential of ACO in real-world transportation contexts.
Despite these contributions, this study presented limitations regarding the use of Python for complex simulations, pointing to the need for more advanced computational tools capable of handling large-scale modeling. Moreover, integrating ACO with other metaheuristics or machine learning algorithms emerges as a promising direction to further improve solution quality and extend the methodology’s applicability.
In particular, the hybridization of ACO with reinforcement learning (RL) has shown notable effectiveness in addressing optimization problems such as Vehicle Routing Problems (VRPs), enabling algorithms to dynamically adapt their search behavior and improve convergence in complex, dynamic environments. This perspective aligns with a recent work [
21] which emphasized that the growing complexity and real-time demands of manufacturing scheduling problems characterized by large scale, high interdependence, and multiple conflicting objectives require intelligent hybrid approaches. The review highlights how the synergy between metaheuristics and reinforcement learning plays a critical role in enhancing decision-making through ensemble methods, adaptive criteria, and real-time feedback mechanisms.
The findings of this study reinforce the relevance of ACO as a powerful tool for Transport Engineering, with wide potential applications across logistics and road infrastructure sectors. Future research should explore the development of hybrid algorithms such as ACO-RL frameworks, the use of real-time operational data, and the adaptation of the model to both urban and rural scenarios, thus consolidating ACO’s role as an efficient and sustainable solution to contemporary logistics and mobility challenges.