code: public static String weightingToFileName(Weighting w, boolean edgeBased) {
          return toLowerCase(w.toString()).replaceAll("\\|", "_") + (edgeBased ? "_edge" : "_node");
      }
docs: Replaces all characters which are not numbers, characters or underscores with underscores