public void read(String filename) throws IOException
    {
    	// initialise the graph
    	graph = new Graph();
    	
    	// load the file
        File file = new File(filename);
        Scanner in = new Scanner(file);
        
        // get the top line
        
        String[] topLine = in.nextLine().split(" ");
        
        
        int numberOfNodes = Integer.parseInt(topLine[0]);
        

        
        // read the nodes
        for(int i = 0; i < numberOfNodes; i++)
        {
        	String nodeName = in.nextLine();
        	Node n = new Node(nodeName);
        	graph.add(n);
        }
        
        
        while (in.hasNextLine())
        {
            String line = in.nextLine();
            
            String[] names = line.split(" ");
            String id1 = names[0];
            String id2 = names[1];
            double weight = Double.parseDouble(names[2]);
            Edge.EdgeType type;
            if(names[3].equals("Taxi"))
            {
            	type = Edge.EdgeType.Taxi;
            }
            else if(names[3].equals("Underground"))
            {
            	type = Edge.EdgeType.Underground;
            }
            else 
            {
            	type = Edge.EdgeType.Bus;
            }
            
            // create the edge
            Edge edge = new Edge(id1, id2, weight, type);
            graph.add(edge);
            
            
        }
        
        in.close();
    }