I have a game system that can be represented as an undirected, unweighted graph, where each vertex has one (corresponding) property: color. The goal of the game from the point of view of the graph is to reduce it to one vertex in the least number of "steps". At each step, the player can change the color of any one vertex, and all adjacent vertices of the same color merge with it. (Note that in the example below it just seemed to me that the user changes only one specific vertex for the whole game, but the user can select any vertex at each step.)

What I need is a way to calculate the smallest number of steps needed to βbeatβ a given schedule in accordance with the procedure described above, as well as provide the specific steps necessary for this. I am familiar with the basics of finding paths, BFS, and things of this nature, but it's hard for me to find this problem in terms of solving the βfastest wayβ.
I cannot find this problem anywhere on Google or even the term graph theory that encapsulates the problem. Does anyone have an idea, at least, how to get started with this problem? Can someone point me in the right direction?
* , -, , , . - , , ? ( , , , 20 .) , BFD ... , , , . ?