initil prim algorithm class