I'm trying to perform an A* search on a particular N-puzzle variant in which some tiles are identical. More specifically, assuming an $m \times m$ grid, there are m colors with m tiles of each. The puzzle is considered solved when tiles form vertical lines of matching color. For example, with $m=3$
RG GR GR RGB
RGB BGR GRB RG etc.
RGB BGR GRB RGB
would all be valid solutions.
I am having difficulty coming up with a good heuristic for this, as any one tile could potentially occupy any one of the m*m locations when solved. Could anyone offer any suggestions or advice? Perhaps another type of search algorithm would be better?