i want to use a* in finding the minimum steps to make the puzzle unary in color. but i don't know how. I don't even know if it is feasible. A* searches from a starting point to a destination. In this case, the flood-it game, there's no specific destination because the goal of the game is to make the color unary.

If im to code it, the input would be a graph, then i will convert it to a tree wherein it is all the possible paths, then check what node has the smallest value of level, then that would be the min step. Its just that i think its too slow. And its brute force. Im just thinking maybe there are other ways not brute force or maybe theres something with a*

if you have some thoughts please share it.
please help me. thanks.

I'm not seeing why you want to use A*.

Have a look at these instead.
http://en.wikipedia.org/wiki/Flood_fill
http://tog.acm.org/resources/GraphicsGems/gems/SeedFill.c

Strilanc said "
A* is just a prioritized graph search. Each node is a game state, you rank nodes based on some heuristic, and always expand the lowest-expected-final-cost node. As long as your heuristic doesn't underestimate costs, the first solution you find is guaranteed to be optimal."

http://stackoverflow.com/questions/1430962/how-to-optimally-solve-the-flood-fill-puzzle

many people posting on their blogs about this A* in flood it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.