Load Benchmark InstancesΒΆ

[1]:
from job_shop_lib.benchmarking import (
    load_all_benchmark_instances,
    load_benchmark_instance,
)

from job_shop_lib.constraint_programming import ORToolsSolver
from job_shop_lib.visualization import plot_gantt_chart, plot_disjunctive_graph
from job_shop_lib.graphs import build_disjunctive_graph
[2]:
benchmark_instances = load_all_benchmark_instances()
benchmark_instances
[2]:
{'abz5': JobShopInstance(name=abz5, num_jobs=10, num_machines=10),
 'abz6': JobShopInstance(name=abz6, num_jobs=10, num_machines=10),
 'abz7': JobShopInstance(name=abz7, num_jobs=20, num_machines=15),
 'abz8': JobShopInstance(name=abz8, num_jobs=20, num_machines=15),
 'abz9': JobShopInstance(name=abz9, num_jobs=20, num_machines=15),
 'ft06': JobShopInstance(name=ft06, num_jobs=6, num_machines=6),
 'ft10': JobShopInstance(name=ft10, num_jobs=10, num_machines=10),
 'ft20': JobShopInstance(name=ft20, num_jobs=20, num_machines=5),
 'la01': JobShopInstance(name=la01, num_jobs=10, num_machines=5),
 'la02': JobShopInstance(name=la02, num_jobs=10, num_machines=5),
 'la03': JobShopInstance(name=la03, num_jobs=10, num_machines=5),
 'la04': JobShopInstance(name=la04, num_jobs=10, num_machines=5),
 'la05': JobShopInstance(name=la05, num_jobs=10, num_machines=5),
 'la06': JobShopInstance(name=la06, num_jobs=15, num_machines=5),
 'la07': JobShopInstance(name=la07, num_jobs=15, num_machines=5),
 'la08': JobShopInstance(name=la08, num_jobs=15, num_machines=5),
 'la09': JobShopInstance(name=la09, num_jobs=15, num_machines=5),
 'la10': JobShopInstance(name=la10, num_jobs=15, num_machines=5),
 'la11': JobShopInstance(name=la11, num_jobs=20, num_machines=5),
 'la12': JobShopInstance(name=la12, num_jobs=20, num_machines=5),
 'la13': JobShopInstance(name=la13, num_jobs=20, num_machines=5),
 'la14': JobShopInstance(name=la14, num_jobs=20, num_machines=5),
 'la15': JobShopInstance(name=la15, num_jobs=20, num_machines=5),
 'la16': JobShopInstance(name=la16, num_jobs=10, num_machines=10),
 'la17': JobShopInstance(name=la17, num_jobs=10, num_machines=10),
 'la18': JobShopInstance(name=la18, num_jobs=10, num_machines=10),
 'la19': JobShopInstance(name=la19, num_jobs=10, num_machines=10),
 'la20': JobShopInstance(name=la20, num_jobs=10, num_machines=10),
 'la21': JobShopInstance(name=la21, num_jobs=15, num_machines=10),
 'la22': JobShopInstance(name=la22, num_jobs=15, num_machines=10),
 'la23': JobShopInstance(name=la23, num_jobs=15, num_machines=10),
 'la24': JobShopInstance(name=la24, num_jobs=15, num_machines=10),
 'la25': JobShopInstance(name=la25, num_jobs=15, num_machines=10),
 'la26': JobShopInstance(name=la26, num_jobs=20, num_machines=10),
 'la27': JobShopInstance(name=la27, num_jobs=20, num_machines=10),
 'la28': JobShopInstance(name=la28, num_jobs=20, num_machines=10),
 'la29': JobShopInstance(name=la29, num_jobs=20, num_machines=10),
 'la30': JobShopInstance(name=la30, num_jobs=20, num_machines=10),
 'la31': JobShopInstance(name=la31, num_jobs=30, num_machines=10),
 'la32': JobShopInstance(name=la32, num_jobs=30, num_machines=10),
 'la33': JobShopInstance(name=la33, num_jobs=30, num_machines=10),
 'la34': JobShopInstance(name=la34, num_jobs=30, num_machines=10),
 'la35': JobShopInstance(name=la35, num_jobs=30, num_machines=10),
 'la36': JobShopInstance(name=la36, num_jobs=15, num_machines=15),
 'la37': JobShopInstance(name=la37, num_jobs=15, num_machines=15),
 'la38': JobShopInstance(name=la38, num_jobs=15, num_machines=15),
 'la39': JobShopInstance(name=la39, num_jobs=15, num_machines=15),
 'la40': JobShopInstance(name=la40, num_jobs=15, num_machines=15),
 'orb01': JobShopInstance(name=orb01, num_jobs=10, num_machines=10),
 'orb02': JobShopInstance(name=orb02, num_jobs=10, num_machines=10),
 'orb03': JobShopInstance(name=orb03, num_jobs=10, num_machines=10),
 'orb04': JobShopInstance(name=orb04, num_jobs=10, num_machines=10),
 'orb05': JobShopInstance(name=orb05, num_jobs=10, num_machines=10),
 'orb06': JobShopInstance(name=orb06, num_jobs=10, num_machines=10),
 'orb07': JobShopInstance(name=orb07, num_jobs=10, num_machines=10),
 'orb08': JobShopInstance(name=orb08, num_jobs=10, num_machines=10),
 'orb09': JobShopInstance(name=orb09, num_jobs=10, num_machines=10),
 'orb10': JobShopInstance(name=orb10, num_jobs=10, num_machines=10),
 'swv01': JobShopInstance(name=swv01, num_jobs=20, num_machines=10),
 'swv02': JobShopInstance(name=swv02, num_jobs=20, num_machines=10),
 'swv03': JobShopInstance(name=swv03, num_jobs=20, num_machines=10),
 'swv04': JobShopInstance(name=swv04, num_jobs=20, num_machines=10),
 'swv05': JobShopInstance(name=swv05, num_jobs=20, num_machines=10),
 'swv06': JobShopInstance(name=swv06, num_jobs=20, num_machines=15),
 'swv07': JobShopInstance(name=swv07, num_jobs=20, num_machines=15),
 'swv08': JobShopInstance(name=swv08, num_jobs=20, num_machines=15),
 'swv09': JobShopInstance(name=swv09, num_jobs=20, num_machines=15),
 'swv10': JobShopInstance(name=swv10, num_jobs=20, num_machines=15),
 'swv11': JobShopInstance(name=swv11, num_jobs=50, num_machines=10),
 'swv12': JobShopInstance(name=swv12, num_jobs=50, num_machines=10),
 'swv13': JobShopInstance(name=swv13, num_jobs=50, num_machines=10),
 'swv14': JobShopInstance(name=swv14, num_jobs=50, num_machines=10),
 'swv15': JobShopInstance(name=swv15, num_jobs=50, num_machines=10),
 'swv16': JobShopInstance(name=swv16, num_jobs=50, num_machines=10),
 'swv17': JobShopInstance(name=swv17, num_jobs=50, num_machines=10),
 'swv18': JobShopInstance(name=swv18, num_jobs=50, num_machines=10),
 'swv19': JobShopInstance(name=swv19, num_jobs=50, num_machines=10),
 'swv20': JobShopInstance(name=swv20, num_jobs=50, num_machines=10),
 'yn1': JobShopInstance(name=yn1, num_jobs=20, num_machines=20),
 'yn2': JobShopInstance(name=yn2, num_jobs=20, num_machines=20),
 'yn3': JobShopInstance(name=yn3, num_jobs=20, num_machines=20),
 'yn4': JobShopInstance(name=yn4, num_jobs=20, num_machines=20),
 'ta01': JobShopInstance(name=ta01, num_jobs=15, num_machines=15),
 'ta02': JobShopInstance(name=ta02, num_jobs=15, num_machines=15),
 'ta03': JobShopInstance(name=ta03, num_jobs=15, num_machines=15),
 'ta04': JobShopInstance(name=ta04, num_jobs=15, num_machines=15),
 'ta05': JobShopInstance(name=ta05, num_jobs=15, num_machines=15),
 'ta06': JobShopInstance(name=ta06, num_jobs=15, num_machines=15),
 'ta07': JobShopInstance(name=ta07, num_jobs=15, num_machines=15),
 'ta08': JobShopInstance(name=ta08, num_jobs=15, num_machines=15),
 'ta09': JobShopInstance(name=ta09, num_jobs=15, num_machines=15),
 'ta10': JobShopInstance(name=ta10, num_jobs=15, num_machines=15),
 'ta11': JobShopInstance(name=ta11, num_jobs=20, num_machines=15),
 'ta12': JobShopInstance(name=ta12, num_jobs=20, num_machines=15),
 'ta13': JobShopInstance(name=ta13, num_jobs=20, num_machines=15),
 'ta14': JobShopInstance(name=ta14, num_jobs=20, num_machines=15),
 'ta15': JobShopInstance(name=ta15, num_jobs=20, num_machines=15),
 'ta16': JobShopInstance(name=ta16, num_jobs=20, num_machines=15),
 'ta17': JobShopInstance(name=ta17, num_jobs=20, num_machines=15),
 'ta18': JobShopInstance(name=ta18, num_jobs=20, num_machines=15),
 'ta19': JobShopInstance(name=ta19, num_jobs=20, num_machines=15),
 'ta20': JobShopInstance(name=ta20, num_jobs=20, num_machines=15),
 'ta21': JobShopInstance(name=ta21, num_jobs=20, num_machines=20),
 'ta22': JobShopInstance(name=ta22, num_jobs=20, num_machines=20),
 'ta23': JobShopInstance(name=ta23, num_jobs=20, num_machines=20),
 'ta24': JobShopInstance(name=ta24, num_jobs=20, num_machines=20),
 'ta25': JobShopInstance(name=ta25, num_jobs=20, num_machines=20),
 'ta26': JobShopInstance(name=ta26, num_jobs=20, num_machines=20),
 'ta27': JobShopInstance(name=ta27, num_jobs=20, num_machines=20),
 'ta28': JobShopInstance(name=ta28, num_jobs=20, num_machines=20),
 'ta29': JobShopInstance(name=ta29, num_jobs=20, num_machines=20),
 'ta30': JobShopInstance(name=ta30, num_jobs=20, num_machines=20),
 'ta31': JobShopInstance(name=ta31, num_jobs=30, num_machines=15),
 'ta32': JobShopInstance(name=ta32, num_jobs=30, num_machines=15),
 'ta33': JobShopInstance(name=ta33, num_jobs=30, num_machines=15),
 'ta34': JobShopInstance(name=ta34, num_jobs=30, num_machines=15),
 'ta35': JobShopInstance(name=ta35, num_jobs=30, num_machines=15),
 'ta36': JobShopInstance(name=ta36, num_jobs=30, num_machines=15),
 'ta37': JobShopInstance(name=ta37, num_jobs=30, num_machines=15),
 'ta38': JobShopInstance(name=ta38, num_jobs=30, num_machines=15),
 'ta39': JobShopInstance(name=ta39, num_jobs=30, num_machines=15),
 'ta40': JobShopInstance(name=ta40, num_jobs=30, num_machines=15),
 'ta41': JobShopInstance(name=ta41, num_jobs=30, num_machines=20),
 'ta42': JobShopInstance(name=ta42, num_jobs=30, num_machines=20),
 'ta43': JobShopInstance(name=ta43, num_jobs=30, num_machines=20),
 'ta44': JobShopInstance(name=ta44, num_jobs=30, num_machines=20),
 'ta45': JobShopInstance(name=ta45, num_jobs=30, num_machines=20),
 'ta46': JobShopInstance(name=ta46, num_jobs=30, num_machines=20),
 'ta47': JobShopInstance(name=ta47, num_jobs=30, num_machines=20),
 'ta48': JobShopInstance(name=ta48, num_jobs=30, num_machines=20),
 'ta49': JobShopInstance(name=ta49, num_jobs=30, num_machines=20),
 'ta50': JobShopInstance(name=ta50, num_jobs=30, num_machines=20),
 'ta51': JobShopInstance(name=ta51, num_jobs=50, num_machines=15),
 'ta52': JobShopInstance(name=ta52, num_jobs=50, num_machines=15),
 'ta53': JobShopInstance(name=ta53, num_jobs=50, num_machines=15),
 'ta54': JobShopInstance(name=ta54, num_jobs=50, num_machines=15),
 'ta55': JobShopInstance(name=ta55, num_jobs=50, num_machines=15),
 'ta56': JobShopInstance(name=ta56, num_jobs=50, num_machines=15),
 'ta57': JobShopInstance(name=ta57, num_jobs=50, num_machines=15),
 'ta58': JobShopInstance(name=ta58, num_jobs=50, num_machines=15),
 'ta59': JobShopInstance(name=ta59, num_jobs=50, num_machines=15),
 'ta60': JobShopInstance(name=ta60, num_jobs=50, num_machines=15),
 'ta61': JobShopInstance(name=ta61, num_jobs=50, num_machines=20),
 'ta62': JobShopInstance(name=ta62, num_jobs=50, num_machines=20),
 'ta63': JobShopInstance(name=ta63, num_jobs=50, num_machines=20),
 'ta64': JobShopInstance(name=ta64, num_jobs=50, num_machines=20),
 'ta65': JobShopInstance(name=ta65, num_jobs=50, num_machines=20),
 'ta66': JobShopInstance(name=ta66, num_jobs=50, num_machines=20),
 'ta67': JobShopInstance(name=ta67, num_jobs=50, num_machines=20),
 'ta68': JobShopInstance(name=ta68, num_jobs=50, num_machines=20),
 'ta69': JobShopInstance(name=ta69, num_jobs=50, num_machines=20),
 'ta70': JobShopInstance(name=ta70, num_jobs=50, num_machines=20),
 'ta71': JobShopInstance(name=ta71, num_jobs=100, num_machines=20),
 'ta72': JobShopInstance(name=ta72, num_jobs=100, num_machines=20),
 'ta73': JobShopInstance(name=ta73, num_jobs=100, num_machines=20),
 'ta74': JobShopInstance(name=ta74, num_jobs=100, num_machines=20),
 'ta75': JobShopInstance(name=ta75, num_jobs=100, num_machines=20),
 'ta76': JobShopInstance(name=ta76, num_jobs=100, num_machines=20),
 'ta77': JobShopInstance(name=ta77, num_jobs=100, num_machines=20),
 'ta78': JobShopInstance(name=ta78, num_jobs=100, num_machines=20),
 'ta79': JobShopInstance(name=ta79, num_jobs=100, num_machines=20),
 'ta80': JobShopInstance(name=ta80, num_jobs=100, num_machines=20)}
[3]:
ft06 = load_benchmark_instance("ft06")
solution = ORToolsSolver(max_time_in_seconds=10).solve(ft06)
fig, ax = plot_gantt_chart(solution)
../_images/examples_05-Load-Benchmark-Instances_3_0.png
[4]:
fig.savefig("ft06_solution.png", bbox_inches="tight")
[5]:
solution.makespan()
[5]:
55
[6]:
ft06.metadata
[6]:
{'optimum': 55,
 'upper_bound': 55,
 'lower_bound': 55,
 'reference': "J.F. Muth, G.L. Thompson. 'Industrial scheduling.', Englewood Cliffs, NJ, Prentice-Hall, 1963."}
[7]:
import numpy as np
np.array(ft06.durations_matrix)
[7]:
array([[ 1,  3,  6,  7,  3,  6],
       [ 8,  5, 10, 10, 10,  4],
       [ 5,  4,  8,  9,  1,  7],
       [ 5,  5,  5,  3,  8,  9],
       [ 9,  3,  5,  4,  3,  1],
       [ 3,  3,  9, 10,  4,  1]])
[8]:
disjunctive_graph = build_disjunctive_graph(ft06)
_ = plot_disjunctive_graph(disjunctive_graph, figsize=(8, 6))
../_images/examples_05-Load-Benchmark-Instances_8_0.png