Skip to content

Commit af9ec04

Browse files
committed
impl tags docs refinement
1 parent b3982aa commit af9ec04

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

include/hgl/hypergraph.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ struct to_impl;
210210
/// | HypergraphTraits | The core configuration type specifying the behavior and representation of the hypergraph. | [**c_instantiation_of<hypergraph_traits>**](gl_concepts.md#gl-traits-c-instantiation-of) |
211211
///
212212
/// ### See Also
213-
/// - @ref hgl::hypergraph_traits "hypergraph_traits" for configuring the underlying properties and tags.
214-
/// - @ref gl::io::options_manip "options_manip" for custom stream formatting options.
215-
///
216-
/// ### See Also
217213
/// - @ref hgl::undirected_hypergraph "undirected_hypergraph" : Convenience alias for undirected hypergraphs.
218214
/// - @ref hgl::bf_directed_hypergraph "bf_directed_hypergraph" : Convenience alias for BF-directed hypergraphs.
219215
/// - @ref hgl::clone "clone" : Create a deep copy of a hypergraph.

include/hgl/impl/impl_tags.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ namespace hgl::impl {
1919
/// @ingroup HGL-Core
2020
/// @headerfile hgl/impl/impl_tags.hpp
2121
/// @brief Tag struct for the standard incidence list hypergraph implementation.
22+
///
23+
/// ### Layout Implications
24+
/// The chosen layout significantly impacts memory usage and query performance:
25+
///
26+
/// - @ref hgl::impl::bidirectional_t "bidirectional_t" (Default): Maintains two internal lists (vertex-to-hyperedges and hyperedge-to-vertices). Provides optimal $O(1)$ degree/size lookups and fast traversals in both directions at the cost of doubled memory consumption.
27+
/// - @ref hgl::impl::vertex_major_t "vertex_major_t": Maintains only a vertex-to-hyperedges list. Highly memory efficient and fast for querying vertex degrees or incident hyperedge sets, but querying hyperedge sizes or incident vertex setss requires expensive full-hypergraph scans.
28+
/// - @ref hgl::impl::hyperedge_major_t "hyperedge_major_t": Maintains only a hyperedge-to-vertices list. Memory efficient and fast for hyperedge-centric queries, but querying vertex degrees or incident hyperedge sets requires full-hypergraph scans.
29+
///
2230
/// @tparam LayoutTag Specifies the memory layout orientation for the underlying data structure.
2331
/// @tparam IdType The underlying integer type used for identifiers.
2432
template <traits::c_hypergraph_layout_tag LayoutTag, traits::c_id_type IdType>
@@ -40,6 +48,14 @@ struct list_t {
4048
/// @ingroup HGL-Core
4149
/// @headerfile hgl/impl/impl_tags.hpp
4250
/// @brief Tag struct for the flattened incidence list hypergraph implementation.
51+
///
52+
/// ### Layout Implications
53+
/// The chosen layout significantly impacts memory usage and query performance:
54+
///
55+
/// - @ref hgl::impl::bidirectional_t "bidirectional_t" (Default): Maintains two internal flattened lists (vertex-to-hyperedges and hyperedge-to-vertices). Provides optimal $O(1)$ degree/size lookups and fast traversals in both directions at the cost of doubled memory consumption.
56+
/// - @ref hgl::impl::vertex_major_t "vertex_major_t": Maintains only a vertex-to-hyperedges flattened list. Highly memory efficient and fast for querying vertex degrees or incident hyperedge sets, but querying hyperedge sizes or incident vertex sets requires expensive full-graph scans.
57+
/// - @ref hgl::impl::hyperedge_major_t "hyperedge_major_t": Maintains only a hyperedge-to-vertices flattened list. Memory efficient and fast for hyperedge-centric queries, but querying vertex degrees or incident hyperedge sets requires full-graph scans.
58+
///
4359
/// @tparam LayoutTag Specifies the memory layout orientation for the underlying data structure.
4460
/// @tparam IdType The underlying integer type used for identifiers.
4561
/// @see @ref gl::flat_jagged_vector "flat_jagged_vector" for the data structure used for the underlying model implementation.
@@ -62,6 +78,13 @@ struct flat_list_t {
6278
/// @ingroup HGL-Core
6379
/// @headerfile hgl/impl/impl_tags.hpp
6480
/// @brief Tag struct for the standard incidence matrix hypergraph implementation.
81+
///
82+
/// ### Layout Implications
83+
/// Matrix implementations strictly require an asymmetric layout tag to define the row and column dimensions of the underlying matrix:
84+
///
85+
/// - @ref hgl::impl::hyperedge_major_t "hyperedge_major_t" (Default): Stores a \f$\vert E \vert \times \vert V \vert\f$ matrix, where hyperedges are mapped to rows and vertices to columns. Retrieving the vertices incident to a specific hyperedge translates to a fast, cache-friendly contiguous memory read across a single row.
86+
/// - @ref hgl::impl::vertex_major_t "vertex_major_t": Stores a \f$\vert V \vert \times \vert E \vert\f$ matrix, where vertices are mapped to rows and hyperedges to columns. Retrieving the hyperedges incident to a specific vertex translates to a fast, contiguous memory read.
87+
///
6588
/// @tparam LayoutTag Specifies the memory layout orientation for the underlying data structure (must be asymmetric).
6689
/// @tparam IdType The underlying integer type used for identifiers.
6790
template <traits::c_hypergraph_asymmetric_layout_tag LayoutTag, traits::c_id_type IdType>
@@ -83,6 +106,13 @@ struct matrix_t {
83106
/// @ingroup HGL-Core
84107
/// @headerfile hgl/impl/impl_tags.hpp
85108
/// @brief Tag struct for the flattened incidence matrix hypergraph implementation.
109+
///
110+
/// ### Layout Implications
111+
/// Matrix implementations strictly require an asymmetric layout tag to define the row and column dimensions of the underlying matrix:
112+
///
113+
/// - @ref hgl::impl::hyperedge_major_t "hyperedge_major_t" (Default): Stores a \f$\vert E \vert \times \vert V \vert\f$ flat matrix, where hyperedges are mapped to rows and vertices to columns. Retrieving the vertices incident to a specific hyperedge translates to a fast, cache-friendly contiguous memory read across a single row.
114+
/// - @ref hgl::impl::vertex_major_t "vertex_major_t": Stores a \f$\vert V \vert \times \vert E \vert\f$ flat matrix, where vertices are mapped to rows and hyperedges to columns. Retrieving the hyperedges incident to a specific vertex translates to a fast, contiguous memory read.
115+
///
86116
/// @tparam LayoutTag Specifies the memory layout orientation for the underlying data structure (must be asymmetric).
87117
/// @tparam IdType The underlying integer type used for identifiers.
88118
/// @see @ref gl::flat_matrix "flat_matrix" for the data structure used for the underlying model implementation.

0 commit comments

Comments
 (0)