Multi-machine Job scheduling problem--Johnson algorithm and Palmer method to find the optimal solution

Source: Internet
Author: User

0-Background

Near the graduation reply, the detection repetition rate, the draw the blind examination and so on the matter ensued. Unfortunately, women vote in the blind trial. I sent assists, and she revised the paper, so, these days wrote a bit of code, you can tidy up a bit.

Multi-machine Job sequencing The problem is very simple, a chestnut?? (Stole a picture from her thesis, 23333), how long will it take to finish processing all the workpieces and a,b,c,d? The premise is that a single machine can only process one workpiece at a time.

(1) Elapsed Time matrix

Workpiece Name

Electric Stove hours/h

Steel Contractor Hours/h

Die Casting hours/h

When repairing Grinder/h

A

5

10

7

2

B

10

2

8

9

C

3

6

7

8

D

8

10

1

6

Total

26

28

23

25

(2) Gantt chart

1- Johnson algorithm (Johnson) and Palmer Act (Palmer)

Johnson Law, aka Johnson Rules, is a sort of sorting method in job ordering. This method is applicable to the condition that n workpieces are processed by two or three devices (finite equipment), and all workpieces are processed in the same order on the limited equipment.

Learning effect factor: In fact, practice makes perfect, the processing time will become less. For example, the nth part that is machined on this machine becomes t* (n) ^ (-a), where T is the original time, and a is the learning factor.

The main references are: manufacturing operations Planning and control

Write an R code, the following is, the learning effect factor is also taken into account.

johnson_learning <-Function (car1,a) {library (magrittr) car1 <-as.data.frame (car1) rownames (car1) <-l Etters[1:dim (CAR1) [1]] # NAME five machines a,b,c,d,e colnames (car1) <-paste0 (' x ', 1:dim (CAR1) [2]) Res.matrix &lt ;-C (Rep (0,dim (CAR1) [1]*dim (CAR1) [2])%>%matrix (., Nrow=dim (CAR1) [1]) #加入学习因子a #a =0.3 a=-(ABS (a)) Learning_f    Actor <-seq (1:dim (CAR1) [1]) ^ (a) car1_add_learning <-sapply (car1,function (x) x*learning_factor)%>%round (3) For (I-in 1:dim (car1_add_learning) [1]) {# step1:calculate Col 1 if (i==1) {res.matrix[i,1] <        -Car1_add_learning [i,1]} else {res.matrix[i,1] <-car1_add_learning [i,1]+res.matrix[i-1,1] }} # Step 2:calculate row 1 for (M in 1:dim (car1_add_learning) [2]) {if (m==1) {res.matrix[1,m] &l    t;-res.matrix[1,1]} else {res.matrix[1,m] <-res.matrix[1,m-1]+car1_add_learning [1,m]}   } # Step 3:matrix for (x in 2:dim (car1_add_learning) [1]) {for (Y in 2:dim (car1_add_learning) [2]) {Res.matrix[x,y] <-m Ax (res.matrix[x-1,y]+car1_add_learning [x,y],res.matrix[x,y-1]+car1_add_learning [x, Y])}} t <-Res.matri X[dim (car1_add_learning) [1],dim (Car1_add_learning) [2]] return (list (a=car1_add_learning, B=c (a,t), C=res.matrix))}

The Johnson algorithm is like this, you just give me a part of the processing order, I can give you to calculate how much time to finish these parts, but how to arrange the processing order of these parts to make the total processing time the least? This need to use a heuristic method, that is, the Palmer Method (49th page), you can get closer to the optimal solution of the part sequencing scheme, not necessarily can get the best solution (I tried on the CAR1, Palmer method did not get the optimal scheme, but also quite close to the optimal solution).

Here's the R code for Palmer.

Zero.matrix <-Matrix (Rep (0,dim (car1) [2],nrow=1,byrow=t))%>%t () colnames (Zero.matrix) <-colnames (CAR1) for (M in 1:dim (CAR1) [2]) {for    (k in 1:dim (CAR1) [1]) {        zero.matrix[1,m] <-car1[k,m]* (K ((Dim (Car1) [1]) + 1)/2) +zero.matrix[1,m]    }} Zero.matrix[,order (Zero.matrix[1,])

2-tell me about drawing.

Recently also drew a lot of pictures, the following paste a code block, later unfamiliar can be for reference.

# Car1_res F Represents a learning factor, min_time indicates the minimum time to complete dat      f min_timecar1-0.152 6619.038car1-0.322 6342.673car1-0.515 under this learning factor 6090.669car1-0.737 5864.126car1-1.000 5661.767# plot-2par (family= ' Stkaiti ') plot (car1_res[,3],type= "O", pch=1,cex=1 , Ann=false,axes=f,ylim=c (5300,7600)) lines (car2_res[,3],type= ' o ', Pch=2,cex=1,ann=false) lines (car4_res[,3],type= ' O ', Pch=4,cex=1,ann=false) lines (car8_res[,3],type= ' o ', pch=8,cex=1,ann=false) axis (1,at=1:5,lab=c ("0.9", "0.8", " 0.7 "," 0.6 "," 0.5 ")) axis (2) box () Legend (" TopRight ", C (' Car1 ', ' Car2 ', ' Car4 ', ' Car8 '), Cex=0.8,pch=c (1,2,4,8), Lty=1) Title (xlab= "Learning rate L", ylab= "minimum maximum completion time")

3-Summary

Hands-on, more accumulation, more summary.

2016, come on!

Multi-machine Job scheduling problem--Johnson algorithm and Palmer method to find the optimal solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.