LOGISPLANCTA
Volver al blog

AI in transport: how to combine genetic algorithms and machine learning to optimise routes

Artificial intelligence in transport combines techniques such as genetic algorithms and machine learning to improve logistics planning. While machine learning learns from historical data and enables better estimates of times, risks and incidents, genetic algorithms use that information to generate efficient, feasible routes adapted to the real constraints of each operation.

Artificial intelligence in transport is not simply about automating decisions or replacing human experience with a computer system.

In logistics, transport and distribution, artificial intelligence is useful when it helps people make better decisions in complex scenarios with large volumes of data, multiple constraints and little time to react.

Route planning is not simply a matter of calculating the shortest path between several points. A real operation involves vehicles, orders, schedules, capacities, costs, drivers, delivery windows, priorities, service times, access restrictions and constant changes throughout the day.

For this reason, AI in transport must combine different techniques. Genetic algorithms and machine learning can play complementary roles among them.

Genetic algorithms are particularly useful for finding good planning solutions in very large decision spaces. Machine learning, meanwhile, can learn patterns from historical data and improve the quality of the predictions used by the system.

When both techniques are combined correctly, it is possible to build optimisation systems that are more accurate, flexible and better adapted to the operational reality of each company.

The complexity of planning real routes

A delivery or transport route can appear simple when viewed from the outside.

There is a set of orders to deliver, an available fleet and a road network. The objective seems obvious: cover the shortest possible distance and finish as soon as possible.

However, reality is far more complex.

Each order may have a specific time window. Each vehicle may have a different capacity. Some customers may require special conditions. Certain areas may have access restrictions. Some vehicles may start or finish at different depots. Drivers may have schedules or mandatory breaks. In addition, not all orders have the same priority.

Variable factors must also be considered, such as traffic, incidents, delays, cancellations, new orders or differences between theoretical and actual service times.

The result is a highly combinatorial problem in which the number of possible solutions grows explosively as the number of orders and vehicles increases.

In this context, artificial intelligence should not be understood as a single technique, but as a set of methods capable of supporting different parts of the decision-making process.

Genetic algorithms: searching for good solutions

Genetic algorithms are inspired by the mechanisms of biological evolution.

They work with a population of candidate solutions. Each solution represents a possible plan: which orders each vehicle handles, the order in which customers are visited and how the operation is organised.

Starting from this initial population, the algorithm evaluates the quality of each solution, selects the best ones, combines parts of different solutions and applies small modifications to explore new alternatives.

This process is repeated over many generations, evolving the population towards increasingly better solutions.

In route optimisation, genetic algorithms are particularly useful because they do not need to evaluate every possible combination. Instead of performing an exhaustive search, they explore the solution space intelligently.

This makes it possible to find high-quality plans within a reasonable time, even for problems where calculating the exact optimum would be impractical.

Machine learning: learning from historical data

Machine learning has a different role.

While genetic algorithms search for solutions, machine learning learns patterns from data.

In transport and logistics, companies often accumulate highly valuable information: completed routes, actual arrival times, unloading times, incidents, delays, problematic areas, customer behaviour, vehicle utilisation and the results of previous plans.

This data can be used to train models capable of estimating more accurately certain values that directly influence optimisation.

For example, a system may learn that a customer's service time depends not only on the type of order, but also on the time of day, the area, delivery history, unloaded volume or the characteristics of the delivery point.

It may also learn that certain journeys usually take longer than indicated by a standard time matrix, or that some areas show recurring delay patterns.

These predictions can feed the optimisation engine so that the routes generated are more realistic.

Two complementary techniques

Genetic algorithms and machine learning do not compete with one another. They solve different parts of the problem.

Machine learning can help estimate reality more accurately.

Genetic algorithms can use those estimates to build better plans.

For example, machine learning can predict:

  • The actual service time at each customer.
  • The probability of delay in certain time bands.
  • The estimated duration of an unloading operation.
  • The operational difficulty of an area.
  • The reliability of a time window.
  • The usual behaviour of particular orders or customers.

Using these predictions, the genetic algorithm can generate routes that are better aligned with the real operation.

Instead of optimising using theoretical data, the system optimises using information enriched by historical learning.

This combination is particularly powerful because it brings together two different capabilities: learning from the past and finding good solutions for the future.

Optimising with more realistic data

A plan is only as good as the data on which it is built.

If the system assumes that all customers require the same service time, that every journey has a stable duration or that time windows always behave in the same way, the resulting solution may look optimal on paper but fail in practice.

Machine learning can improve these estimates.

For example, two customers may have the same delivery volume but very different unloading times. One may have a loading bay, available staff and easy access. Another may require waiting, manual unloading or entry through a difficult area.

If both are treated in the same way, the optimisation starts from an excessive simplification.

A learning model can detect these differences from historical data and provide more accurate service times.

By using this data, the genetic algorithm can reorganise routes more realistically, preventing accumulated delays and improving planning quality.

An enriched evaluation function

In a genetic algorithm, the evaluation function determines which solutions are better.

Traditionally, this function may assess distance, time, cost, number of vehicles, compliance with time windows or penalties for violations.

When machine learning is incorporated, the evaluation function can be enriched with learned information.

For example, not all delays carry the same risk. Not all areas have the same level of uncertainty. Not all customers show the same variability. Not all vehicles behave in the same way in practice.

The system can incorporate these factors into the evaluation.

A solution may be penalised if it concentrates too many high-uncertainty orders on the same route. Another may score better if it distributes risks more effectively. A route that is slightly longer may also be valued more highly if it is more likely to be completed without incidents.

This makes it possible to move from purely theoretical optimisation to more operational optimisation.

Prediction and optimisation

One of the keys to AI in transport is understanding the difference between prediction and optimisation.

Prediction means estimating what may happen.

Optimisation means deciding what to do with that information.

A machine-learning model can predict that a delivery has a high probability of being delayed. But that prediction alone does not solve the planning problem.

The optimisation engine must decide how to respond to that risk.

  • It may move the delivery earlier in the route.
  • It may assign it to another vehicle.
  • It may separate it from more critical orders.
  • It may give the route more time allowance.
  • It may change the order of visits.

This is where genetic algorithms add value.

They can work with many alternatives and assess how each decision affects the plan as a whole.

Intelligence lies not only in making better predictions, but in turning those predictions into better operational decisions.

Adapting to each company

One of the major advantages of combining genetic algorithms and machine learning is the ability to adapt progressively to each operation.

Not all transport companies operate in the same way. Some prioritise cost. Others prioritise on-time performance. Some handle highly homogeneous deliveries. Others have orders, customers and vehicles that differ greatly from one another.

Historical data makes it possible to identify patterns specific to each organisation.

The system can learn that certain routes work better with particular vehicles, that some areas are best served during specific time bands, that certain customers regularly cause waiting times or that some types of order show greater variability.

The genetic algorithm can then use this information to build plans that are better aligned with that specific reality.

In this way, optimisation stops being a generic model and becomes a tool adapted to the company's actual behaviour.

AI without losing operational control

Applying artificial intelligence to transport does not mean removing human judgement.

In many cases, the best solution is to combine automation, optimisation and operational supervision.

The system can propose efficient routes, identify risks, assess alternatives and drastically reduce manual work. However, traffic, planning and logistics managers continue to contribute business knowledge, operational judgement and decision-making ability in exceptional situations.

AI should increase analytical capacity, not hide the logic behind planning.

This is why optimisation systems should make it possible to understand why a solution is proposed, which constraints have been considered and what cost is associated with each alternative.

An optimised plan must be efficient, but also understandable and executable.

Benefits of AI in transport

When applied correctly, artificial intelligence can deliver significant benefits in transport and logistics.

  • It can reduce mileage and operating costs.
  • It improves the use of the available fleet.
  • It helps meet time windows more reliably.
  • It reduces delays and incidents.
  • It makes it possible to anticipate risks.
  • It improves service quality.
  • It facilitates adaptation to change.
  • It reduces the time required for planning.
  • It provides objective criteria for comparing alternatives.

The combination of genetic algorithms and machine learning tackles the problem from two directions: learning more accurately how the operation behaves and optimising the decisions that need to be made.

Conclusion

AI in transport should not be understood as a single solution, but as a combination of techniques capable of improving different stages of logistics planning.

Machine learning can learn from historical data and estimate times, risks and operational behaviour more accurately.

Genetic algorithms can use that information to explore thousands of alternatives and generate efficient, feasible routes adapted to multiple constraints.

Together, these techniques make it possible to build more intelligent optimisation systems, not because they replace reality with an abstract model, but because they can incorporate more information and turn it into better decisions.

With more than 25 years of experience working with genetic algorithms, machine learning and artificial intelligence in transport, Evolution Algorithms has developed an optimisation engine in LOGISPLAN designed to solve real, complex and constantly changing logistics problems.

AI in transport: how to combine genetic algorithms and machine learning to optimise routes | LOGISPLAN