Dynamic Planning, Dijkstra algorithm, a * algorithm comparison

Source: Internet
Author: User

 

The framework of dynamic planning, Dijkstra algorithm, and a * algorithm is the same. The difference lies only in the selection of propulsion points and the termination condition of the algorithm ".
I. Dynamic Planning: (See http://blog.csdn.net/iwantnon/archive/2009/07/07/4329269.aspx
)
Push point selection:
(1) In the rough Dynamic Planning Algorithm:
Instead of selecting any existing nodes, we will push them all over again. This may cause two waste points:
[1] repeated promotion: V has been promoted, and the next time it is promoted without changing its valu value, obviously this second promotion won't get any new things, so it's in vain.
[2] propulsion failure: after a certain point V is promoted, the point U is promoted again, And the u just refreshes the Valu value of the point v, so the promotion made by point V was ineffective (the new valu value of point V should be used for re-promotion ).
(2) In the dynamic planning algorithm with open tags:
After the point V is pushed, close it (so that v. open = false), because only the enabled vertex is selected when you select a push point, this avoids repeated push of point v, unless the V-point valu value is refreshed and becomes enabled again (v. open = true) status. That is to say, we solved the "repeated promotion" problem, but did not solve the "promoted failure" problem.
Termination conditions:
Whether in a rough dynamic planning algorithm or a dynamic planning algorithm with open tags, in order to ensure that the optimal value of the endpoint is obtained, it must be "fully promoted"-that is, promoted | v |-once.
II, Dijkstra algorithm :( see: http://blog.csdn.net/iwantnon/archive/2009/07/07/4329316.aspx

)
Push point selection:
Dijkstra
The algorithm is built on a dynamic planning algorithm with open tags. However, when selecting a push point, only the vertices V ("Polar element") with the Valu value reaching the final state are selected "). Because the Valu value of V has reached the final state, it does not
It may be refreshed by other points, so as to avoid "Failure of pushing ". So what kind of points can be used as "Polar yuan? Whether the polar element exists and how to construct it depends on the specific problem. For example:
(1) In the "non-negative weighted Shortest Path" issue, the smallest vertex v of DIS can be used as "Polar element" because the ownership value is not negative, so after other points are pushed, the DIS value will be greater than the DIS value of V, so it is impossible to refresh v.
(2), such as the problem of "Sales Promotion combination" (Note), the State coordinates can be separated from st. the state point V with the smallest loc Euclidean distance (or Manhattan distance) is "Polar element", because it is the distance from St after other points are pushed. the Euclidean distance (or the Manhattan distance) of LOC will be further increased, making it impossible to refresh the V point.
(3) In "Optimal Arrangement problem" (for example, "Traveling Salesman Problem" and "process problem, we can take the used object set S with the minimum state point V as the "Polar element", because the object set will be further expanded after all other State points are pushed forward, it is impossible to fl to v.
It can be seen that the structure of "Polar element" often depends on the monotonicity of a feature volume during the promotion process.
Termination conditions:

By
In Dijkstra algorithm, the minimum element is disabled after each advance, and because its valu value has reached the final state, it will not be refreshed, so it will not be enabled again. That is to say: Dijkstra
In the algorithm, the open = false point at any time is the point where the Valu has reached the final state. Therefore, once ed. Open = false, the program can be terminated. In some situations
Must be pushed to full | v |-1 times to save.

Note: Promotion portfolio issues:
1), Min type: There are three types of products a, B, c, 1A = 3 yuan, 1B = 2 yuan, 1C = 4 yuan. It also provides the following combinations: 1A + 1B = 4 yuan, 1A + 2B + 1C = 9 yuan, 1b + 1C = 5 yuan. I want to buy 8A + 9B + 9C. How much does it cost at least?
2), Max: There are three items A, B, and C. Buy 1a to give 3 gifts, buy 1B to give 2 gifts, and buy 1C to give 4 gifts. In addition, we provide the following combinations: Buy 1A + 1B for 8 gifts, buy 1A + 2B + 1C for 13 gifts, and buy 1b + 1C for 7 Gifts. I want to buy 8A + 9B + 9C. How many gifts can I get?
3, A * algorithm :( see: http://blog.csdn.net/iwantnon/archive/2009/07/07/4329286.aspx
)
Push point selection:
A * algorithm also promotes only one point at a time, but it is the best point to select the current evaluation value (note 1.
Because the best value for evaluation is not necessarily a polar element, the * algorithm "cannot be promoted", but as long as the number of advances is sufficient (for example, when it is pushed to all nodes ), obviously, the * algorithm can obtain the optimal solution.
However, the goal of the * algorithm is to get satisfactory results quickly (with fewer advances. Therefore, it is often similar to the Dijkstra algorithm. When Ed. Open = false, the program is closed (note 2 ). Because the * algorithm cannot ensure that all nodes in the closed state have reached the final state as the Dijkstra algorithm, it obtains the approximate optimal solution.
Note 1: Evaluation value = costed + willcost (or wined + willwin), where costed (or wined) is the current valu value, while willcost (or willwin) needs to be estimated to determine.
NOTE 2: If it ends when all nodes are closed, the state space includes all States, so the space complexity is the same as that of dynamic planning (and thus higher than Dijkstra algorithm ). Due to the existence of "propulsion failure", the time complexity is also higher than that of Dijkstra algorithm.
Termination conditions:
As mentioned above, the * algorithm is usually terminated when Ed. Open = false.

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.