Enhancing Community Detection in Networks: A Comparative Analysis of Local Metrics and Hierarchical Algorithms