[Reprint] [greedy] various coverage problems

Source: Internet
Author: User

1. Independent interval Problems

Find the maximum number of intervals that do not cover each other in N intervals

Sort the ending point, and then select from the interval with the smallest ending point.

 

2. Coverage Interval

Give a large interval, then give n cells, and find the minimum number of intervals to cover the large interval.

First select the start vertex, then select the maximum ending vertex range of the Start vertex, and so on.

 

3. minimum vertex coverage of the Interval

Returns n intervals and calculates the smallest number of points so that each interval has at least one vertex.

Method 1) sort the ending points (from small to large), and then sort the last vertex labels of each interval in sequence (you must determine whether the end points have been marked)

Method 2) sort the start point (from large to small), and label the start point of each interval in sequence (you must determine whether the start point has been marked)

Method 3) first remove the intervals that contain other intervals, then sort the start point, and then mark the end point from small to large (you must determine whether it has been marked)

 

4. minimum interval coverage of a vertex

N points are given and covered with m intervals to minimize the total number of intervals.

Sorts the gaps between neighboring points from large to small, overwrites all points with a large interval, and then disconnects the gaps from each other.

[Reprint] [greedy] various coverage problems

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.