Lab 2
Lab 2
1. Project overview
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:
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.
`
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 having the demand matrix, we transform the number into AEIOU with
∑ Quantity > 500 → A : absolutely necessary
∑ Quantity<100→ U : Unimportant
1. Theoretical background
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.
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
The second will be place based on the raltionship with previous allocated department
(begin with the west corner).
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):
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]
remaining_indices = list(range(layout_matrix.shape[0]))
remaining_indices.remove(priority_department_index)
next_department = None
max_relationship = -1
max_tcr = -1
for i in remaining_indices:
if i not in arrangement:
max_relationship = total_relationship
max_tcr = tcr_values[i]
next_department = i
arrangement.append(next_department)
remaining_indices.remove(next_department)
return arrangement
df = pd.read_excel('rela.xlsx')
relationship_matrix = df.values
departments = df.columns.tolist()
layout_order = corelap_auto_priority(relationship_matrix)
# Convert indices to department names
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.
After getting the order of the departments, we will rearrange the floor plan using
Autocad.
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.