#MST(G): Minimal spanning tree MST:=proc(G) local n,E,DT,SP,E1,cha,rec,i1: n:=G[1]: E:=G[2]: DT:=G[3]: SP:={}: E1:=E minus SP: while nops(SP)