0

I've faced a problem and I don't know what approach I must follow, dynamic programming or greedy method, so here is the question.

Question: Given a directed tree $T=(V,\ E)$. We're required to find a set of vertices $A\subseteq V$ as big as we can such that for every two vertices $v,u\in A$ there isn't a path of length less than 3.

Note: tree can be a non-binary tree.

Example: In the image $A=[0,3,4,5]$.

Example of a tree

Mohamad S.
  • 449
  • 2
  • 12
  • The length of the path between $3$ and $4$ is 2, less than 3. Is your example correct? Why is vertex $0$ not included in $A$? – John L. Jan 15 '22 at 21:28
  • @JohnL. Thanks for the comment, it's actually an example I found, and also there is no path between $3$ and $4$, notice it's a directed graph. – Mohamad S. Jan 15 '22 at 21:32
  • "A directed graph", I was so bad at reading – John L. Jan 15 '22 at 21:47
  • Please don't re-ask questions. If you'd like to gain more attention to your question, I suggest following the advice that was provided on that question. After you have contributed more, another option will be to leave a bounty on the question. Thank you! – D.W. Jan 15 '22 at 23:44
  • Why it's deleted!! there's even no answer for another question, I asked it again so there could be someone who have an answer for it. – Mohamad S. Jan 16 '22 at 13:07

0 Answers0