Skip to content

YT-CPPGL-56: Replace the usage of pointers for vertex and edge storage to simple composite types [Part 3]#59

Merged
SpectraL519 merged 22 commits into
hgl-masterfrom
edge-ids
Nov 12, 2025
Merged

YT-CPPGL-56: Replace the usage of pointers for vertex and edge storage to simple composite types [Part 3]#59
SpectraL519 merged 22 commits into
hgl-masterfrom
edge-ids

Conversation

@SpectraL519

@SpectraL519 SpectraL519 commented Nov 12, 2025

Copy link
Copy Markdown
Owner
  • 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

Copilot AI review requested due to automatic review settings November 12, 2025 20:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fundamentally refactors the graph library's storage model, replacing pointer-based storage of vertices and edges with ID-based storage. The changes eliminate custom iterator wrappers in favor of standard library views and modify vertex/edge descriptors to use value semantics with reference-based property access.

Key Changes:

  • Replaced edge pointer storage with edge ID storage in adjacency structures
  • Removed custom iterator types (iterator_range, dereferencing_iterator, non_null_iterator) in favor of standard library views
  • Changed vertex and edge descriptors from non-copyable pointer-based objects to copyable value types with optional property references
  • Introduced invalid_id constant for marking invalid/removed elements

Reviewed Changes

Copilot reviewed 58 out of 58 changed files in this pull request and generated no comments.

Show a summary per file
File Description
include/gl/vertex_descriptor.hpp Changed from non-copyable to copyable; properties now accessed via reference wrapper; added is_valid() and invalid() methods
include/gl/edge_descriptor.hpp Stores vertex IDs instead of vertex references; added ID field; properties via reference wrapper; added validity checks and equality operators
include/gl/edge_tags.hpp Removed pointer type aliases and factory functions; simplified to only directional tag functionality
include/gl/graph.hpp Major refactor: stores vertex/edge properties in separate vectors; methods now work with IDs; removed pointer-based logic
include/gl/impl/adjacency_matrix.hpp Changed from storing edge pointers to edge IDs; returns views/ranges instead of custom iterators
include/gl/impl/adjacency_list.hpp Uses adjacency_list_item structure with edge ID and target ID; returns views instead of custom iterators
include/gl/impl/specialized/*.hpp Updated to work with ID-based storage; simplified edge removal logic
include/gl/types/properties.hpp Added property concepts (c_empty_properties, c_non_empty_properties)
include/gl/types/types.hpp Removed reference wrapper type aliases
include/gl/constants.hpp Added invalid_id constant
include/gl/util/ranges.hpp New utility file with deref_view and range_size helpers
tests/**/*.cpp Updated all tests to use new API patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/gl/algorithm/types.hpp Outdated
Comment thread include/gl/algorithm/types.hpp
Comment thread include/gl/util/ranges.hpp
Copilot AI review requested due to automatic review settings November 12, 2025 20:43

@SpectraL519 SpectraL519 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SpectraL519 SpectraL519 merged commit 87241cd into hgl-master Nov 12, 2025
4 checks passed
@SpectraL519 SpectraL519 deleted the edge-ids branch November 12, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants