Skip to main content

PxI4JSS

PxI4JSS automatically generates Ising models from Petri net models for Job Shop Scheduling (JSS) Problem.

Overview

By importing a Petri net model for JSS (Single Resource Type) created by CPN Tools, our software generates an Ising (QUBO) model for the JSS problem. After that, annealers for Ising (QUBO) models(e.g., PyQUBO Simulated Annealier) obtains solutions.

job4_exp

Why did we create this tool?

Quantum annealing has attracted attention as a new algorithm for solving combinatorial optimization problems. To use this method, we need to formulate the target combinatorial optimization problem as energy functions called the Ising (QUBO) model.

However, the formulation of the Ising model requires expertise and skills.

Our objective is to develop a method that makes it easy for non-specialists to formulate Ising (QUBO) Models for their target problems with domain knowledge only.

As an approach, we developed a method that first models the target problem with Petri nets and generates Ising (QUBO) models from them.

Petri nets are a graphical modeling language. Therefore, we can graphically model our target optimization problems with Petri nets without formulating equations.

Getting Started

Installing

% pip install pxi4jss

Usage

Please see above figure.

  1. Create Petri nets by CPN tools
  2. Export Petrinet as xml file
  3. Input xml file and generate Petri net objects by cpntools4py
  4. Generate and solve Ising models from Petri net objects by This package

Example

Example from reading XML to solving Ising model. In detail, notebook example here.

import pxi4jss
import cpntools4py

# Read petrinet created by CPN Tools
xml_path = './inputs/jss_job4.xml'
xml_doc = cpntools4py.read_xml(xml_path)
cpn = cpntools4py.CPN(xml_doc)
# To snakes objects
snakes_net = cpntools4py.to_snakes(cpn)
# Generating ising model and solving it
res = pxi4jss.main(snakes_net)

# Solution
print(res['solution']['energy'])
# => 0.0
print(res['solution']['end_time'])
# => 23
print(res['topology']['jobs']) # key: job, value: task
# =>
# {0: ['t0', 't1', 't2', 't3'],
#  1: ['t4', 't5', 't6', 't7'],
#  2: ['t8', 't9', 't10', 't11']}

Modeling a JSS instance by CPNTools

We can model JSS instances. The following figure shows an example with four jobs, four tasks per job, and one resource(machine) per each resource type.

jss_job4

Petri nets and JSS Mapping

jss_job4_colored

  • Transitions: Task

    • Fires when a machine processes a task and stops firing when it finishes.
    • The firing time is set for each task as processing time.
  • Place: Representation of system state and required resources.

    • It is divided into task place and resource place.
  • Task place: with a place token

    • Place token: Job processing status

      No need to configure in this package.

  • Resource place: with a resource place token

    • Resource place token: Machine actually used

Prerequisites

  • Python :: 3.x

    We have already confirmed the operation of version 3.7. Other versions are also expected to work, but we have not been able to confirm.

Versioning

We use pypi for versioning. For the versions available, see the tags on this repository.

Running the tests

% python3 -m unittest

References

Contributing

Welcome!

License

The source code is licensed MIT.

Metadata

Release files for pxi4jss 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pxi4jss 1.0
File Size Uploaded Provenance
pxi4jss-1.0.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pxi4jss 1.0
File Interpreter ABI Platform
pxi4jss-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / pxi4jss-1.0.tar.gz

Download URL pxi4jss-1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
694367dbe7ce2471679bf550115b5daa880d74737f2d3e8b04c86a7105025569
BLAKE2b-256 checksum
How to use checksums
59cf41398074d99724cdc0d8b92068828dc3d8ac32ac98546e3f17dc7915f58f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.2

Release files / pxi4jss-1.0-py3-none-any.whl

Download URL pxi4jss-1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38cc2921a1e3d58baa64e9fb492b54bdff26336172f41d682a39b944ea15986c
BLAKE2b-256 checksum
How to use checksums
ae3c42fefc773371d0486f33a257a4c7b63a67ddf689196ed95aca700ba6c8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.2

Security for pxi4jss 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page