Playing On A Directed Graph

You are given a directed graph consisting of n vertices and m edges (each edge is directed, so it can be traversed in only one direction). You need to assign a value Pi to each vertex i from 1 to n so that for each edge u→v having weight w, Pv-Pu ≤ w is satisfied.


This is a companion discussion topic for the original entry at https://toph.co/p/playing-on-a-directed-graph