Skip to content

Latest commit

 

History

History
 
 

job-shop-scheduling

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
page_type languages author ms.author ms.date products description urlFragment
sample
python
anraman
01/25/2021
azure-quantum
azure-qio
Solve a job shop scheduling problem using the Azure Quantum optimization service
azure-quantum.job-shop-problem

Scheduling jobs with the Azure Quantum optimization service

Introduction

This sample provides a comprehensive walkthrough of the job shop scheduling problem, from problem definition to formulation of penalty functions and finally solving the problem using the Azure Quantum Optimization Service.

By working through this sample, you will learn:

  • What the job shop scheduling problem is and why it is important
  • How to represent problem terms mathematically
  • How to build penalty functions to represent problem constraints
  • How to build an objective function to minimize the makespan
  • How to transform these mathematical functions into code using the Azure Quantum Optimization Python SDK
  • How to submit problem terms to Azure Quantum
  • How to interpret the results
  • How to validate the results
  • How to tune the solver parameters

Prerequisites

  1. Create an Azure Quantum Workspace
  2. Install the azure-quantum Python module
  3. (If you want to run the Jupyter notebook) Install Jupyter Notebook
  4. (Optional) Run the basic ship loading sample

Running the sample

There are two ways to run the sample:

Running the Jupyter Notebook

To run this sample, use the commandline to navigate to the job-shop-sample folder and run jupyter notebook

Your web browser should automatically open a new window showing something similar to the below:

Jupyter Notebook landing page

If this doesn't happen, copy the localhost link shown in the terminal window and paste it into your browser's address bar.

Once you see the page above, simply click on the job-shop-sample.ipynb link to open the sample notebook.

Running the Python script

  • Open up the job-shop-sample.py script using your favorite IDE or a text editor.
  • Fill in your Azure Quantum workspace details at the beginning of the script.
  • Run the script through your IDE or use the commandline to navigate to the job-shop-sample folder and then run python ./job-shop-sample.py or python3 ./job-shop-sample.py (depending on how your environment is set up).

Manifest