public void writeSimpleAdjacenclyListOfNodeSet(Set<Integer> nodes, String set, String output, boolean weighted){
        StreamedLinkSet SLS = new StreamedLinkSet(set);
        SLS.initTreeTraversal();
        LinkSetNode N;
        try
        {
            BufferedWriter out = new BufferedWriter(new FileWriter(output));
            while((N = SLS.getNextInOrder())!= null)
            {
                if(nodes.contains(N.s) && nodes.contains(N.d))
                {
                    out.write(N.s + "," + N.d + (weighted ? "," + N.w + "\n" : "\n"));
                }
            }
            out.flush();
            out.close();
            SLS.close();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }