4.3 SOLVING SYSTEMS OF INEQUALITIES
Given a set of M inequalities in N variables, where each inequality has the form ri − rj ≤ k for integer values of k, one of the shortest path algorithms in Appendix A can be used to determine if a solution exists and to find a solution if one does indeed exist. This is done using the following procedure.
- Draw a constraint graph.
(a) Draw the node i for each of the N variables ri, i = 1, 2, … , N.
(b) Draw the node N + 1.
(c) For each inequality ri − rj ≤ k, draw the edge j → i from node j to node i with length k.
(d) For each node i, i = 1, 2, … , n, draw the edge N + 1 → i from the node N + 1 to the node i with length 0.
- Solve using a shortest path algorithm.
(a) The system of inequalities has a solution if and only if the constraint graph contains no negative cycles.
(b) If a solution exists, one solution is where ri is the minimum-length path from the node N + 1 to the node i.
in N = 4 variables. The 1st step is to draw the constraint graph, which is shown in Fig. 4.3.
Using the Bellman-Ford algorithm (described in Section A.2 of Appendix A
Get VLSI Digital Signal Processing Systems: Design and Implementation now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.