The reconfigurable manufacturing system (RMS) is an advanced manufacturing strategy that enables precise adjustment of functionality and capacity to meet fluctuating demands economically. RMS focuses on part families, allowing configurations to be adapted for new part requirements. Optimizing flow line design to produce various parts involves minimizing reconfigurations and associated costs by enhancing operation sequence similarity. This article proposes a novel sequence optimization using the Longest Common Subsequence (LCS) method to reduce bypassing moves and machine idle times. The study introduces a similarity coefficient derived from LCS and employs average linkage hierarchical clustering to categorize parts in a case study. Unlike traditional methods, this approach considers material movements both before the initial machine and after the final processing station, addressing gaps in bypassing move calculations. The impact of different weighting scenarios for Type-II moves (ω) and machine idleness (β) on clustering was examined. For example, with Type-II move weights (ω) of {1.0, 0.6, 0.3, 0.0} and equal weightings for bypassing moves (α) and machine idleness (β) set at 0.5, a threshold value of 0.3 results in eight clusters, such as Cluster 1 {1, 11, 10, 12} and Cluster 3 {3, 5, 6, 4, 15, 9, 13, 14, 7, 8}. Lower threshold values lead to fewer clusters with larger sizes, indicating a more consolidated part family grouping. Various Type-II move weights and material handling scenarios demonstrate how different weighting configurations affect clustering and part family sizes. This approach enhances RMS efficiency by integrating comprehensive material handling considerations and optimizing clustering based on operational similarities.