Consider the following computational problem:
Let $G,G'$ be groups so that $G$ is finite and generated by $X=\left\{g_1,\ldots,g_n\right\}$. Let $f:X \to G'$ be a map. Decide whether $f$ extends to a homomorphism $G \to G'$.
Inspired by this answer, I came up with the following constructive algorithm:
Denote by $y_1,\ldots,y_n$ be the images of $g_1,\ldots,g_n$ under $f$. Let $H \subseteq G$ be a set that is initially empty and let $Q$ be a queue of elements in $G \times G’$ that initially contains just $(e_G, e_{G'})$. Let $f’$ be a potential extension that is initially defined nowhere. Apply the following steps:
$1$. If $Q$ is empty, return YES.
$2.$ Pop an element $(x,y)$ from the queue.
$3.$ If $x \in H$:
If $f’(x) = y$ go to step $1.$
Otherwise, return NO.
$3.$ If $x \notin H$:
Set $H=H \cup \left\{x\right\}$. Extend $f’$ by defining $f’(x) := y$. Push $(g_i x, y_i y)$ to the back of the queue for $i=1,\ldots,n$.
Go to step $1.$
At each step, $H$ should be understood as the set of values for which $f'$ is presently defined, and $Q$ should be understood as the set of pairs $(*,f'(*))$ that logically follow from the previous, but are awaiting “verification” that they are not in contradiction with the present state of $f'$.
If step $3$ causes the algorithm to return NO then it is clear that the answer to the original problem is indeed “no” (it's essentially a long-winded proof by contradiction.
Conversely, I would like to know if the algorithm can produce a false positive, i.e. if the algorithm returns YES then is the extended function obtained by time the algorithm terminates necessarily a homomorphism?