This study aims to compare the performance of the Kruskal and Prim algorithms in solving the Minimum Spanning Tree (MST) problem for the PLN UP3 Cimahi electricity distribution network using Python-based Google Colab. The study employs an applied research methodology, utilising data on the lengths of electricity network cables modelled as a weighted graph. The analysis was carried out using the NetworkX library on Google Colab to construct the MST using both algorithms. The results show that both algorithms produced the same total MST weight of 1,258.05 metres, which is less than the initial network length of 1,424.61 metres, resulting in an efficiency of 11.69 per cent. Although they produced 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 demonstrates that Google Colab is an effective platform for both learning and implementing graph theory-based network optimisation.
Copyrights © 2026