node_optimal_values function

Computation of the optimal values at nodes and tips.