Hello I'm taking the course Algorithm and I have this problem:
Let $G=(V,E)$ be a directed graph. Let $U \subset V$ a subset of $V$, and also let $s,t$ be two vertices such that $s \neq t \in V$ and $s, t \not\in U$.
I need to write an algorithm that find the shortest path from $s$ to $t$ which visits only two vertices in $U$. In this question I allowed to visit a vertex more than once (not have to be a simple path). In my book its says that I need to solve this with reduction. any suggestions?
I think I need to solve this with BFS...