Help me to implement algorithm here

as the graph is directed how can i use kruskal here