Tree coverage problem

Given a tree of n nodes, assign the nodes values j between 1 and n, where a node with the value j is covering itself and all nodes that are j steps away from it, such that you cover all nodes while keeping the sum of the assigned values minimal.

How would one approach such a problem ? My first idea was to use a greedy algorithm where I select the node with the lowest cost to covering ratio next, but it doesn’t seem to find the optimal solution many times.