Ottimizare Chemical Supply Chain Optimization.
Ottimizare is an optimization solution for chemical supply chains that solves two NP-problems: resource allocation and vehicle routing, using a hybrid Genetic Algorithm and Greedy Search approach, while managing hazardous goods constraints and minimizing transportation costs.
- Java
- Spring
Angular
- MySQL

Overview
Ottimizare is an optimization engine designed for the chemical supply chain, combining Genetic Algorithm and Greedy Search to address two complex NP-problems simultaneously: resource allocation and the vehicle routing problem (VRP).
The solution determines the optimal subset of orders to fulfil, accounting for constraints specific to the chemical industry: limited vehicles, storage capacity, hazardous goods compatibility, and minimizing overall transportation costs.
Standard VRP solvers assume all goods can be loaded together. In chemical logistics, that assumption breaks immediately. Hazardous goods compatibility adds a constraint layer that is not just combinatorial but chemical; certain substances cannot travel together regardless of available capacity. Ottimizare's fitness evaluation is built around this reality.
Resource Allocation
Resource allocation in transportation management is a complex combinatorial problem with multiple, sometimes conflicting objectives. The objective is to identify an optimal set of orders on = {x1, x2, ..., xn} that maximizes the fitness value while adhering to all constraints.
In the chemical industry, this complexity is amplified by the nature of the goods themselves. Hazardous materials introduce compatibility constraints that go beyond standard capacity limits. Chemical compatibility is the primary bottleneck.
Decision Variables
Decision variables, often referred as controllable variables, determine the best set of orders to be served by each vehicle.
| Symbol | Description |
|---|---|
| ov | Set of orders / order matrix to be delivered by vehicle V. |
| vn | Total number of available vehicles. |
| ki | Type of delivery for node i: drums-oriented or bags-oriented. |
| dij | Distance between node i and node j. |
| mi | Demand at node i. |
| pv | Allowed number of drums for vehicle V. |
| qv | Allowed number of bags for vehicle V. |
Among these, pv and qv are the most critical: they directly influence the chromosome structure in the Genetic Algorithm.
In chemical goods transportation, vehicles either handles bags or liquid drums depending on their capacity and type. The variable ki determines the delivery type: drum-oriented (solely drums) or bags-oriented (solely bags).
The algorithm assumes a 20-ft GP (General Purpose) container as the standard vehicle, adaptable to other configurations where needed. Two delivery types are supported, each with distinct sizing constraints:
- Pallet Pattern: 4 drums per pallet (standard 2×2 arrangement on a 1200×800 mm Euro pallet)
Up to 80 drums per container.
Total Drums: 20 pallets × 4 = 80 drums.
Ex. Payload: 80 × 200 kg = 16 tonnes.
Common capacities: 200kg, 230kg, 250kg.
Pallet Pattern: 32 bags of 25 kg per pallet (typically 8 layers of 4 bags, or similar stable stack)
Up to 640 bags, per container → 20 pallets × 32 = 640 bags.
- Ex. Payload 640 × 25 kg = 16 tonnes
Common sizes: 25kg, 50kg, 100kg.
Fitness Evaluation
Each generated chromosome is evaluated against three primary constraints. Any chromosome that violates them is either discarded or ranked at the bare minimum and never propagates into the next generation.
- C1
The allowed number of drums must not be exceeded for vehicle V.
- C2
The allowed number of bags must not be exceeded for vehicle V.
- C3
No dangerously reactive combinations. Chemicals loaded together must be compatible according to established safety guidelines
C1 and C2 are straightforward capacity checks. C3 is where the real complexity lives. The compatibility guidance was sourced from the American Institute of Chemical Engineers (AIChE), 2008.
Chemical compatibility is not a clean group-to-group mapping. Consider two cases: Crotonaldehyde belongs to Group XIX (aldehydes) and is incompatible with Group I, even though most Group XIX chemicals are compatible with Group I. Conversely, Butyl Alcohol belongs to Group XX, which is generally incompatible with Group V (caustics), yet it is compatible with Caustic Soda at 50% or less.
A group that is incompatible with another group may still be compatible with specific chemicals within it, and vice versa. The algorithm resolves these exceptions at the individual chemical level, not just the group level.
How it works
Ottimizare operates in two sequential phases, each solving a distinct part of the overall logistics problem.
The Genetic Algorithm identifies the optimal subset of orders to fulfil, evaluating each candidate set against the three fitness constraints (drum capacity, bag capacity, chemical compatibility) and then ranking the chromosomes by fitness value.
The Greedy Search determines the best delivery route across the selected orders, minimising total distance travelled and costs incurred across all vehicles.
The technical write-up for this project is available on: Time Series and Heuristic Application in Chemical Supply Chain. The chemical compatibility matrix was the most challenging aspect of the implementation, not computationally, but logically. Group-level rules with chemical-level exceptions require a proper lookup strategy.
Bottom Line
Ottimizare uses a two-phase approach: the Genetic Algorithm first determines the optimal combination of orders per vehicle, then Greedy Search performs route optimisation across the selected set.
Results are displayed as: the best selected order matrix (categorized for both drums and bags), alongside total order value, total distance, and the full route sequence. For example: Warehouse 1 → Durgan LLC (19 km) → Anderson Inc (27 km) → ...
Chemical compatibility is a first-class constraint, not a post-processing check; incompatible combinations are evaluated and discarded at the chromosome level.
Handles the full complexity of chemical logistics: vehicle capacity, hazardous goods, storage constraints, and transportation cost minimisation in a single coherent solution.
A look at the interface





