Skip to main content

OptSeq is a general-purpose scheduling optimization solver specialized for scheduling optimization.

Project description

OptSeq

OptSeq is a general-purpose scheduling optimization solver specialized for scheduling optimization.

How to Install to Jupyter Notebook (JupyterLab) and/or Google Colaboratory

Install

pip install "optseq[all]"

How to use

See https://github.com/moai-lab-jp/optseq and https://www.logopt.com/optseq/

Here is an example.

"""
Example 1
PERT
file name: Example1.py
Copyright Log Opt Co., Ltd.

Consider a 5-activity problem with precedence constraints between the activities.
Such a problem is called PERT (Program Evaluation and Review Technique).
The processing times (durations) of the activities are kept in the dictionary
 duration ={1:13, 2:25, 3:15, 4:27, 5:22 }.
Precedence constraints are given by:
 Activity 1 -> Activity 3; Activity 2 -> Activity 4;
 Activity 3 -> Activity 4; and Activity 3 -> Activity 5.
The objective is to find the maximum completion time (makespan) for all 5 activities.
"""
from optseq import Mode, Model

model = Model()
durations = {1: 13, 2: 25, 3: 15, 4: 27, 5: 22}
act = {}
mode = {}
for i, duration in durations.items():
    act[i] = model.addActivity(f"Act[{i}]")
    mode[i] = Mode(f"Mode[{i}]", duration)
    act[i].addModes(mode[i])

# temporal (precedent) constraints
model.addTemporal(act[1], act[3])
model.addTemporal(act[2], act[4])
model.addTemporal(act[2], act[5])
model.addTemporal(act[3], act[4])

model.Params.TimeLimit = 1
model.Params.OutputFlag = True
model.Params.Makespan = True
model.optimize()
 ================ Now solving the problem ================ 


Solutions:
    source   ---     0     0
      sink   ---    55    55
    Act[1]   ---     0    13
    Act[2]   ---     0    25
    Act[3]   ---    13    28
    Act[4]   ---    28    55
    Act[5]   ---    25    47

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optseq-0.1.6-py3-none-any.whl (358.9 kB view details)

Uploaded Python 3

File details

Details for the file optseq-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: optseq-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 358.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for optseq-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 91be530f4f16fb2a48db3f962cb526d80fca847e552a111a20eaea989435c84c
MD5 ab9a3a84cef5f48e7ddd396cf49e3925
BLAKE2b-256 d83094eda2685cb6d75326df82395649dcb8d1a91fef07abdcd43cac4fb77d95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page