public void printDirectedDegreeDistribution(LinkSet L){
        
        LinkSetNode N;
        L.initTreeTraversal();
        Map<Integer,Integer> inDegree = new HashMap<Integer,Integer>();
        Map<Integer,Integer> outDegree = new HashMap<Integer,Integer>();
        Set<Integer> nodeSet = new HashSet<Integer>();
        int d;
        while((N=L.getNextInOrder()) != null)
        {

            nodeSet.add(N.s);
            nodeSet.add(N.d);
            switch(N.w)
            {
                case 3: // bidirectional
                    addInMap(inDegree,N.s);
                    addInMap(inDegree,N.d);
                    
                    addInMap(outDegree,N.s);
                    addInMap(outDegree,N.d);
                    break;
                case 1: // source -> dest
                    addInMap(outDegree,N.s);
                    addInMap(inDegree,N.d);
                    break;
                case 2: // dest -> source
                    addInMap(outDegree,N.d);
                    addInMap(inDegree,N.s);
                    break; 
            }
        }
        int ind;
        int outd;
        for(int i : nodeSet)
        {
            ind = inDegree.containsKey(i) ? inDegree.get(i) : 0;
            outd = outDegree.containsKey(i) ? outDegree.get(i) : 0;
            System.out.println(i + " " + ind + " " + outd + " " + (double)ind/(double)(ind+outd));
        }
    }