public Test(String fileName) {

        File f = new File(fileName);
        try {
            Scanner s = new Scanner(f);
            int cur = 0;
            int max = 0;

            while (s.hasNext()) {
                String[] edge = s.nextLine().split(" ");
                int start = Integer.valueOf(edge[0]);
                int end = Integer.valueOf(edge[1]);

                if (max < start)
                    max = start;
                if (max < end)
                    max = end;

                cur++;
                System.out.println("Line: " + cur);
            }

            // read the graph
            s = new Scanner(f);
            cur = 0;

            graph = new Node[max];
            reverseGraph = new Node[max];
            for (int i = 0; i < max; i++) {
                graph[i] = new Node(i);
                reverseGraph[i] = new Node(i);
            }


            while (s.hasNext()) {
                String[] edge = s.nextLine().split(" ");
                int start = Integer.valueOf(edge[0]) - 1;
                int end = Integer.valueOf(edge[1]) - 1;

                graph[start].out.add(graph[end]);
                reverseGraph[end].out.add(reverseGraph[start]);

                cur++;
            }

        } catch (Exception e) {

        }
    }