Skip to content

num::structures::basic_degree_queue

Defined in header <structures/containers/degree_queue.hpp>

template <std::integral Index = num::idx>
class basic_degree_queue;

Bucket-based degree priority queue maintaining vertices ordered by integer degree. Provides O(1) insert, erase, rekey, and O(1) amortized pop_min for bounded integer degrees.

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 capacity for n vertices.
template <typename DegreeRange> requires (!std::integral<DegreeRange>) explicit basic_degree_queue(const DegreeRange &degrees) Construct and initialize from a container of degrees.
void insert(Index v, Index d) Insert vertex v with degree d.
void erase(Index v) Erase vertex v from the queue.
void rekey(Index v, Index d) Update the degree of vertex v.
Index pop_min() Pop vertex with minimum degree.
Index degree_of(Index v) const Degree of vertex v.
Index min_degree() const Current minimum degree.
bool empty() const noexcept Check if queue is empty.
Index size() const noexcept Number of active elements.
Index capacity() const noexcept Total capacity.
const array<Index> &degrees() const noexcept Direct access to degree array for elimination updates.