public void analyze(int minWalkId, int maxWalkId, int maxHops) throws IOException {
        int numberOfWalks = maxWalkId - minWalkId + 1;
        Walk[] paths = new Walk[numberOfWalks];
        for(int i=0; i < paths.length; i++) {
            paths[i] = new Walk(maxHops);
        }

        String[] walkFiles = directory.list(new FilenameFilter() {
            @Override
            public boolean accept(File file, String s) {
                return s.startsWith("walks_");
            }
        });

        for(String walkFile : walkFiles) {
            System.out.println("Analyze: " + walkFile);
            long walksInFile = new File(directory, walkFile).length() / 10;
            DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(
                    new File(directory, walkFile)), 1024 * 1024 * 50));
            try {
                long i = 0;
                while(i < walksInFile) {
                    if (i % 1000000 == 0) System.out.println(i + " / " + walksInFile);
                    i++;

                    int walkId = dis.readInt();

                    short hop = dis.readShort();
                    int atVertex = dis.readInt();
                    if (walkId >= minWalkId && walkId <= maxWalkId) {
                        paths[walkId - minWalkId].addWalk(hop, atVertex);
                    }
                }
            } catch (EOFException ioe) {
                continue;
            }
            dis.close();
        }

        for(Walk w : paths) {
            w.sort();
        }

        /* Analyze the walks */
        groupBySourceAndAnalyze(paths);

        output.close();
    }