Max flow-SAP-improved shortest augmenting

Source: Internet
Author: User

Ford-Fulkerson, dinic, ISAP, and EK are all SAP

It is based on finding a shortest short circuit and then performing an increment.Algorithm

 

However, sap in general should beISAP (improved shortest augmenting paths)

He doesn't need to use BFs to find a shortest path like Ek, and then perform the increment operation.

Instead of searching for the path again, we only need to find the shortest path, and then calculate the shortest distance from the shortest path.

Therefore, the bfs o (e) time can be reduced to O (V). Therefore, the ek O (VE ^ 2) can be reduced to O (V ^ 2e)

The time interval is the same as that of dinic.

 

Algorithm step:

1. Perform BFS on the sink to find the shortest distance from the sink (in fact, this step is not required, but it should be set to zero from the sink)

2. The source serves as the frontend, and finds out the distance from this point to the sink, which is 1 less than the distance from the original point to the sink.

3. If such a point exists, the point will be used as the first point for searching

If this is sink, find the maximum stream of the worker and modify the residual graph along the incremental path.

If such a point does not exist, modify the distance value to find the point to which the previous point is reached, and the amount of traffic consumed during the past period needs to exist, find the shortest point between Sink and sink.

And update the distance from the current vertex to the distance value + 1, and set the previous vertex to the previous vertex.

4. Until the source does not have a route entry to the sink

 

The operation time is the same as that of dinic, and the effect is not satisfactory. Unfortunately, it cannot be listed.

It can be seen that my maximum stream is still not fast ....

 

[Transfer] http://kuoe0.pixnet.net/blog/post/18790432-%5Balgorithm%5Dmax-flow---sap---improved-shortest-augmenting-pat

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.