private Node pickSeed(Set<Node> nodeList, Set<Integer> sampleList){
        int N = nodeList.size(); //number of  proteins
        int setSize = (int)Math.sqrt(N);
        //System.out.println("required num of proteins " + setSize);
        HashSet<Node> eligibleFeatures = new HashSet();
        //eligibleFeatures.addAll(nodeList);
        //Set<Integer> rand = new HashSet<Integer>();

        Random generator = new Random();
        int count = 0;
        while (eligibleFeatures.size() < setSize){
            int j = generator.nextInt(N);
            for(Node n: nodeList){
                if(n.id == j && n.neighbors.size()>=5){
//                    System.out.println("found one randomly selected node!!" + n.label);
                    if(!eligibleFeatures.contains(n))
                        eligibleFeatures.add(n);
                        
                    }
                }
            }
        
        //System.out.println("num of features tochoose from " + eligibleFeatures.size());
            //rand.add(j);
        

//        HashSet<Node> possibleNodes = new HashSet();
//        for(Node n: nodeList){  //really bad way of doing this, but can't help but iterate over the entire HashSet since I don't wnat to change the implementation
//            if(rand.contains(n.id))
//                possibleNodes.add(n);
//        }
//
      //Node selectedNode = null;
//        HashSet<Node> eligibleFeatures = geteligibleFeatures(possibleNodes);
        
        Node selectedNode = null;
        double GiniTemp = 1.0;
        for(Node m: eligibleFeatures){
            double temp = GiniFeature(m, sampleList);
            //System.out.println(m.label+"'s Gini index is " + temp);
            
            if(temp<GiniTemp){
                GiniTemp = temp;
                selectedNode = m;
            }
        }
        
       // if(selectedNode!=null)
        //System.out.println("root node picked: " + selectedNode.label + " and it's gini index is : " + GiniTemp);
        //prevGini = GiniTemp;
        return selectedNode;
    }