code: public boolean add(WeightedEdge e) {
          int toAdd = -1;
          if (e.from() == rootVertex) 
              toAdd = e.to();        
          else if (e.to() == rootVertex)
              toAdd = e.from();
          else {
              return false;
          }
          
          double w = e.weight();
          if (edges.containsKey(toAdd)) {
              double w2 = edges.put(toAdd, w);
              // The weight was changed but a new edge was not added
              return false;
          }
          else {
              edges.put(toAdd, w);
              return true;
          }
      }
docs: Adds the edge to this set if one of the vertices is the root vertex.
  
  @return {@code true} if e was added or if the weight was changed for the
  conenction between an existing edge that matched