Fonterra

Fonterra: Creating Optimal Product Mixes for Each Day's Unique Dairy Supply

Fonterra optimizes daily product mixes to make the best use of variable milk composition, managing 30% of global dairy exports.

Fonterra
Image
Fonterra

Title

Gurobi + Fonterra

Industry

Agriculture

Region

Australia / New Zealand


Introduction

As a dairy co-operative owned by roughly 9,000 farmers, Fonterra is committed to sustainable farming practices. But being responsible for 30% of the world’s dairy exports while also trying to do right by the environment comes with its own set of challenges, particularly when it comes to planning.

“The dairy industry is almost like the petroleum industry in that you have a ‘natural’ product with a composition you can’t control, and you have to make choices about how to make best use of the components,” explained Geoff Leyland, Principal Data Scientist and Head of the Advanced Analytics team at Fonterra.

“Milk composition changes every day, and if one day the milk has more fat than you forecast, you might end up making more butter than you originally planned,” he explained.

Because milk is highly perishable, it must be processed within twenty-four hours. And Fonterra’s hardest constraint is that they must process all of the milk in this timeframe.

“That’s one of the big challenges of working with a natural product,” said Leyland. “We forecast as best we can, but on the day, we don’t know exactly how much milk of exactly what composition we will collect, and so we need robust and flexible plans.”


0x

Faster solves than CPLEX and Xpress

0x

Faster solves than CPLEX and Xpress

0x

Faster solves than CPLEX and Xpress


The Problem

In an effort to address some of those planning problems, Leyland says many teams were using spreadsheets. Also, while they have also used a large-scale product mix model for the last ten years, it no longer suits many of their needs.

“It has become clear that we need to go back to the drawing board and fix things at the foundational level,” Leyland noted. “When we were asked to start working on some of the thornier planning problems, that’s where Gurobi really managed to do some magic for us.”

With many different teams using their own siloed spreadsheets—from schedulers to transport teams and manufacturers—Fonterra needed mathematical optimization to help them effectively plan production and make the best use of natural resources, especially when it came to planning for organic milk, which carries a higher value.

“Organic planning is best solved as an integer programming (IP) problem, and we were working that at the time with the open-source CBC solver, but it couldn’t solve the organics problem,” Leyland explained. “We also tried Xpress and CPLEX, and we found that not only is Gurobi faster, but it always finds a solution, which we couldn’t get the other solvers to do reliably.”

Whereas teams were previously juggling many different tools and files, Fonterra now only needs to complete one solve. They also have a Power BI dashboard with a page for every team, so everyone can look at the same problem.


The Solution

In an effort to address some of those planning problems, Leyland says many teams were using spreadsheets. Also, while they have also used a large-scale product mix model for the last ten years, it no longer suits many of their needs.

“It has become clear that we need to go back to the drawing board and fix things at the foundational level,” Leyland noted. “When we were asked to start working on some of the thornier planning problems, that’s where Gurobi really managed to do some magic for us.”

With many different teams using their own siloed spreadsheets—from schedulers to transport teams and manufacturers—Fonterra needed mathematical optimization to help them effectively plan production and make the best use of natural resources, especially when it came to planning for organic milk, which carries a higher value.

“Organic planning is best solved as an integer programming (IP) problem, and we were working that at the time with the open-source CBC solver, but it couldn’t solve the organics problem,” Leyland explained. “We also tried Xpress and CPLEX, and we found that not only is Gurobi faster, but it always finds a solution, which we couldn’t get the other solvers to do reliably.”

Whereas teams were previously juggling many different tools and files, Fonterra now only needs to complete one solve. They also have a Power BI dashboard with a page for every team, so everyone can look at the same problem.

"When we talk to Gurobi, we get smarter. They can solve problems that other solvers can’t, and we can move forward with confidence, knowing that we won’t get stuck.”

Geoff Leyland, Principal Data Scientist and Head of Advanced Analytics, Fonterra

"When we talk to Gurobi, we get smarter. They can solve problems that other solvers can’t, and we can move forward with confidence, knowing that we won’t get stuck.”

Geoff Leyland, Principal Data Scientist and Head of Advanced Analytics, Fonterra

"When we talk to Gurobi, we get smarter. They can solve problems that other solvers can’t, and we can move forward with confidence, knowing that we won’t get stuck.”

Geoff Leyland, Principal Data Scientist and Head of Advanced Analytics, Fonterra


Results

Initially, the goal for Leyland and the Advanced Analytics team was to solve the problem just for the organic planner. But once word got around about what they were able to achieve with their new model and help from Gurobi, more teams wanted to make the model work for them by simply adding on their constraints.

“We were able to solve the organics problem for all the teams involved in the process.  Now, teams from other parts of the business are coming to us with planning problems—and we’ve built models with Gurobi for problems in all sorts of corners.  The models can be very informative–in some cases, we’ve also been able to answer questions that people have been asking for years,” said Leyland.

Gurobi also made suggestions to fine-tune a production planning LP model, which brought solve times down from 20-40 minutes to roughly one minute.

“The support from Gurobi has exceeded our expectations,” Leyland said. “We don’t need to understand how Gurobi works, but we do need to understand how our model works—and when we talk to Gurobi, we get smarter. They can solve problems that other solvers can’t, and we can move forward with confidence, knowing that we won’t get stuck.”

Case Studies

Lectus porta aliquet ultricies placerat semper cras urna mi tristique convallis arcu lacus rhoncus gravida aliquet.

01 OF 00

Case Studies

Lectus porta aliquet ultricies placerat semper cras urna mi tristique convallis arcu lacus rhoncus gravida aliquet.

01 OF 00

Case Studies

Lectus porta aliquet ultricies placerat semper cras urna mi tristique convallis arcu lacus rhoncus gravida aliquet.

01 OF 00

Start solving with Gurobi

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend fermentum.

Start solving with Gurobi

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend fermentum.

Start solving with Gurobi

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend fermentum.