Solve Optimization Problems on Google Cloud Platform using Google’s OR API and OR-tools MathOpt

Ebrahim Pichka
7 min readSep 29, 2024

A quick guide to implementing and solving mathematical optimization models using Google Cloud Platform (GCP) with OR-tools MathOpt interface and OR API endpoints in Python.

[source]

Introduction

Operations Research and Mathematical Optimization practitioners and developers often face challenges when dealing with large-scale or even medium-sized optimization problems on their local machines, such as hardware and resource constraints, dependency management, etc.

Google’s new OR API, part of the OR-tools suite, offers a solution by allowing users to solve linear, mixed-integer, and quadratic programming problems on remote cloud services of GCP. This way we can use Google’s computing infrastructure to handle solving complex models that might be impractical to solve on a single machine due to memory or time constraints.

In this post, we’ll explore how to use this API to formulate and solve optimization problems, focusing on its integration with OR-Tools, Google’s open-source software suite for optimization. We’ll cover the basics of problem formulation, discuss the supported solvers like GLOP, PDLP, and SCIP, and walk through the process of sending models to the cloud service for resolution.

--

--

Ebrahim Pichka

Engineering Graduate Student & Research Assistant, interested in ML, and Optimization. https://epichka.com/