Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 779 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 779 Bytes

redis-union-find

This is an implementation of the Union Find/Disjoint Set data structure using Redis.

This project implements WeightedQuickUnion with Path Compression.

Why?

I think Disjoint Sets are really cool. I also think Redis is very cool.

Overview of Disjoint Sets

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")