public void addEdge(Object u, Object v, int weight) {
	  try {
	  if(!isVertex(u) || !isVertex(v)) { // graph is unchanged if neither vertices are in the graph
		  return; 
	  } else { 
		  if (edgeHashTable == null) { // initialize the edgeHashTable when adding the first edge 
			  edgeHashTable = new HashTableChained();
		  }

		  VertexPair edgeVertexPair = new VertexPair(u,v);
		  if(isEdge(u,v) ){ //if the edge already exists in the hashtable
			  if(u.equals(v)){ //if it is a self-edge
				  ((EdgeNode) ((DListNode) edgeHashTable.find(edgeVertexPair).value()).item()).setWeight(weight);
			  }else{
				  EdgeNode edgeNode = (EdgeNode) ((DListNode) edgeHashTable.find(edgeVertexPair).value()).item();
				  edgeNode.setWeight(weight);
				  ((EdgeNode) edgeNode.getPartnerEdge().item()).setWeight(weight); //set the partner's weight
			  }
		  }else{ //if the edge does not exist in the hashtable;
			  edgeCount++;
			  if(u.equals(v)) { // self edge case
				  DListNode vertexDListNode = (DListNode) vertexHashTable.find(u).value(); // find vertex from vertexHashTable

				  EdgeNode edgeNode = new EdgeNode(weight,vertexDListNode); // self edge constructor

				  ((VertexNode) vertexDListNode.item()).addEdgeNode(edgeNode); // add edge to edgeList

				  edgeHashTable.insert(edgeVertexPair, ((VertexNode) vertexDListNode.item()).getEdgeList().back()); // hash edge
				  edgeHashTable.resize(); // check to see if hash table needs to be resized
			  } else { // non self-edge case
				  DListNode vertexDListNode1 = (DListNode) vertexHashTable.find(u).value();
				  DListNode vertexDListNode2 = (DListNode) vertexHashTable.find(v).value(); // find vertices from hashtable
				  
				  EdgeNode edgeNode1 = new EdgeNode(weight,vertexDListNode1, vertexDListNode2);
				  EdgeNode edgeNode2 = new EdgeNode(weight,vertexDListNode2, vertexDListNode1); // non self edge constructor
		
				  
				  ((VertexNode) vertexDListNode1.item()).addEdgeNode(edgeNode1);
				  ((VertexNode) vertexDListNode2.item()).addEdgeNode(edgeNode2); // add edge into both vertices' edgeLists
				  
				  edgeNode1.setPartnerEdge((DListNode) ((VertexNode)vertexDListNode2.item()).getEdgeList().back());
				  edgeNode2.setPartnerEdge((DListNode) ((VertexNode)vertexDListNode1.item()).getEdgeList().back()); // set partners pointers for each vertex of the edge
				  
				  edgeHashTable.insert(edgeVertexPair, ((VertexNode) vertexDListNode1.item()).getEdgeList().back()); // hash edge
				  edgeHashTable.resize(); // check to see if hash table needs to be resized
			  }
		  }
	  }
	
	  } catch(InvalidNodeException e){}
	  
  }