public void connectNodes(){    	
    	 Edge e = new Edge(this.parent,"",this.selectedNode,this.releasedNode,this.numTimeSlices);    	
         this.selectedEdge = findEdge(this.edges,e);  
         this.selectedEdge = (this.selectedEdge==-1)?-2:this.selectedEdge; //Need to know if no connection exists between the nodes, in this case set the selectedEdge to -2 
                                                                          //(-1 already means no edge is currently selected)
         Edge toAdd;
         if (this.selectedEdge==-2){ //Non-existent edge
	    	 toAdd = e;
	     }else{
	    	 toAdd = this.edges.get(this.selectedEdge);   
	     }
         
         //Aggregate the edge hint paths if more than one edge is selected
         if (findEdge(this.aggregatedEdges,toAdd)!=-1){  //De-selecting an edge
    	     this.aggregatedEdges = removeEdge(this.aggregatedEdges,toAdd); 
    	     this.aggregatedEdges_Nodes.remove(new Integer(toAdd.node1));
    	     this.aggregatedEdges_Nodes.remove(new Integer(toAdd.node2));
         }else if (!(this.inGlobalView && this.selectedEdge==-2)){
        	 this.aggregatedEdges.add(toAdd);        	 
        	 this.aggregatedEdges_Nodes.add(toAdd.node1);
        	 this.aggregatedEdges_Nodes.add(toAdd.node2);
         }
         this.aggregateEdgeHintPaths();         
     }