public void readGraphDataFile(String filename){    	 
       	  Scanner scan;
       	  int time = 0;
       	  int nodeId = 0;	 
       	  boolean nodesDone = false;
       	  Edge newEdge;
       	  int foundEdge;
       	  float nodeX=0.0f, nodeY=0.0f;
       	  Node newNode;
       	  this.nodes = new ArrayList<Node>();
       	  this.edges = new ArrayList <Edge>	();
       	  
       	InputStream fs = this.getClass().getResourceAsStream(filename);
		scan = new Scanner(fs);
		
		while(scan.hasNext())
		{   				
			String line;
			line = scan.nextLine();
			String[] items = line.split(" ");
			//System.out.println(items[0]);
			if (items[0].equals("node")){ //Save the node
				nodeId = Integer.parseInt(items[1]); 
				if (items[4] != null){
					newNode = new Node(this.parent,nodeId,items[4],this.numTimeSlices);
				}else{
					newNode = new Node(this.parent,nodeId,""+nodeId,this.numTimeSlices);
				}				
				//When the node positions are fixed....
				nodeX = Float.parseFloat(items[2]);
				nodeY = Float.parseFloat(items[3]);				
				newNode.x = nodeX;
				newNode.y = nodeY;
				this.nodes.add(newNode);
			}else if (items[0].equals("time")){ //Save the time slice				
				nodesDone = true;    
				time = Integer.parseInt(items[1]); 				
			}else if (items[0].equals("timeline")){
				String [] labels = scan.nextLine().split(" ");			
				this.timelineLabels = new ArrayList<String>(Arrays.asList(labels));
				this.numTimeSlices = this.timelineLabels.size();
			}else{
				if (nodesDone){ //Save the edge information       						
					newEdge = new Edge (this.parent,"",Integer.parseInt(items[0]),Integer.parseInt(items[1]),this.numTimeSlices);
					//System.out.println(Integer.parseInt(items[0])+" "+Integer.parseInt(items[1]));
					foundEdge = findEdge(this.edges,newEdge);
					if (foundEdge==-1){ //If edge doesn't exist, create it       							
						newEdge.persistence.set(time, 1);
						this.edges.add(newEdge);
					}else{//Otherwise just update the persistence info
						this.edges.get(foundEdge).persistence.set(time, 1);
					}           					
				}else{//Save the node coordinates
					//When the node postions are changing 
					/**if (items[0].equals("null")){ //Node does not appear for this time slice
						this.nodes.get(nodeId).coords.add(null);
					}else{           						
						this.nodes.get(nodeId).coords.add(new Coordinate(Float.parseFloat(items[0]),Float.parseFloat(items[1])));
					} */        
					//When the node positions are fixed
					if (items[0].equals("0")){ //Node does not appear for this time slice
						this.nodes.get(nodeId).persistence.add(0);
					}else{           						
						this.nodes.get(nodeId).persistence.add(1);
					}
				}
			}       				
			
		}
       	  
       	  //Set the node degree changes over time, and get the highest node degree overall
		  this.globalMaxDegree = 0;
		  int deg;
       	  for (int i=0;i<this.nodes.size();i++){
       		  this.nodes.get(i).setNodeDegree(this.edges);
       		  deg = this.nodes.get(i).maxDegree;
       		  if (deg>this.globalMaxDegree){
       			  this.globalMaxDegree = deg;
       		  }
       	  }       	
     }