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.
The main workflow of this project consists of:
- Generating JSSP Instances: Randomly creating job-shop scheduling problem instances with predefined parameters.
- Solving JSSP Instances: Using a simple scheduling solver to find a feasible schedule for each instance.
- Feature Extraction: Extracting 4 key features from the solved instances to form a dataset.
- Dataset Creation: Compiling the extracted features into a CSV file.
- Neural Network Analysis: Fitting a simple neural network, and enhancing with activation functions.
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.txtFollow these steps to generate random JSSP instances, extract features, and train models.
Run the script to generate JSSP instances:
python generate_instances.py -s=42 -j=20 -m=10 -n=10This script will create
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 10Run the script to extract the following features from the generated instances:
- ID: Instance identification
- F1: Minimum worktime by machine
- F2: Minimum worktime by job
- F3: Average worktime by machine
- F4: Average worktime by job
- M: Calculated instance makespan
python manual_features.py Run the script to train the simple neural network and plot the results:
python alternative_training.pyRun the script to train the activated neural network and plot the results:
python activation_training.pyThe 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.
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.