public static boolean isValidSocialProof()

in graphjet-core/src/main/java/com/twitter/graphjet/algorithms/counting/GeneratorHelper.java [115:134]


  public static boolean isValidSocialProof(
      Map<Byte, Integer> minSocialProofSizes,
      SmallArrayBasedLongToDoubleMap[] socialProofs) {
    for (int i = 0; i < socialProofs.length; i++) {
      byte proofType = (byte)i;
      if (!minSocialProofSizes.containsKey(proofType)) {
        // valid, if there is no limit on the size of this social proof
        continue;
      }
      if (socialProofs[proofType] == null) {
        // not valid, if node does not have this type of social proof
        return false;
      }
      if (socialProofs[proofType].uniqueKeysSize() < minSocialProofSizes.get(proofType)) {
        // not valid, if number of social proofs below threshold
        return false;
      }
    }
    return true;
  }