This is an implementation of the Union Find/Disjoint Set data structure using Redis.
This project implements WeightedQuickUnion with Path Compression.
I think Disjoint Sets are really cool. I also think Redis is very cool.
Read my blog post!
Made using Bun and Upstash Redis
I've also published to npm, and you can install it in your project using
npm install redis-union-find
or
bun add redis-union-find
and use it like this:
const uf = new UnionFind({
redisToken: process.env.REDIS_TOKEN!,
redisUrl: process.env.REDIS_URL!,
})
await uf.connect("Alice", "Bob")