I have a chess board where some squares have chips on them. Each chip can move in one space at a time (not diagonally). I want to get all the chips into one connected group (edge to edge, diagonals don't connect) in the least amount of moves. Running A* with using this goal condition of being connected instead of a single goal state should work fine I believe. I'm just not sure if there is a better approach or what heuristic h() to use. Since h() can't be an over-estimate, my only idea so far for making h() is considering the X coordinates in isolation and figured out how many moves would be required to make all the x's connected, and then do the same for Ys and add them together, which will certainly be less (potentially way less) than the real solution. Though programming that h() isn't even as trivial as I was originally thinking and may need its own A*...
I also can't help thinking that there is probably some relatively simple algorithm for moving the pieces into one connected group that will always do so in the optimal number of moves, but the more examples I look at the more it seems like that isn't the case, though maybe I'm just not thinking about it right.