add Prim algorithm (MinSpanTree)