This document discusses systems of difference constraints and how to maintain a feasible solution. It defines a system of difference constraints as a set of inequalities of the form xi - xj ≤ bi,j. Each system can be represented as a constraint graph with nodes for each variable and edges for each constraint. It presents an algorithm using the Bellman-Ford algorithm to determine if a feasible solution exists by checking for negative weight cycles in the constraint graph. If no negative cycles exist, the shortest path weights provide a feasible solution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
91 views14 pages
System of Different Constraints
This document discusses systems of difference constraints and how to maintain a feasible solution. It defines a system of difference constraints as a set of inequalities of the form xi - xj ≤ bi,j. Each system can be represented as a constraint graph with nodes for each variable and edges for each constraint. It presents an algorithm using the Bellman-Ford algorithm to determine if a feasible solution exists by checking for negative weight cycles in the constraint graph. If no negative cycles exist, the shortest path weights provide a feasible solution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14
System of
Different Constraints Hossam Yehia
Eslam Ashraf
Marawan Abo El-Naga
Nada Gamal
Mohie eldi Muhammad
What is System of Different Constraints? • It is a shortest path application as a set of inequalities of the form xi − xj ≤ bi,j . Such a system is said to be feasible if there exists a solution to the system of inequalities. • Often it is necessary to maintain a solution to a difference constraints system as constraints are added, modified, and deleted. For example, interactive multimedia systems let users create difference constraint systems by adding and deleting constraints. Problem • We are interested in maintaining a feasible solution to a system of constraints, and if so, we want to identify a feasible solution. • This model arises in a variety of applications; like the telephone operator scheduling, and scaling of the data. Demonstration • Each system of difference constraints has an associated graph G, which we call a constraint graph. The constraint graph has n nodes corresponding to the n variables • And m arcs corresponding to the m difference constraints. We associate an arc (i,j)k of length b(k) in G with the constraint xi − xj ≤ bi,j. Cont. Demonstration • A directed, weighted graph G = (V, E, length) consists of a set of vertices V, a set of edges E, and a function length from E to reals. We denote an edge from vertex u to vertex v by u → v. • (Constraint Graph). The constraint graph of a system of difference constraints (V,C) is a directed, weighted graph G = (V, E, length )where • E = {xj → xi | xi − xj ≤ ai,j ∈ C} • length(xj → xi) = ai,j iff xi − xj ≤ ai,j ∈ C. given a constraint graph : • we assume that a system of constraints contains at most one inequality per ordered pair of variables. That is, the system cannot include two constraints x − y ≤ a and x − y ≤ b, where a 6= b. If there are multiple constraints on the same ordered pair of variables, then the constraint graph is a multigraph How to maintain a feasible solution ? • Constraint graphs • It is beneficial to interpret systems of difference constraints from a graph-theoretic point of view. The idea is that in a system Ax ≤ b of difference constraints, the m × n linear- programming matrix A can be viewed as the transpose of an incidence matrix (see Exercise 22.1-7) for a graph with n vertices and m edges. Each vertex vi in the graph, for i = 1, 2,..., n, corresponds to one of the n unknown variables xi . Each directed edge in the graph corresponds to one of the m inequalities involving two unknowns. • More formally, given a system Ax ≤ b of difference constraints, the corresponding constraint graph is a weighted, directed graph G = (V, E), where • V = {v0, v1,..., vn} • and • E = {(vi, vj) : xj - xi ≤ bk is a constraint} ∪{(v0, v1), (v0, v2), (v0, v3),..., (v0, vn)} . • The additional vertex v0 is incorporated, as we shall see shortly, to guarantee that every other vertex is reachable from it. Thus, the vertex set V consists of a vertex vi for each unknown xi , plus an additional vertex v0. The edge set E contains an edge for each difference constraint, plus an edge (v0, vi) for each unknown xi . If xj - xi ≤ bk is a difference constraint, then the weight of edge (vi , vj) is w(vi, vj) = bk. The weight of each edge leaving v0 is 0. Figure 24.8 shows the constraint graph for the system (24.3)-(24.10) of difference constraints. Graph constrain Theorem : Given a system Ax ≤ b of difference constraints, let G = (V, E) be the corresponding constraint graph. If G contains no negative-weight cycles, then :
is a feasible solution for the system. If G contains a negative-weight cycle, then
there is no feasible solution for the system. • Solving systems of difference constraints • Theorem 24.9 tells us that we can use the Bellman-Ford algorithm to solve a system of difference constraints. Because there are edges from the source vertex v0 to all other vertices in the constraint graph, any negative-weight cycle in the constraint graph is reachable from v0. If the Bellman-Ford algorithm returns TRUE, then the shortest-path weights give a feasible solution to the system. for example, the shortest-path weights provide the feasible solution x = (-5, -3, 0, -1, -4), and by Lemma 24.8, x = (d - 5, d - 3, d, d - 1, d - 4) is also a feasible solution for any constant d. If the Bellman-Ford algorithm returns FALSE, there is no feasible solution to the system of difference constraints. • A system of difference constraints with m constraints on n unknowns produces a graph with n+1 vertices and n+m edges. Thus, using the Bellman-Ford algorithm, we can solve the system in O((n + 1)(n + m)) = O(n2 + nm) time.asks you to modify the algorithm to run in O(nm) time, even if m is much less than n. References • Solving Systems of Difference Constraints Incrementally G. Ramalingam,1 J. Song,1 L. Joskowicz,2 and R. E. Miller3 https://link.springer.com/content/pdf/10.1007%2FPL00009261.pdf