public ArrayList<Node> readPajek(String file){
        ArrayList<Node> nodes = new ArrayList<Node>();
        String line;
        String[] parts;
        int s;
        int d;
        int n;
        try
        {
            BufferedReader in = new BufferedReader(new FileReader(file));
            line = in.readLine(); //reads the *vertices line
            parts = line.split(" ");
            n = Integer.parseInt(parts[1]);
            for(int i=0;i<n;i++)
            {
                nodes.add(new Node(i));
            }
            if(verb)
            {
                System.out.println("Created " + nodes.size() + " nodes. On to creating links...");
            }
            line = in.readLine(); // edges
            int lc = 0;
            while((line = in.readLine()) != null)
            {
                parts = line.split(" ");
                s = Integer.parseInt(parts[0]) -1;
                d = Integer.parseInt(parts[1]) -1;
                nodes.get(s).addLink(new Link(nodes.get(d)));
                nodes.get(d).addLink(new Link(nodes.get(s)));
                lc++;
                if(verb && lc % 10000 == 0)
                {
                    System.out.println("Created " + lc + " links");
                }
            }
            in.close();
            System.out.println("Finished.");
        }
        catch(Exception e)
        {
            System.out.println(e);
            e.printStackTrace();
        }
        return nodes;
    }