Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(20 points) Suppose that a black stone is placed on a vertex s and a white stone

ID: 3592642 • Letter: #

Question

(20 points) Suppose that a black stone is placed on a vertex s and a white stone is placed on a different node t of an undirected graph G, where there is no edge between s and t. At every step, we have to move both stones simultaneously to two non-adjacent (different) vertices (the stones can visit a node several times during the algorithm if needed but they have to move at every step). A stone can only be moved from a node to a neighbouring node. The ultimate goal is to switch the places of the two stones. That is to have the black stone on t and the white stone on s. Design an algorithm that takes as input G and s and t, and tells whether this is possible, and if it is, then what is the minimum number of steps required to achieve this.

Explanation / Answer

If we add two more nodes in this undirected graph,one in left and one in right of these two nodes then these two coloured stones can be interchanged.Both ways can be used seperately by any of the stone to be travelled and will be interchanged as per rewquirement.Minimum 4-5 basic steps will be required to achieve this.