Hello, all! I am thinking about the following problem:
Given a tree with N vertices and some constant D. You are to find maximum number of vertices you can color if distance between any two colored vertices should be at least D.
How to solve this problem better than $$$O(N^2)$$$? I think for $$$O(N^2)$$$ we can use greedy approach; choose the farthest available vertex from the root.
Any helps are appreciated.