Skip to content

Python repository to generate and solve job-shop scheduling problems, extract features, and build datasets, enabling neural network model training for makespan prediction.

License

Notifications You must be signed in to change notification settings

Subramanyam-Lab/JSSP-NN

Repository files navigation

JSSP-NN

This repository contains code for generating simple instances of the Job-Shop Scheduling Problem (JSSP), solving them, extracting relevant features, and creating a dataset. This dataset is then used as input for several neural network models, including a linear regression neural network, to predict the makespan of the scheduling instances.

Overview

The main workflow of this project consists of:

  1. Generating JSSP Instances: Randomly creating job-shop scheduling problem instances with predefined parameters.
  2. Solving JSSP Instances: Using a simple scheduling solver to find a feasible schedule for each instance.
  3. Feature Extraction: Extracting 4 key features from the solved instances to form a dataset.
  4. Dataset Creation: Compiling the extracted features into a CSV file.
  5. Neural Network Analysis: Fitting a simple neural network, and enhancing with activation functions.

Installation

To get started, clone the repository and install the required dependencies:

git clone https://github.com/Subramanyam-Lab/JSSP-NN.git
cd JSSP-NN
pip install -r requirements.txt

Usage

Follow these steps to generate random JSSP instances, extract features, and train models.

Step 1: Generate JSSP Instances

Run the script to generate JSSP instances:

python generate_instances.py -s=42 -j=20 -m=10 -n=10

This script will create $10$ instances ($n$) of type $10X20$ where $10$ is the number of machines ($m$) & $20$ is the number of jobs ($j$).

Step 2: Solve JSSP Instances

Make a copy of 'instances' directory once instances have been generated and rename as 'solutions'. Run the script to solve generated instances:

cp -r instances solutions

python generate_solution.py solutions/10X20 20 10

Step 3: Extract features to complied dataset

Run the script to extract the following features from the generated instances:

  1. ID: Instance identification
  2. F1: Minimum worktime by machine
  3. F2: Minimum worktime by job
  4. F3: Average worktime by machine
  5. F4: Average worktime by job
  6. M: Calculated instance makespan
python manual_features.py 

Step 4: Train Simple Neural Network Models

Run the script to train the simple neural network and plot the results:

python alternative_training.py

Step 5: Train Activated Neural Network Models

Run the script to train the activated neural network and plot the results:

python activation_training.py

Results

The following summarizes the performance of the models:

  • Linear Regression:

    • Achieved high accuracy on both training and testing datasets.
    • Raised questions for need of neural network
  • Neural Network (Simulating Linear Regression):

    • Replicated the performance of the linear regression model.
    • Validated that the neural network can simulate linear regression without activation functions.
  • Neural Network (With Activation Function):

    • Improved predictive performance by capturing non-linear relationships in an insignificant manner.

The detailed metrics and evaluation plots are available in the results/ directory.

Next Steps

Planned future improvements for the project include:

  • Developing separate models tailored for specific types of JSSP instances to enhance prediction accuracy.
  • Embedding models in schedule creator to generate industry-applicable schedules as outputs.
  • Analyzing improvement opportunitities that arise upon creation of independent models.
  • Experimenting with deeper neural network architectures and different activation functions to further capture complex patterns in the data if necessary.

These enhancements aim to refine the model's predictive performance and scalability across diverse JSSP scenarios by developing tailored models for specific JSSP instances, embedding them into the schedule creator for industry-ready outputs, analyzing improvement opportunities from independent models, and experimenting with advanced neural network architectures and activation functions to capture complex data patterns.

About

Python repository to generate and solve job-shop scheduling problems, extract features, and build datasets, enabling neural network model training for makespan prediction.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages