num::structures::basic_degree_queue¶
Defined in header <structures/containers/degree_queue.hpp>
template <std::integral Index = num::idx>
class basic_degree_queue;
Queue of vertices kept in buckets by degree: \(O(1)\) updates, amortized pop_min.
Members¶
| member | description |
|---|---|
using index_type = Index |
|
static constexpr Index none = static_cast<Index>(-1) |
|
explicit basic_degree_queue(Index n = 0) |
Construct an empty queue with room for n vertices. |
template <typename DegreeRange> requires (!std::integral<DegreeRange>) explicit basic_degree_queue(const DegreeRange °rees) |
Construct a queue from a range of degrees. |
void insert(Index v, Index d) |
Insert vertex v with degree d. |
void erase(Index v) |
Remove vertex v. |
void rekey(Index v, Index d) |
Set the degree of v to d. |
Index pop_min() |
Remove and return a vertex of least degree. |
Index degree_of(Index v) const |
Return the degree of v. |
Index min_degree() const |
Return the least degree. |
bool empty() const noexcept |
Test whether the queue is empty. |
Index size() const noexcept |
Return the number of vertices in the queue. |
Index capacity() const noexcept |
Return the capacity. |
const array<Index> °rees() const noexcept |
Return the array of degrees. |