CPP-GL: version 2.0.0#109
Merged
SpectraL519 merged 54 commits intomasterfrom Apr 30, 2026
Merged
Conversation
- Updated the license comments and the licence verification script - Created a new `include/hgl` directory with a dummy implementation file - Moved the current CPP-GL test files to a dedicated `tests/source/gl` directory - Created a new `tests/source/hgl` directory with a dummy test file for the HGL module - Aligned the testing CMake file to define executables for the GL and HGL modules separately - Removed the library namespace aliases in test files - Aligned the github workflows to properly execute both GL and HGL module tests
…ation A small cleanup required for the development of HGL - Changed the minimum required C++ standard to C++23 - Changed the minimum required GCC version to 14 and CLang version to 18 - Replaced the usage of `std::optional<bool>` as algorithm predicate result type with a new ternary `predicate_result` type - Removed the `no_return` and `default_return` algorithm-specific types and related concepts; Introduced a `result_discriminator` type in their place - Aligned the documentation
…ge to simple composite types [Part 1] - The `graph` class does not store a list of vertices directly, only the number of vertices and optionally a vertex properties map - Added a vertex property map getter to the `graph` class - Vertices are compared only using IDs within the graph representation models - Removed vertex validation within implementation types - only the `graph` class validates vertices - The properties members of the vertex and edge classes are now private with added getter methods
…e to simple composite types [Part 2] - Modified the `edge_descriptor` class to store only the IDs of its incident vertices - Aligned graph implementation to use vertex IDs instead of descriptor objects for internal operations - Aligned algorithms to use vertex-ID-based callbacks
…e to simple composite types [Part 3] - Aligned the graph's adjacency storage types to store only edge IDs instead of edge pointers - Removed the `iterator_range`, `dereferencing_iterator` and `non_null_iterator` types and replaced them with standard library views - Removed the reference wrapper and optional reference wrapper type aliases - Introduced an `invalid_id` constant and aligned the vertex and edge descriptor types to use this constant for default construction - Enabled copy and move constructors and operators for both vertex and edge descriptor types - Removed the `edge_info` type used for graph MST finding
- Added a `hgl::vertex_descriptor` generic alias for the `gl::vertex_descriptor` type. - Defined the hyperedge directional tag types, i.e. `undirected_t` and `bf_directed_t` - Implemented a simple `hyperedge_descriptor` generic type - Aligned the directional-related type constraints in the `gl` module to match the new `hgl` constraints - Removed redundant `gl` module code
- Defined the implementation tag types for the following models: edge list (default), adjacency list, incidence matrix - Created the `hypergraph_traits` structure with basic type definitions - Defined helper aliases and type constraints for the `hypergraph_traits` structure
- Removed the directional-tag template parameter from the hyperedge descriptor type - Replaced hyperedge directional tag definitions with hypergraph directional tag definitions - Renamed the `edge_list_t` hypergraph implementation tag to `hyperedge_list_t` - Created the `hypergraph` class with basic functionality for creating and manipulating vertices and hyperedges - Aligned the member and method naming in the `gl::graph` class to match the naming in the `hypergraph` class
Created the `impl::undirected_hyperedge_list` model class, which stores a list of hyperedges and their incident vertices and defines the following operations: - Adding and removing vertices - Adding and removing hyperedges - Binding and unbinding vertices to hyperedges - Retrieving the number of vertices incident with a given hyperedge - Retrieving the set of vertices incident with a given hyperedge - Validating whether a vertex is bound to a hyperedge
- Created the `impl::undirected_vertex_list` model class, which stores a list of vertices and their incident hyperedges and define the following operations: - Adding and removing vertices - Adding and removing hyperedges - Binding and unbinding vertices to hyperedges - Retrieving the degree of a vertex - Retrieving the set of hyperedges incident with (containing) a given vertex - Retrieving the number of vertices incident with a given hyperedge - Retrieving the set of vertices incident with a given hyperedge - Renamed the `impl::adjacency_list_t` tag to `impl::vertex_list_t` - Added missing methods to the `impl::undirected_hyperedge_list` class - Aligned the vertex removal logic in the hyperedge-list model to properly unbind the given vertex from all edges and decrement the ids, which are greater than the given vertex id
Created the `impl::undirected_incidence_matrix` model class, which stores a VxE incidence matrix and defines the following operations: - Adding and removing vertices - Adding and removing hyperedges - Binding and unbinding vertices to hyperedges - Retrieving the degree of a vertex - Retrieving the set of hyperedges incident with (containing) a given vertex - Retrieving the number of vertices incident with a given hyperedge - Retrieving the set of vertices incident with a given hyperedge
…cidence list and matrix representation models - Defined new `vertex_major_t` and `hyperedge_major_t` implementation layout tags with utility methods for retrieving the major and minor elements - Replaced the current implementation tags with template `list_t` and `matrix_t` tags parametrized with a storage layout tag - Merged the `undirected_hyperedge_list` and `undirected_vertex_list` classes into a single template class `undirected_incidence_list<LayoutTag>` - Add a `LayoutTag` template parameter to the `unidrected_incidence_matrix` class and aligned its implementation to use layout-dependent behaviour - Aligned the `hypergraph_traits` type and related utility to use the new tags
… for undirected hypergraph operations - Replaced the directional-specific incidence list and matrix classes with template specializations of a common `model<DirectionalTag, LayoutTag>` classes - Aligned the `hypergraph` class to store an implementation class instance - Aligned the following methods of the `hypergraph` class to use the underlying implementation: - Adding and removing vertices - Adding and removing hyperedges - Added the following methods to the `hypergraph` class: - Binding and unbinding vertices to hyperedges - Retrieving the degree of a vertex - Retrieving the set of hyperedges incident with (containing) a given vertex - Retrieving the number of vertices incident with a given hyperedge - Retrieving the set of vertices incident with (contained by) a given hyperedge
1. Created the `impl::incidence_matrix` class specialization for the bf-directed model, which: - Stores a |V| x |E| incidence matrix, where each entry specifies the incidence type between a given vertex and hyperedge - Defines the following operations: - Adding and removing vertices - Adding and removing hyperedges - Binding (tail/head) and unbinding vertices to hyperedges - Retrieving the degree, in-degree, out-degree of a vertex - Retrieving the set of hyperedges incident with, outgoing from, incoming to a given vertex, - Retrieving the number of vertices incident with a given hyperedge and the number of hyperedge's tail/head vertices - Retrieving the set of vertices incident with a given hyperedge and the hyperedge's tail/head vertices 2. Refactored the inner major/minor-specific logic in the existing undirected models to generically handle these operations 3. Renamed the `n_vertices` and `n_hyperedges` methods of the `hypergraph` class to `order` and `size` respectively to follow the proper terminology
1. Created the `impl::incidence_list` class specialization for the bf-directed model, which:
- Stores an incidence list, where each entry contains separate tail and head collections
- Defines the following operations:
- Adding and removing vertices
- Adding and removing hyperedges
- Binding (tail/head) and unbinding vertices to hyperedges
- Retrieving the degree, in-degree, out-degree of a vertex
- Retrieving the set of hyperedges incident with, outgoing from, incoming to a given vertex,
- Retrieving the number of vertices incident with a given hyperedge and the number of hyperedge's tail/head vertices
- Retrieving the set of vertices incident with a given hyperedge and the hyperedge's tail/head vertices
2. Added a `--clang-format-executable` argument to the formatting script
… for bf-directed hypergraph operations - Added compile-time constraints for methods specific to undirected hypergraphs - Added methods specific to bf-directed hypergraphs to the main hypergraph class, including: - head/tail vertices and size getters - in/out hyperedges and degree getters - head/tail binders and incidence checkers
…the incidence list model Aligned the implementation of the bf-directed incidence list model to properly rebind the given vertex and hyperedge if they are already bound in a different set
…e terminology as the hypergraph class Changed the name of the `n_vertices` method to `order` and the name of the `n_edges` method to `size` to follow the hypergraph terminology
- Defined basic hypergraph type concepts - Extended the hypergraph class and internal implementation structures with degree and hyperedge size map getters - Added common utility functions for calculating: - The maximum and minimum vertex degree + in/out for bf-directed hypergraphs - The rank and corank of a hypergraph + maximum and minimum tail/head size for bf-directed hypergraphs
- Implemented the following hypergraph conversions: - Undirected hypergraph projection (clique expansion) - BF-directed hypergraph projection - Incidence graph conversions - Renamed the incoming/outgoing methods of the hypergraph class to use shorter in/out prefixes - Added missing methods for obtaining in/out element id collections - Added missing const qualifierst to element id collection getters
- Extended the `graph` class with `in/out_edges` methods - Replaced relative includes in the `gl` directory with root-relative includes
- Added a new layout tag for the bidirectional implementation layout - Defined a specialization of the `incidence_list` class for the new layout tag which stores both the vertex-major and hyperedge-major lists and delegates operations between them based on the computational complexity
Implemented a generic data structure that represents a 2D vector with a flattened memory layout using two vectors: - The vector of values: A concatenation of all the elements in each inner vectors - The vector of offsets: Used to keep track of inner vector segment bounds
- Moved the segment_vector class to the gl::types namespace - Extended the segment_vector class with a `(n_segments, segment_size)` constructor - Implemented the resize methods in the segment_vector class
- Defined a new implementation tag: `flat_list_t` - Aligned the implementation-tag-related type traits and constraints - Created a new internal specialized implementation classes for the flat adjacency list model
- Defined a helper type trait that swaps out an implementation tag of the graph (traits) type - Implemented a `gl::to<ImplTag>(GraphType&&)` function that converts the source graph representation model to the one defined with the `ImplTag` template parameter - Added topology generator function overloads for the flat-list representation model that generate the graph topology using the `impl::list_t` model and then convert them to `impl::flat_list_t` model - Added an `edge_ids` method to the graph class
- Defined a new hypergraph implementation tag: `flat_list_t<LayoutTag>` - Aligned existing and added new implementation-tag-related type traits - Created a new internal implementation class: `flat_incidence_list` with specializations for each layout tag - Moved header files from the `hgl/types/` directory to `hgl/` - Extended the `segmented_vector` class with the following methods: - Data getters: `data_view()` (previously `data()`), `data_storage()`, `data_ptr()` - Offsets getters: `offsets_view()`, `offsets_storage()`, `offsets_ptr()` - Other: `empty(seg)`
- Defined a helper type trait that swaps out an implementation tag of the graph (traits) type - Renamed the hgl/converters.hpp file to hgl/conversion.hpp - Implemented a generic `hgl::to<ImplTag>(HypergraphType&&)` function that converts the source hypergraph representation model to the one defined with the `ImplTag` template parameter - Implemented an equality comparison operator for the hypergraph class - Implemented a `hgl::clone` function(s) that would allow the user to explictly clone hypergraphs - Changed the layout of the BF-directed incidence list hypergraph model from AoS to SoA
- Implemented the `gl::clone` function which creates a deep copy of the source graph - Implemented an equality comparison operator for the `graph` class
…ents - Renamed the `gl/types/types.hpp` file to `gl/types/core.hpp` - Moved the `gl/types/type_traits.hpp` file to the root gl directory and renamed it to `traits.hpp` - Changed the `<module>::type_traits` namespaces to `<module>::traits` - Renamed the `gl/edge_tags.hpp` file to `directional_tags.hpp` and the `c_edge_directional_tag` concept to `c_graph_directional_tag`. Aligned the `graph` and `graph_traits` types to use type names that match the new naming - Reorganized the file structure of the `gl/algorithm/` directory - Refactored common algorithm module types, traits, and constants, including: - Replacing the `predecessors_descriptor` type with a `predecessors_map = std::vector<types::id_type>` alias - Simplifying the `paths_descriptor` type - Renaming the `alg_return_type` and `alg_return_type_non_void` aliases to `return_type` and `non_void_return_type` - Moving the elements from the `gl::algorithm::impl` and `gl::algorithm::detail` namespaces to `gl::algorithm` - Aligned the `hgl` module to properly utilize elements from the changed `gl` module
…ents (part 2) - Removed the `gl::types` and `hgl::types` namespaces. All elements that were previously defined in these namespaces are now directly in `gl::` and/or `hgl::` namespaces - Removed the `GL_CONFIG_PROPERTY_TYPES_NOT_FINAL` macro usage. All property types are now final - Simplified the `name_property` type - Removed redundant testing constants and namespaces
…rait - Removed the `gl::id_type` alias and added a `gl::default_id_type = std::uint32_t` alias - Defined a constexpr `gl::to_idx(id) -> size_type` utility function - Extended the `graph_traits` class with an `IdType` template parameter which must be an unsigned integral type - Aligned the `graph` class to use a instantiation-specific id type configurable through the graph traits - Refactored the algorithm implementations and utility to work properly with the new design - Removed the usage of `std::optional<id_type>` parameters and ranges in algorithm output descriptors - Replaced the `initial/invalid_id` and the `no_root_vertex` constants with empty tag types - TEMPORARILY removed the documentation pages (will be added back in the next major release)
…raph trait - Extended the implementation tag structures with an `IdType` template parameter and and `id_type` alias - Aligned the implementation classes to use the implementation tag as a template parameter instead of the layout tag and to use the id type defined in the implementation tag - Extended the `hypergraph_traits` structure with an `id_type` alias - Aligned the hypergraph-traits-ralated concepts and template aliases to properly handle the additional id type parameter - Replaced the usage of the common id type with a configurable id type in the `hypergraph` class - Removed the `id_type` common alias and added a new `default_id_type = std::uint32_t` (from the GL module` - Replaced the `constanst::invalid/initial_id` constants with generic tag types
Implemented a generic data structure that represents a 2D matrix with a flattened memory layout
- Defined a new graph implementation tag: `flat_matrix_t` - Aligned the implementation-tag-related constraints and generic type aliases - Created a new internal implementation class: `flat_adjacency_matrix` - Aligned the existing adjacency matrix implementation classes to properly utilize the new flat model class - Implemented `to_impl` conversion type specializations for matrix - flat-matrix model conversions
- Added the `benchmarks` directory containing the initial library benchmarks implementation - Defined the benchmark suite and runner classes responsible for proper setup and execution of CPP-GL benchmarks - Implemented a simple benchmark: bipartiteness verification of a K_n,n biclique - Added the `benchmarks` smoke test workflow
- Fixed settings compilation flags for testing targets - Aligned the implementation to satisfy all warnings - Added missing tests - Implemented a basic `concat_view` structure in order to work around the GCC's false-positive warnings
- Defined a new implementation tag: `flat_matrix_t` - Aligned the implementation-tag-related constraints - Created a new internal implementation class `flat_incidence_matrix` with specializations for each layout tag - Aligned the implementation of `flat_matrix` and `flat_jagged_vector` to use subranges instead of spans as row/segment types to work properly with the boolean value type
- Modified the runner class to be a singleton - Refactored the Is-Bipartite suite to automatically register itself within the runner - Added a new `--suites` argument to the runner's argument parser - Defined an explicit CMake parameter for including Boost benchmarks - Aligned the benchmark project's README file
- Defined core hypergraph algorithm utility - Implemented generic hypergraph traversal templates: BFS and DFS - Implemented concrete hypergraph searching algorithms: - Common: breadth_first_search and depth_first_search - Specific for BF-Hypergraph: backward_bfs, backward_dfs, forward_bfs, forward_dfs - Performed a cleanup and naming alignment of the gl::algorithm module
- Corrected the names of the edge getter methods in the gl module: from adjacent_edges to incident_edges - Changed the name of the incident_vertex method of the edge_descriptor class to other - Align the variables, comments, etc. to be consistent with the new naming scheme
- Extended the graph class with missing vertex collection getters: - Descriptor getters: neighbors, predecessors, successors - ID getters: neighbor_ids, predecessor_ids, successor_ids - Fixed the incident_edges logic error: - Previously the function always called out_edges, which is correct for undirected graphs but not for directed graphs - Extended the internal implementation classes with specific incident edges getters - Aligned the graph class methods to use the proper underlying implementation type's methods - Changed the are_incident method names for vertex pairs and edge pairs to use the proper term (are_adjacent) - Cleaned up the layout of methods in the graph class and the implementation classes - Cleaned up the gl module tests
- Refactored the options_manip class (previously stream_options_manipulator) to use a set and a clear mask instead of only the set mask - Aligned the options_manip constants and utility - Refined the GL module's I/O implementation and output formatting - Defined generic formatter types: range_formatter, implicit_range_formatter - Implemented the I/O utility for the HGL module - Added missing const qualifiers for hypergraph getter methods
…methods - Implemented binding methods for undirected hypergraphs: - bind(vertices, hyperedge) - bind(vertex, hyperedges) - bind(vertices, hyperedges) - Implemented corresponding methods for head/tail binding for BF-directed hypergraphs - Implemented hyperedge adding methods: - add_hyperedge(vertices) for undirected hypergraphs - add_hyperedge(tail, head) for BF-directed hypergraphs - Aligned HGSF deserialization to use the new range-based methods - Aligned hypergraph tests to use the new range-based methods
- Added generic graph class aliases: - Directional: directed_graph, undirected_graph - Implementation: list_graph, flat_list_graph, matrix_graph, flat_matrix_graph - Removed the generic vertex and edge aliases - Renamed the order and size methods of the graph class to n_vertices and n_edges respectively (Least Astonishment) - Removed the get_ prefixes from graph class getter methods - Added new vertex_unchecked method and convenience vertex accessors: operator[id], at(id) - Added missing neighbor/predecessor/successor collection getters for vertex descriptor arguments - Extended vertex and edge descriptor classes with operator* and operator-> property accessors - Aligned the HGL module and the benchmarks project to use new method names
- Added generic hypergraph class aliases: - Directional: undirected_hypergraph, bf_directed_hypergraph - Implementation: list_hypergraph, flat_list_hypergraph, matrix_hypergraph, flat_matrix_hypergraph - Renamed the order and size methods of the hypergraph class to n_vertices and n_hyperedges (Least Astonishment) - Renamed the tail/head collection getters: - Descriptor collections: tail_vertices, head_vertices to tail, head - ID collections: tail_vertex_ids, head_vertex_ids to tail_ids, head_ids - Removed the get_ prefixes from hypergraph class getter methods - Added new vertex_unchecked and hyperedge_unchecked methods - Defined the vertex_t and hyperedge_t element tag types - Implemented convenience element accessors in the hypergraph class: at(<tag>, id) and operator[](<tag>, id) - Extended hyperedge descriptor class with operator* and operator-> property accessors
- Replaced the std::vector<std::unique_ptr<T>> containers with std::vector<T> for hypergraph element property storage - Aligned the names of CMake testing and benchmark targets
Replaced the std::vector<std::unique_ptr<T>> containers with std::vector<T> for hypergraph element property storage
- Updated the project license - Added the Doxyfile and mkdocs.yml configuration files and a Makefile with documentation targets - Added documentation comments to the public API elements of the GL module - Prepared the tutorial pages and images for the GL module's documenation - Defined a utility script for generating documentation pages for the library's concepts - Renamed the `return_type` and `non_void_return_type` and related utility to use the `result` naming - Modified the PFS template implementation to accept arbitrary* search nodes - Renamed the `enqueue vertex predicate` types and arguments for algorithm templates to use the (search) node naming - Fixed the Dijkstra's algorithm implementation to properly utilize custom PFS search nodes and properly handle distance comparison within the min heap - Removed unused/redundant elements
- Added documentation comments to the public API elements of the HGL module - Prepared the tutorial pages and images for the HGL module's documentation - Extended the groups.dox file with HGL module's group definitions - Moved the hypergraph property algorithms to a dedicated file: `hgl/algorithm/properties.hpp" - Aligned the implementation of the undirected hypergraph projection to properly handle single-vertex hyperedges (convert them into self-loops)
SpectraL519
commented
Apr 30, 2026
- Changed the naming of graph and hypergraph structural tags from implementation to representation tags and moved them to dedicated `repr` namespaces - Removed the duplace group tags in the GL module - Updated the README.md and index.md documents - Added the documentation workflow - Added the version checking script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core Changes: