public void Initialize()
    {
        try {
            FileInputStream fstream = new FileInputStream("graph.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine;
            String str;
            String max = "MAX";
            String node = "NODE";
            
            int j = 0;
            int source;
            int target;
            int distance;
            while((strLine = br.readLine()) != null)
            {
                StringTokenizer tokens = new StringTokenizer(strLine);
                str = tokens.nextToken();

                if(max.equals(str))
                {
                    str = tokens.nextToken();
                    MaxSize = Integer.parseInt(str);
                    vertices = new Vertex[MaxSize];
                    
                    for(int i=0; i<MaxSize; i++)
                    {
                        vertices[i] = new Vertex();
                        vertices[i].adjacencies = new ArrayList<Edge>();
                    }
                }
                else
                {
                    if(node.equals(str))
                    {                        
                        str = tokens.nextToken();
                        int id = Integer.parseInt(str);
                        str = tokens.nextToken();
                        vertices[j].set(str, id);                        
                        j++;
                    }
                    else
                    {
                        str = tokens.nextToken();
                        source = Integer.parseInt(str);
                        str = tokens.nextToken();
                        target = Integer.parseInt(str);
                        str = tokens.nextToken();
                        distance = Integer.parseInt(str);
                        int sourceIdx = 0;
                        int targetIdx = 0;
                        for(int i=0; i<MaxSize; i++)
                        {
                            if(vertices[i].id == source)
                                sourceIdx = i;
                            if(vertices[i].id == target)
                                targetIdx = i;
                        }

                        vertices[sourceIdx].adjacencies.add(new Edge(vertices[targetIdx], distance));
                        //vertices[source].adjacencies[vertices[source].outdegree] = new Edge(vertices[target], distance);
                        vertices[sourceIdx].outdegree++;
                    }
                }
            }

        }
        catch(Exception e) {
            System.err.println("Error!: " + e);
        }
    }