I had to solve a similar problem and it turned out that using the hash sum as a hash leads to too many collisions. The distribution of the amount of hashes is simply not widespread.
I found that using hashes resulted in significantly fewer collisions. This, of course, depends on the nature of the hashes for the individual vertices.
Set up a test bed and check out a few symmetrical hash functions, and then pick the best based on the collision.
You can try
h(x,y) = x+y
h(x,y) = x*y
h(x,y) = x * y + (x ^ y)
h(x,y) = x *y + x + y
where x ^ y = min (x, y)
source
share