On the method of constructing the differential constrained system

Source: Internet
Author: User
The differential constraint system is only one application of the shortest path algorithm, there is no new algorithm, but the determination of the specific problem of the method of building the map

The problem solved by the differential constraint system is the solution of the inequality group:

x1-x2 <= 0
x1-x5 <=-1
x2-x5 <= 1
x3-x1 <= 5
x4-x1 <= 4
x4-x3 <=-1
x5-x3 <=-3
x5-x4 <=-3

This is an inequality group, given the inequality group exists only less than equals, if there is an individual equation is greater than equals, we can by both sides at the same time multiply-1 to get a uniform inequality in the direction of the inequalities group.

This inequality group must be both a solution and an infinite number of solutions, because if there is any set of solutions, {x1,x2,x3,x4,x5}, we can get a new solution through {x1+k,x2+k,x3+k,x4+k,x5+k}. So the number of solutions is countless.

Since each number is plus k, the difference between their arbitrary two numbers is constant, so there is no effect on inequalities. a method to solve the problem of differential constraint--and its solution

1. For a group of inequalities that are all <=, we can convert each to Xi<=xj+w (i,j), then build an edge, Xj->xi=w (I,J), and then solve the problem with the shortest path, and in the case of x0 death, the minimum value is obtained.

2. For a group of inequalities that are all >=, we can convert each to Xi>=xj+w (i,j), then build an edge, Xj->xi=w (I,J), and then use the longest path to solve the problem, in the case of x0 dead, the maximum value

If DIS[XI] is INF or-inf, then Xi is an arbitrary solution

If a negative ring appears in the process of finding the shortest circuit, then the proof of the method and solution of the non-solution of the inequality group is shown.

1. We stipulate here Dis[x] is the value of Xi, then in the shortest way results we guarantee that if there are two points connected, Dis[i]-dis[j] <= W (i,j), exactly and inequalities in the group, x0 dead, equivalent to the original point dis[s]== c A Fixed constant value, then the equivalent of Dis[i] is the smallest, then the equivalent to obtain the smallest solution;

The correspondence of the 2.>= and the longest road is similar;

3. When Dis[xi]==inf or-inf, then proves that there is no path between the current point and the origin, then we can not get a set of definite solution, there is no optimal solution;

4. When there is a negative ring, prove that there is no solution, because there is a negative ring,;

Xi <= Xj + A

Xj <= Xi + b

If there is a negative ring when a+b<0,

At this time, two formula add, Xi+xj <= xi+xj+a+b, if a+b<0, then 0<= a+b, contradiction. So the equation has no solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.