This study aims to compare the performance of the Kruskal and Prim algorithms in solving the Minimum Spanning Tree (MST) problem in the PLN UP3 Cimahi electricity distribution network using Python-based Google Colab. The study uses an applied research method with data in the form of electrical network cable lengths modeled as weighted graphs. Analysis was carried out using the NetworkX library on Google Colab to form MSTs using both algorithms. The results show that both algorithms produce the same total MST weight of 1258.05 meters, smaller than the initial network length of 1424.61 meters, resulting in an efficiency of 11.69%. Although producing identical solutions, the Kruskal algorithm is simpler to apply to networks with a large number of nodes because the weight sorting process is carried out at the beginning. This study shows that Google Colab is an effective medium for learning and implementing graph theory-based network optimization.
Copyrights © 2026