Graph theory problem

Revision en1, by typedeftemplate, 2020-04-23 01:07:46

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 either red or blue along with two vertices $$$u$$$ and $$$v$$$. How can I determine whether there is a path from $$$s$$$ to $$$v$$$ consisting of only one color, where the colors of $$$u$$$ and $$$v$$$ don't matter (only the intermediate vertices are required to have the same color).

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?

Tags #graph, #graph theory, #dfs, #dfs and similar

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English typedeftemplate 2020-04-23 01:09:02 173
en1 English typedeftemplate 2020-04-23 01:07:46 655 Initial revision (published)