    int findminvertex(int *weight, bool *visited, int v){
        int minVertex  = -1;
        for(int i = 0;i<V;i++){
            if(!visited[i] &&(minVertex==-1 || weight[i]<weight[minVertex])){
                minVertex = i;
            }
        }
        return minVertex;
    }

    void prims(){
        bool *visited =  new bool[V];
        int *parent = new int[V];
        int *weight = new int[V];