{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Scheduling Problems\n",
"\n",
"本章ではいくつかの典型的スケジューリング問題の例とその定式化について扱います。\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from amplify_sched import *\n",
"\n",
"token = \"xxxxxxxxxxxxxxxxxxxxxxxxx\""
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Flow Shop Scheduling\n",
"\n",
"Flow Shop Scheduling はスケジューリング問題の一種で以下のように定義されます\n",
"\n",
"**定義**\n",
"\n",
"- m 台の Machine(M_1, M_2, ..., M_m)で n 個の Job(J_1, J_2, ..., J_n)を処理する\n",
"- 各 Job は m 台すべての Machine を$M_1$から順に処理し、これらの Machine の処理順序はすべての Job で同一である\n",
"- 各 Job の各 Machine における処理時間はそれぞれ与えられる\n",
"- このとき与えられた評価尺度を最適にするような Job の処理順序を求める問題\n",
"\n",
"### 定式化例\n",
"\n",
"下記の Flow Shop Scheduling の定式化とメイクスパンの最適化を Amplify Sched で行います。\n",
"\n",
"| Job name | Process | Machine name | Processing Time |\n",
"| -------- | ------- | ------------ | --------------- |\n",
"| J1 | 0 | M1 | 10 |\n",
"| J1 | 1 | M2 | 15 |\n",
"| J1 | 2 | M3 | 20 |\n",
"| J2 | 0 | M1 | 15 |\n",
"| J2 | 1 | M2 | 20 |\n",
"| J2 | 2 | M3 | 10 |\n",
"| J3 | 0 | M1 | 10 |\n",
"| J3 | 1 | M2 | 20 |\n",
"| J3 | 2 | M3 | 15 |\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"base": [
0,
10,
25
],
"customdata": [
[
"J1",
0
],
[
"J1",
1
],
[
"J1",
2
]
],
"hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}