Graph theory problem

Правка en1, от 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?

Теги #graph, #graph theory, #dfs, #dfs and similar

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский typedeftemplate 2020-04-23 01:09:02 173
en1 Английский typedeftemplate 2020-04-23 01:07:46 655 Initial revision (published)