public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
        if(node == null)
            return null;
        UndirectedGraphNode newNode;
        if(!map.containsKey(node.label)){
            newNode = new UndirectedGraphNode(node.label);
            map.put(node.label,newNode );
        }else
            newNode = map.get(node.label);

        List<UndirectedGraphNode> newList = newNode.neighbors;
        List<UndirectedGraphNode> list = node.neighbors;
        for(int i =0;i< list.size();i++){
            if(map.containsKey(list.get(i).label)){
                newList.add(map.get(list.get(i).label));
            }
            else if(list.get(i).label != node.label )
                newList.add(cloneGraph(list.get(i)));
            else
                newList.add(newNode); //  list.get(i).label == node.label  connect itself;
        }
        return newNode;

    }