Exact Solver

The function jsp_instance_utils.jsp_or_tools_solver() is an exact solver for JSP instances that takes JSP instances in the format of this library. The function uses the Google OR-Tools library to solve the instances and is based on this example from the OR-Tools documentation.

jsp_instance_utils.jsp_or_tools_solver.solve_jsp(jsp_instance: ~numpy.ndarray, plot_results: bool = True) -> (<class 'float'>, <class 'str'>, <class 'pandas.core.frame.DataFrame'>, <class 'dict'>)
Parameters:
  • jsp_instance

    the jsp instance to solve. The jsp instance is a numpy array with the following structure: np.array([

    [

    [0, 1, 2, 3], # job 0

    [0, 2, 1, 3] # job 1

    ], [

    [11, 3, 3, 12], # task durations of job 0

    [5, 16, 7, 4] # task durations of job 1

    ]

    ], dtype=np.int32)

  • plot_results – if True, the results will be plotted in a gantt chart to the console.

Returns:

the makespan, the status of the solver, the gantt chart as pandas dataframe and additional information form the solver (or-tools cp solver).