bfs+prim