Giter Site home page Giter Site logo

eugeneyuchunlin / job-shop-scheduling Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 4.0 186 KB

This is a program to solve the job shop scheduling problem by using the parallel genetic algorithm

License: Apache License 2.0

CMake 2.64% C 20.90% C++ 25.32% Cuda 49.99% Python 1.15%
job-shop-scheduling-problem parallel-computing genetic-algorithm cuda

job-shop-scheduling's Introduction

Job Shop Problem

quality score

Problem description

In the semiconductor manufacture process, jobs are assigned to resource in particular time. The lot information is shown below.

Algorithm

The genetic algorithm is employed to solve the problem. In the program, list_ele_t is a structure type used to perfrom doubly linked list. job_t is a structure type used to store the information related to a lot. job_base_t is also a structure type embeded in job_t. job_base_t is used to store key information of a job. job_t is extension of job_base_t. list_ele_t is also embeded in job_t.

typedef struct job_t{
    job_base_t base;
    list_ele_t list;
    ...
}job_t;

The information of machine is store in machine_t in the program. The machine_base_t is used to store the key information of machine embeded in machine_t. machine_t is extension of machine_base_t.

typedef struct machine_t{
    machine_base_t base;
    ...
}machine_t;

In the genetic algorithm, the chromosome is represented as a solution. The main idea of algorithm used in the program is decoding the chromosomes in parallel. The data parallelism is significant in parallel computing without using a mutex. In the program, jobs is a variable whose type is a pointer to a pointer to job_t . The variable jobs points to a device memory where the elements point to another device memory where the element is an instance of job_t. The data structure is shown below. In the CUDA kernel function, the x dimension is subject to the number of chromosomes and y dimension is subject to the number of jobs. In the CUDA kernel, x is equal to threadIdx.x + blockIdx.x * blockDim.x and y is equal to threadIdx.y + blockIdx.y * blockDim.y. Each job in the memory occupies a thread to do machine selection. The machine of job is determined by gene in the chromosome.

After machine selection, each machine has a bunch of jobs. The relation between jobs and machine is maintained by doubly linked list. The sorting algorithm used to sort the jobs by gene's value is merge sort. In the CUDA kernel, x dimension is subject to the number of chromosomes and y dimension is subject to the number of machines. Each machine occupies a thread to sort the jobs in parallel. The data structure and dimension of CUDA kernel is shown below.

The genetic algoritm runs with multi-population. The POSIX threads are in charge of an evolution of a population. The topology of migration between populations is directed and circular. The migration topology is shown below. Each circle is represented as a population.

Experiment

Environment

  • CPU : intel core i5-9400
  • GPU : NVIDIA 2060 Super 8GB
  • MB : H370-f
  • Memory : 32 GB
  • OS : Ubuntu 20.04
  • CUDA version : 11.1
  • Programming language : C++ 11

Build

mkdir build
cd build
cmake -D CUDA_TOOLKIT_ROOT_DIR=<> .. 
make

Execution

./main ../files/

job-shop-scheduling's People

Contributors

eugeneyuchunlin avatar shanihsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.