0% found this document useful (0 votes)
12 views

Lab 2

Uploaded by

khoi.lehcmut2003
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lab 2

Uploaded by

khoi.lehcmut2003
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Lab 2

1. Project overview

1.1. Project summary and data

Jabil company factory suffers the problem related to the flow of material, WIP, affecting
to the production process. We have to redesign the layout using as a learned algorithm
(Aldep, craft, Corelap, pairwise) with an aim to minimize the total of material traveling
distance. The data given is:

 Factory dimension: length 90m x width 32m.


 Product DCS will be randomly assigned in area 1,2,3,4 and transferred to 5-7-13
 Product SHC will be randomly assigned in area 1,2,3,4, transferred to 5 -7 and
departed in either 11 or 12.
 Product DESKTOP will be randomly assigned in area 1,2,3,4 and transferred to 6-
7-10.
 Product TABLETOP will be randomly assigned in area 1,2,3,4 and transferred to
6-7-8.
 Product Mobile will be randomly assigned in area 1,2,3,4 and transferred to 6-7-9.
 Product will be transfer within department in batch of 100 product.

There are also figures in the excel data file including:

 Demand of each product.

Figure 1. Demand of each product


 Dimension of departments.
Figure 2. Dimensions of departments
 Initial layout.

Figure 3. Initial layout


1.2. Initial layout of the project

Based on the dimensions of the departments and the initial layout, we can determine
the centroid of the departments and reconstruct the drawing in Autocad software.
`

Figure 4. Centroid of the departments

Figure 5. Initial layout in Autocad


2. Input data
1. Demand matrix
Based on the demand of the products, we can create a demand matrix. Because all
products are randomly assigned to departments 1,2,3,4, we will divide the products
equally into department 1,2,3,4 and then the products will move according to the
assigned departments.

Figure 6. Number of products in departments

Figure 7. Demand matrix( Divide by 100)


2. Distance matrix

After calculating the centroid of the departments in the previous section, we can
calculate the distance of each department to each other to get the distance matrix. The
distance used here will be Rectilinear distance with the formula:

D = |xi-xj| + |yi-yj|

With:
(xi,yi) and (xj,yj) represent the coordinates of two locations i and j.

After completing the calculation, t gets the distance matrix.

Figure 8. Distance matrix


3. Relationship matrix

After having the demand matrix, we transform the number into AEIOU with
∑ Quantity > 500 → A : absolutely necessary

300> ∑ Quantity > 500 → E : especially important

200> ∑ Quantity > 300 → I : Important

100> ∑ Quantity > 200 → O : Ordinarily important

∑ Quantity<100→ U : Unimportant

Figure 9. Relationship matrix


4. Cost matrix
After obtaining the demand matrix and distance matrix, we will multiply these two
matrices together. Then, we add up all the rows and columns and we will get the total
initial cost.

Corelap algorithm to improve the layout

1. Theoretical background

Computerized Relationship Layout Planning

Method based on the departmental relationship: A=4,E=3,I=2,U=0,X=-1

Using the total closeness rating (TCR) to allocate the department.

TCR is the total relationship ranged by numbers of allocated department with the
others.TCR is calculated by this formula:
m
TCR= ∑ W ịj
j=1 ,i ≠ j

Rule:

 Allocate the department has the largest TCR. If we the same largest TCR is
obsevered within some department, allocate the department havingmore A, then E
and so on.
 Once the department has the X relationship with re-arraganged department, It will
be establised in the the final step. If we have a lot X department, re-arragnged it by
decsent of TCR.
 The next department will be allocated based on the close- relationship with the
first one (A,E,I). Using TCR if we have more than one possible outcome.
 Make the loop of process until all deparments has been arranged.

Arrange according to principles:


Strong relationsip: 1-3-5-7.

Medium relationship: 2-4-6-8.

Placement ratio (PR - placing rating) is the sum of weighted adjacency ratios between
the part to be arranged and its neighbors.

PR=∑ W ik
k

Using PR to chose the arrangment oders.

The first selected part is placed in the middle.

The second will be place based on the raltionship with previous allocated department
(begin with the west corner).

2. Convert the relationship matrix from text to number

After obtaining the relationship matrix, we will convert them into numbers according
to the principle: A=4, E=3, I=2, O=1, U=0.
Figure 10. Relationship matrix in number
3. Using python code to find out the order of departments.

After obtaining the Relationship matrix in numeric form, we will use python code to
read the excel file containing the Relationship matrix in numeric form. After that, we
will execute the code to get the arrangement order of the departments.

Python code:

import numpy as np

import pandas as pd

def calculate_tcr(layout_matrix):

# Calculate the TCR index for each department

tcr_values = np.sum(layout_matrix, axis=1)

# Higher TCR values for higher priority

return tcr_values

def corelap_auto_priority(layout_matrix):
# Calculate TCR for the whole matrix

tcr_values = calculate_tcr(layout_matrix)

# Determine the department with the highest TCR as the starting point

priority_department_index = np.argmax(tcr_values)

# Create a list to hold the arrangement order with the first priority area

arrangement = [priority_department_index]

# Update the matrix by removing the priority area

remaining_indices = list(range(layout_matrix.shape[0]))

remaining_indices.remove(priority_department_index)

while len(arrangement) < layout_matrix.shape[0]:

next_department = None

max_relationship = -1

max_tcr = -1

for i in remaining_indices:

if i not in arrangement:

# Calculate the total relationship of the current department with the


arranged departments

total_relationship = sum([layout_matrix[i, j] for j in arrangement])


# If the total relationship is greater than or equal to the maximum and TCR
is higher

if total_relationship > max_relationship or (total_relationship ==


max_relationship and tcr_values[i] > max_tcr):

max_relationship = total_relationship

max_tcr = tcr_values[i]

next_department = i

# Add the next department to the arrangement

arrangement.append(next_department)

remaining_indices.remove(next_department)

return arrangement

# Suppose the relationship matrix has been defined

df = pd.read_excel('rela.xlsx')

relationship_matrix = df.values

departments = df.columns.tolist()

# Call the CORELAP function with automatic priority determination

layout_order = corelap_auto_priority(relationship_matrix)
# Convert indices to department names

layout_order_names = [departments[i] for i in layout_order]

print("Priority layout order:", layout_order_names)

# Create a DataFrame to store the results in the desired format

results_df = pd.DataFrame({'Layout order names': layout_order_names})

# Save the DataFrame to an Excel file

excel_path = 'Corelap.xlsx'

results_df.to_excel(excel_path, index=False)

After getting the results, we will save the results in an excel file.

Figure 11. Arrangement order using Corelap


4. Redraw layout in Autocad

After getting the order of the departments, we will rearrange the floor plan using
Autocad.

Figure 12. Layout in Autocad after using Corelap


After drawing the plan in autocad, we will have the centroid of the departments.

Figure 13. Centroid after using Corelap algorithm


5. Redefine the Distance matrix
After obtaining the center coordinates, we can recalculate the Distance Matrix similar
to the formula above.

Figure 14. Distance matrix after using Corelap algorithm


6. Total cost after using Corelap

After obtaining the distance matrix, we can calculate the cost by multiplying the
demand matrix with the new distance matrix. Then we calculate the total costs to get
the final cost.

Figure 15. Cost matrix after using Corelap algorithm


The final cost after applying the corelap algorithm is 59224,35.

You might also like