@Override
    public void connect(T t1, T t2, String s, int weight){
        
        if (!nodes.containsKey(t1) || !nodes.containsKey(t2)){
            throw new NoSuchElementException("Node finns ej vid connect");
        }
        
        if (nodes.get(t1) == nodes.get(t2)){
            //this shouldn't happen as you can't select the same circle twice (as it will be deselected on the second click), but just in case
            throw new IllegalArgumentException("Origin and destination is the same object");
        }
        
            boolean exists = false;
            
            List<Edge<T>> fromList = nodes.get(t1);
            
            List<Edge<T>> toList = nodes.get(t2);
            
            for (Edge<T> e : fromList){
                if(e.getName().equalsIgnoreCase(s) && e.getDest() == t2) {
                    exists = true;
                }
            }
            
            if (!exists){
                Edge<T> e1 = new Edge<T>(t2, s, weight);
                Edge<T> e2 = new Edge<T>(t1, s, weight);
                fromList.add(e1);
                toList.add(e2);
                
                
            }
            else{
                throw new IllegalArgumentException("Finns redan en båge med detta namn");
            }
        
    }