How to solve kruskal algorithm with prectical example