This study proposed a new algorithm, which targets the local structure of the functional protein and transforms it into 3D coordinates. It then performs the calculation and assessment of the protein structural fragment to identify the similarities in the local structure of the proteins and to estimate if these two proteins have the same functionality. During the process of calculation, a structure alignment was first used to perform rotation, panning, and super positioning of the two protein fragment groups, and calculate each coordinate in order to complete the graph. A minimum-spanning-tree algorithm was then used to determine whether the coordinates are suitable, and the unsuitable coordinates are deleted. At the end, the pair with the most similar structures in the fragment group was exported. The results of this study showed that the average accuracy of our testing data can be as high as 94.3%, and can be presented using a fully automated process. Users can easily identify similar fragments in local structures. In the future, we hope to conduct further studies on applications including identifying new effects or side effects of existing drugs.