views:

91

answers:

1

I'm thinking this might be NP-complete, but I'll ask anyway. Greedy algorithms don't seem to work in my head.

Given a set of items, each with 1 or more tags, I want to find the smallest set of tags that cover all the items.

Edit: See my "solution" here.

+6  A: 

This is the Set Cover problem, which is NP-complete. Each tag defines a subset of your list of items, and you want to find the minimum number of subsets (tags) whose union equals the full list of items.

Jim Lewis
Knew it'd have a name...just didn't know what it was called. Now I can investigate further, thanks :)
Mark