|
ADS
Algorithms and Data Structures
|
Greedy algorithms on intervals \( [ a_i , b_i ) \) of the line: More...
#include "ADS/Contract.h"#include <algorithm>#include <cmath>#include <cstddef>#include <numeric>#include <utility>#include <vector>#include "ADS/optimization/impl/Intervals.tpp"Go to the source code of this file.
Namespaces | |
| namespace | ADS |
Functions | |
| std::vector< std::size_t > | ADS::independentSet (const std::vector< std::pair< long, long > > &I) |
| the places of a largest set of disjoint intervals \( [ a , b ) \), in increasing order | |
| std::vector< int > | ADS::intervalColoring (const std::vector< std::pair< long, long > > &I) |
| the colors, from 0, of the intervals \( [ a , b ) \), the fewest possible | |
| std::vector< double > | ADS::towers (std::vector< double > k, double d) |
| the fewest towers such that each house is within \( d \) of one (the torri() of the book) | |
Greedy algorithms on intervals \( [ a_i , b_i ) \) of the line:
The contracts [see Contract.h]: each interval \( [ a , b ) \) has \( a < b \), and \( d \ge 0 \); the independent set is made of disjoint intervals, the coloring gives different colors to intersecting ones, and every house is within \( d \) of a tower (checked at level 3). The operations are defined in Intervals.tpp.