code: public int sumCapacities(Collection<Node> ids, boolean undef) {
      int s = 0;
      for (Node u: ids) {
        if (capacityDefined(u) || undef) {
          s += nodesCapacity.get(u);
        }
      }
      return s;
    }
docs: Get the cumulative nodes capacity.
  
  @param ids   the nodes.
  @param undef {@code true} to include the undefined elements using the default value
  @return the value