Skip to content

Conversation

@fabratu
Copy link
Member

@fabratu fabratu commented May 17, 2024

Currently, the PR is in draft mode. The plan is to extract and move functionality out of the graph data structure, which might be useful for other graph types (e.g. Hypergraphs). The graph type and basic data type (e.g. edge) should be deduced by template.

ToDo:

  • Move attributes to a separate header
  • Move node iterators to a separate header
  • Move edge iterators to a separate header
  • Add unsafe helper functions for fast external edge access
  • Move neighbor iterators to a separate header

@fabratu fabratu force-pushed the 20240514_extract_graph_attributes branch from 24b187d to b8cb91e Compare May 24, 2024 06:49
@fabratu fabratu marked this pull request as ready for review May 24, 2024 08:42
Copy link

@bernlu bernlu left a comment

Choose a reason for hiding this comment

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

one inconsistency I noticed: for some iterator files we define a shorthand (using VLN = VeryLongName) and for others we do not. The ones that are defined are not used that much. Maybe we should just remove them to make everything a bit more consistent and readable? (at least outside of the specific class files: in graph.hpp its not so obvious what EIB is).


template <>
void Graph::ASB<Graph::PerNode>::checkPremise() const {
void ASB<PerNode, Graph>::checkPremise() const {
Copy link

Choose a reason for hiding this comment

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

these four methods should be defined in a Attributes.cpp and not in Graph.cpp?


template <>
void Graph::ASB<Graph::PerEdge>::checkPremise() const {
void ASB<PerEdge, Graph>::checkPremise() const {
Copy link

Choose a reason for hiding this comment

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

second ASB method


template <>
void Graph::ASB<Graph::PerNode>::indexOK(index n) const {
void ASB<PerNode, Graph>::indexOK(index n) const {
Copy link

Choose a reason for hiding this comment

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

third ASB method


template <>
void Graph::ASB<Graph::PerEdge>::indexOK(index n) const {
void ASB<PerEdge, Graph>::indexOK(index n) const {
Copy link

Choose a reason for hiding this comment

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

fourth ASB method

}

template <>
bool EIB<Graph>::validEdge() const noexcept {
Copy link

Choose a reason for hiding this comment

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

I think it would be better not to use the shorthand here to make it easier to read for someone who did not read the iterator file yet.

Also, again: this is a method definition for an iterator and should be defined in EdgeIterators.cpp and not in Graph?

}

template <>
Edge EdgeTypeIterator<Graph, Edge>::operator*() const noexcept {
Copy link

Choose a reason for hiding this comment

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

another non-graph method

}

template <>
WeightedEdge EdgeTypeIterator<Graph, WeightedEdge>::operator*() const noexcept {
Copy link

Choose a reason for hiding this comment

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

another non-graph method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants