Module OptSeqExample
[hide private]
[frames] | no frames]

Module OptSeqExample

source code

Functions [hide private]
 
Example1()
Example 1 PERT file name: Example1.py Copyright Log Opt Co., Ltd.
source code
 
Example2()
Example 2 PERT with resource constraint file name: Example2.py Copyright Log Opt Co., Ltd.
source code
 
Example3()
Example 3 Parallel Shop Problem file name: Example3.py Copyright Log Opt Co., Ltd.
source code
 
Example4()
Example 4 Parallel Shop Problem using Modes file name: Example4.py Copyright Log Opt Co., Ltd.
source code
 
Example5()
Example 5 Resource Constrained Scheduling file name: Example5.py Copyright Log Opt Co., Ltd.
source code
 
Example6()
Example 6 Minimizing the Tardiness file name: Example6.py Copyright Log Opt Co., Ltd.
source code
 
Example7()
Example 7 CPM(critical path method) -- nonrenewable resource file name: Example7.py Copyright Log Opt Co., Ltd.
source code
 
Example8()
Example 8 Temporal Constraints file name: Example8.py Copyright Log Opt Co., Ltd.
source code
 
Example9()
Example 9 Breakable Activity file name: Example9.py Copyright Log Opt Co., Ltd.
source code
 
Example10()
Example 10 Parallel Execution file name: Example10.py Copyright Log Opt Co., Ltd.
source code
 
Example11()
A simple test problem for the Resource Constrained Scheduling Solver OptSeq file name: Example11.py Copyright Log Opt Co., Ltd.
source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

Example1()

source code 

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.

Example2()

source code 

Example 2
PERT with resource constraint
file name: Example2.py
Copyright Log Opt Co., Ltd.

Consider a 5-activity problem with precedence constraints between the activities.
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.
Each activity requires one unit of worker resource whose capacity (maximum amount of availability for each time period) is 1.
The objective is to find the maximum completion time (makespan) for all 5 activities

Example3()

source code 

Example 3
Parallel Shop Problem
file name: Example3.py
Copyright Log Opt Co., Ltd.

Consider a 10-activity problem in which each activity is processed on three identical parallel machines.
The processing times (durations) of the activities are kept in the dictionary
 duration ={1:3, 2:2, 3:2, 4:2, 5:4, 6:4, 7:4, 8:4, 9:11, 10:2 }.
Precedence constraints are given by:
 Activity 1 -> Activity 9;
 Activities 5,6,7,8 are processed after Activity 4 and before Activity 10.
The objective is to find the maximum completion time (makespan).

Example4()

source code 

Example 4
Parallel Shop Problem using Modes
file name: Example4.py
Copyright Log Opt Co., Ltd.

Consider a 10-activity problem in which each activity is processed on three identical parallel machines.
The processing times (durations) of the activities are kept in the dictionary
 duration ={1:3, 2:2, 3:2, 4:2, 5:4, 6:4, 7:4, 8:4, 9:11, 10:2 }.
Precedence constraints are given by:
 Activity 1 -> Activity 9;
 Activities 5,6,7,8 are processed after Activity 4 and before Activity 10.
Activity 1 can be processed in one of the following three modes:
 Mode 1 with duration 3 that requires 1 unit of worker resource,
 Mode 2 with duration 2 that requires 2 units of worker resource, and 
 Mode 3 with duration 1 that requires 3 units of worker resource.
The objective is to find the maximum completion time (makespan).

Example5()

source code 

Example 5
Resource Constrained Scheduling
file name: Example5.py
Copyright Log Opt Co., Ltd.

Consider a 4-activity problem with a resource whose capacity is 2 units on day 1, 2, 4, 5, 6, and 1 unit on day 3.
The processing times (durations) of the activities are kept in the dictionary
 duration ={1:1,2:3,3:2,4:2}.
Precedence constraints are give by:
 Activity 1 -> Activity 2;
 Activity 1 -> Activity 3;
 Activity 2 -> Activity 4.
Activity 1 requires 2 units of resource the first day.
Activity 2 requires 2 units of resource the first day and 1 unit on other days.
Activity 3 requires 1 unit of resource all the days.
Activity 4 requires 1 unit of the resource the first day and 2 units on the second day.
The objective is to find the maximum completion time (makespan).

Example6()

source code 

Example 6
Minimizing the Tardiness
file name: Example6.py
Copyright Log Opt Co., Ltd.

Consider a 4-activity problem with one machine resource.
The due dates and processing times (durations) of the activities are kept in the dictionaries
 due={1:5,2:9,3:6,4:4} and
 duration={1:1, 2:2, 3:3, 4:4 }, respectively.
We have to pay tardiness penalty by the amount the completion time of the activity exceeds its due date.
The objective is to find the schedule that minimizes total tardiness penalty cost.

Example7()

source code 

Example 7 CPM(critical path method) -- nonrenewable resource file name: Example7.py Copyright Log Opt Co., Ltd.

Consider the same scenario as in Example 1. Here, activities have a standard mode and an express mode whose durations are durationA = {1:13, 2:25, 3:15, 4:27, 5:22 } and durationB = {1:10, 2:20, 3:10, 4:25, 5:20 }, respectively. Express modes require additional costs; they can be processed at most 4. Find the makespan under the restriction.

Example8()

source code 

Example 8 Temporal Constraints file name: Example8.py Copyright Log Opt Co., Ltd.

Consider the same scenario as in Example 1. Here, we add an additional temporal constraint; Activity 3 and Activity 5 must be start simultaneously. Find the makespan under this new condition.

Example9()

source code 

Example 9 Breakable Activity file name: Example9.py Copyright Log Opt Co., Ltd.

Consider the same scenario as in Example 6. Here, Activities 2 and 3 can interrupt their processing and re-start after one unit of break time. Find the optimal schedule (minimum tardiness solution) under this new condition.

Example10()

source code 

Example 10 Parallel Execution file name: Example10.py Copyright Log Opt Co., Ltd.

Consider the same scenario as in Example 3. Here, Activity 1 can be processed in parallel up to 3 units. Find the optimal schedule under this new condition.

Example11()

source code 

A simple test problem for the Resource Constrained Scheduling Solver OptSeq
file name: Example11.py
Copyright Log Opt Co., Ltd.

Consider a small job shop problem consisting of 4 activities and 3 machines.
Each activity consists of three sub-jobs (operations).
Operation must be processed in the order of 1,2 and 3 on thecorresponding machines.
The machines to be processed and the processing time (days) are kept by the dictionary  
JobInfo={   (1,1):(1,7), (1,2):(2,10), (1,3):(3,4),
            (2,1):(3,9), (2,2):(1,5), (2,3):(2,11),
            (3,1):(1,3), (3,2):(3,9), (3,3):(2,12),
            (4,1):(2,6), (4,2):(3,13),(4,3):(1,9)
            }
that maps a tuple of activity ID and operation ID to a tuple of machine IDand processing time.
The objective is to minimize the latest completion time of activities (makespan).
We add the following practical conditions:
1. Each operation requires the worker resource for the first 2 days. The worker resource is available on weekdays only and its capacity(maximum number of operations to be executed in a day) is 2.
2. Each operation may have a break after 1 day.
3. Operations on machine 1 can be processed in parallel. 
4. Operations on machine 2 can be processed in an express mode whose processing time is 4 days. The express mode is restricted to be at most once in a whole. 
5. On machine 1, operation 2 must be executed just after operation 1.