Generative AI to optimise shipping

Shipping Optimisation with Generative AI: A Zartis Showcase

Shipping costs, delivery times, and carbon emissions are critical factors for companies managing large-scale logistics. The challenge lies in balancing these competing objectives—finding ways to minimise costs, improve delivery performance, and reduce environmental impact. Traditional approaches to solving this problem require expensive, time-consuming analyses by data science teams. Zartis sought to solve this complex business problem by leveraging Generative AI to rapidly prototype a solution that could optimise shipping operations more efficiently, giving companies better control over their logistics without the high costs and delays associated with conventional methods.

The entire exercise has been conducted by prompting on ChatGPT (GPT-4o) plus the Data Analyst plugin.

 

Outline of the Process

This is the process followed, involving data engineering, data analysis and data science tasks. Ultimately, the goal is to create a system that helps decision makers select the optimum carrier mix for each route, accounting for the trade-offs in cost, performance and carbon emissions,  based on historical and simulated data:

 

Phase 1: Preparing the Data

  1. Generation of Reference Data: Created rate cards (shipping prices) from actual carriers for multiple European locations.
  2. Generation of Historical Data: Simulated shipments between various locations with associated weights and prices.
  3. Data Augmentation with Carbon Emissions: Estimated carbon emissions for each shipment to incorporate environmental impact.

 

Phase 2: Data analysis

  1. Historical Data Analysis: Performed interactive querying and analysis using tables and graphs to understand past performance.
  2. Simulation of New Scenarios: Introduced new rate cards for additional carriers and applied them to historical data to branch out scenarios.
  3. Comparative Data Analysis: Analysed how carriers perform against each other in cost, delivery performance, and carbon footprint using Generative AI tools like ChatGPT and the Data Analyst plugin.

 

Phase 3: Optimisation

  1. Identification of Optimisation Objectives: Engaged with AI to confirm and explore optimisation goals such as cost, performance, and carbon emissions.
  2. Mathematical Modeling of Trade-offs: Requested AI to formulate an equation system representing the trade-offs between objectives.

 

Phase 4: Productisation

  1. Code Generation for Optimisation: Utilised AI to generate Python code to execute the mathematical models with our data.
  2. Estimation of Operational Costs: Assessed cloud computing costs (AWS) for running simulations and optimisations, finding them affordable even for large datasets.

 

Detailed Process and Insights

 

Phase 1: Preparing the Data

Generation of Reference Data

We began by creating realistic rate cards for multiple carriers—DHL, FedEx, and UPS—covering various European routes. These rate cards included:

  • Destination Countries: France, Germany, and the UK.
  • Weight Brackets: Different pricing based on shipment weights.
  • Additional Fees: Specific charges like special airport fees (to represent the actual complexity of rate cards).

Using Generative AI, we simulated these complex rate structures swiftly, providing a solid foundation for our analysis.

 

Generation of Historical Data

Next, we generated synthetic historical shipment data to mimic a company’s actual shipping records. This dataset included:

  • Origins and Destinations: Various cities within the specified countries.
  • Weights and Costs: Diverse shipment weights with associated costs based on the rate cards.
  • Carriers Used: Primarily FedEx and UPS, reflecting a realistic carrier mix.

This synthetic data allowed us to work with a realistic scenario without the need for confidential client data.

 

Data Augmentation with Carbon Emissions

To incorporate environmental considerations, we estimated carbon emissions for each shipment by:

  • Calculating Distances: Determining the distance between origin and destination cities.
  • Modes of Transport: Assigning transport modes (air, road, or train) based on typical carrier operations.
  • Emission Factors: Applying standard emission factors to calculate CO₂ emissions per shipment.

This step enriched our dataset, enabling multi-dimensional analysis involving sustainability metrics.

 

Phase 2: Data analysis

 

Historical Data Analysis

With our comprehensive dataset, we conducted interactive querying and analysis using Generative AI tools:

  • Tables and Graphs: Visualised data to identify trends and patterns.
  • Performance Metrics: Assessed costs, delivery times, and previous emissions estimates. .
  • AI Assistance: Used ChatGPT and the Data Analyst plugin to expedite data exploration and gain insights.

This analysis provided a baseline understanding of the company’s shipping performance.

 

Simulation of New Scenarios

We introduced new rate cards for additional carriers (e.g., adding DHL) and applied them to historical shipment data to simulate alternative scenarios:

  • Scenario Branching: Created what-if scenarios to see how changes in carrier selection could impact costs and performance.
  • Data Integration: Merged new rate information seamlessly with existing historical data using AI-driven methods.

This step enabled us to explore potential improvements without real-world risks or expenses.

 

Comparative Data Analysis

Using the simulated scenarios, we performed comparative analysis to evaluate carriers on:

  • Cost Efficiency: Identified which carriers offered the lowest rates for specific routes and weights.
  • Delivery Performance: Compared average delivery times across carriers and routes.
  • Carbon Footprint: Assessed emissions associated with each carrier, considering their typical modes of transport.

Generative AI facilitated this complex analysis, allowing for rapid interpretation and visualisation of results.

 

Phase 3: Optimisation

 

Identification of Optimisation Objectives

We engaged in a dialogue with ChatGPT to confirm and refine our optimisation objectives:

  • Cost Reduction: Aimed to minimise shipping expenses without compromising service quality.
  • Performance Enhancement: Sought to reduce delivery times to improve customer satisfaction.
  • Sustainability Goals: Considered carbon emissions to align with environmental commitments.

AI provided valuable examples and insights, ensuring our objectives were well-defined and aligned with business priorities.

 

Mathematical Modeling of Trade-offs

We requested Generative AI to formulate mathematical models representing the trade-offs between our objectives:

  • Equation Systems: Developed equations to balance cost, delivery time, and emissions.
  • Multi-Objective Optimisation: Created models that could handle multiple, sometimes conflicting goals.
  • Solid Foundations: Ensured the mathematical models were robust and suitable for practical application.

This mathematical framework was crucial for developing an effective optimisation strategy.

 

Phase 4: Productisation

 

Code Generation for Optimisation

Leveraging AI, we generated Python code to execute the mathematical models:

  • Algorithm Implementation: Translated mathematical models into executable code.
  • Data Integration: Ensured the code could process our reference, historical, and simulated data.
  • Efficiency: Developed optimised code to handle large datasets efficiently.

This step transformed theoretical models into practical tools for decision-making.

 

Estimation of Operational Costs

Finally, we assessed the cloud computing costs for running our simulations and optimisations:

  • Infrastructure Selection: Chose AWS EC2 T2 small instances for cost-effectiveness.
  • Performance Testing: Estimated response times and resource utilisation for datasets with thousands of records.
  • Cost Analysis: Found that the operational costs were minimal, making the solution scalable and affordable.

This cost assessment confirmed the feasibility of deploying the solution in a production environment.

 

Benefits of using GenAI for Optimisation

 

  • Accelerated Proof of Concept and Solution Validation

Generative AI significantly reduced development time. Tasks that typically require weeks of effort from specialised teams were accomplished in days, thanks to AI-driven automation and assistance.

 

  • Cost Efficiency

By automating data generation, analysis, and code development, we minimised resource requirements, leading to substantial cost savings in both development and operational phases.

 

  • Enhanced Technical Decision-Making

The ability to generate code and estimate operating cloud costs quickly allowed for more informed technical choices when it comes to the actual implementation of the solution.

 

  • Competitive Advantage

Our AI-powered approach enabled us to deliver a sophisticated product faster than traditional methods would allow. This positions Zartis as a leader in innovative solutions within the logistics sector.

 

Conclusion

Our research project demonstrates the transformative potential of Generative AI in solving complex industry problems. By following a structured process—from data generation to optimisation—we developed a powerful shipping optimisation tool rapidly and cost-effectively.

This approach not only accelerates product development but also enhances the quality of solutions by incorporating comprehensive data analysis and advanced modelling. As companies continue to face multifaceted challenges in global shipping, AI-driven methodologies like ours will be essential for achieving operational excellence and meeting sustainability goals.

 

The Author: Aurelio Sanchiz, Product Consultant at Zartis

Aurelio has held various leadership roles in product and technology, with extensive experience consulting with startups, building greenfield products, and quickly launching prototypes. His expertise spans logistics, supply chain, data, and marketplace sectors.

Share this post

Do you have any questions?

Zartis Tech Review

Your monthly source for AI and software news