private int getReachableCnt(String root,Map<String,List<String>> map){
        Set<String> set=new HashSet<String>();
        LinkedList<String> linkedList=new LinkedList<String>();
        linkedList.offer(root);
        while (!linkedList.isEmpty()){
            String s=linkedList.poll();
            if(!set.contains(s)){
                set.add(s);
                if(map.get(s)!=null) linkedList.addAll(map.get(s));
            }
        }
        return set.size();
    }