define a refEdge and implement prim.