Imagine you have N variables x_1, x_2, … x_N. Each of these variables needs to be assigned a value. In addition we have M restrictions of the form x_i – x_j <= Wij. Can we successfully assign values to these variables?
In fact we can use something called system of difference constraints programming. We construct a graph where each node represents a variable. For each constraint of the form x_i – x_j <= Wij we create an edge j -> i with weight Wij. Finally, we create a virtual source node and connect it to all N variables each with weight 0. If the graph contains a negative weight cycle, then there is no solution and it is impossible. Otherwise a possible solution is to find the shortest path from the source node to all other nodes.
Notice that if we want a constraint x_i – x_j = Wij, we can create 2 edges, one of them the correct way and the other one the other way with negative weight to simulate ensuring that both variables will differ by Wij.