minimal spanningtree using prim's algorithme