Modify a tree to get edge weights less than vertex's values

So, this question goes like this:

Given a weighted tree with values assigned to each node, you are allowed to 2 free and 1 paid operation:
Free
i. Swap any two vertices
ii. Swap any two edges

Paid
iii. Change the value assigned to a vertex

The question asks us to report the minimum number of paid operations required to have a resulting tree where:
weight of edges <= value written on the adjacent vertices

For eg:
Vertex 1: Value 1
Vertex 2: Value 5
Vertex 3: Value 10

Given that 1---(4)---2---(7)---3, where 4 and 7 are edge weights, the best solution would be to vertices nodes 1 and 2 (operation i) and change the value of node 2 to >= 7 (operation iii).

Thus the answer would be 1.

I can't think of an efficient solution to this question. Any help would be appreciated!
Topic archived. No new replies allowed.