Similar tags?

Been trying to work out a way to discover similar tags for a website I’m building. We use tags quite extensively on the site, and I want to be able to point people to tags that are similar to or related to the one they’re looking at.

I’ve figured that the best way to do this is to take tag X, build an array of all tags from all posts that tag X appears in (except for tag X itself, of course) and then display this list in order of popularity – or at least the top 5 entries on the list. The problem is that I just can’t figure out the best way to do it.