This kind of problem is generally quite difficult. The analogous problem for finite topological spaces is unsolved in the general case, and the few particular solutions we do have are quite complicated! If you do find anything though, I'd be interested in knowing.