This case, developed within the framework of the European Horizon SM4RTENANCE project, addresses the integrated optimisation of a supply chain comprising a manufacturer and seller of different product codes, the customers who purchase them, and a supplier responsible for production. The aim is to improve the planning and management of flows among these players, optimising the times, costs and overall efficiency of the supply chain.
The aim is to provide a planning tool that enables the use of a customer order forecast to minimise delays, costs and emissions.
The forecast consists of a list of orders associated with a customer ID, nationality, requested product code, quantity, expected order date and delivery deadline established in accordance with company policies.
Starting from the main constraint of the problem – meeting the customer’s delivery deadlines – the optimisation process works backwards to the production of the product codes themselves.
The process is divided into three main phases: delivery, supply and production.
Delivery: delivery by the company to the customer.
Supply: procurement of products from the supplier to the company.
Production: in-house production by the supplier. Requests from the company are considered, along with other requests in the same period from other potential customers of the supplier.
The solution is divided into three integrated, sequential steps, each with specific models that interact via structured outputs.
- Step 1 — Delivery Optimisation
optimises the delivery methods and timing for each order, balancing delivery delays, costs and emissions. It uses a genetic algorithm (NSGA-II) for multi-objective optimisation taking into consideration reductions in cost and overall consumption for shipments that consolidate multiple orders sent to the same country. Suboptimal solutions are selected by means of pseudo-weights. - Step 2 — Supply Optimisation
plans supplier delivery scheduling to reduce the number of shipments and warehouse costs within the company. Here too, a genetic algorithm is used for optimisation, taking into account cost reductions for consolidated transport. - Step 3 — Production Simulation & Scheduling
simulates the production line and aligns it with inventory levels to fulfil orders in the set times. The simulated production process involves three parallel production lines that produce the base material (‘Plates’), the semi-finished product (‘Strips’) and the final product codes (‘Tapes’) respectively. It uses discrete-event simulation (DES) that takes into account production constraints (e.g. machine availability, work shifts) and inventory constraints (e.g. minimum quantities and capacity for each possible product code). Unlike the first two steps, it operates on an hourly time scale rather than a daily one.
References to the open-source Python libraries used and the algorithms implemented
- Multi-objective optimisation: pymoo.
- Genetic algorithm: NSGA-II
- Solution: Pseudo-Weights
- Discrete-event simulation and resource management: SimPy
- Data structures: Pandas
- Plotting and visualisation: matplotlib
The model developed enables the generation of specific schedules for the three stages of the supply chain in question. This translates into tables containing the start and completion dates of the shipments and transport operations associated with each order, and a JSON file containing the production start timestamps for each possible semi-finished product and finished product.

The figure below shows the result of the optimisation for the Delivery and Supply processes. Note that the optimisers tend to consolidate shipments to customers in the same country or transport operations that are close together in time.
