algorithm - Hashing sets of integers -


I'm looking for a hash function on H (.) And a relation R (.,.) / A to B In R (H (A), H (B)) is included. Of course, verifying R (.,.) Should be easy to verify (continuous time), and H (A) should be calculated in linear time.

An example of H and R is:

  • H (A) = or at 1 < & Lt; (H (A), H (B)) = ((H (A), H (B)) = ((H (x)% K), A for A, Fixed integer and H (x) An integer Hash Function.
  • H (A) and H (B)) == H (A))

Is there any other good examples? (Good to define good, but intuitively if R (H (A), H (B)) then whp A is included in B.

  • After thinking about this, I ended up with the example given by you, i.e. i.e. each element sets something in hash, and only B, if every bit set in H (A) is also set to H (B).
  • It may be applicable in one Ma. It seems to use the same bit trick, but with a lot of hash function.

Comments