Hi everyone,
I've been learning a lot of graph theory lately, and I've come across the following question, which I am having trouble with:
Suppose you are given a directed acyclic graph $$$G = (V, E)$$$ in which each vertex is colored one of two colors. You are also given two vertices $$$u$$$ and $$$v$$$ in the graph. How can I determine whether there is a path from $$$u$$$ to $$$v$$$ consisting of only one color (each intermediate vertex other than $$$u$$$ and $$$v$$$ are required to have the same color, the colors of $$$u$$$ and $$$v$$$) don't matter.
I thought about applying topological sort since it's a DAG, but then I don't really know how to proceed. Can someone please help me?