code: public double sum() {
          double sum = 0;
          TIntDoubleIterator iter = edges.iterator();
          while (iter.hasNext()) {
              iter.advance();
              sum += iter.value();
          }
          return sum;
      }
docs: Returns the sum of the weights of the edges contained in this set.