1#ifndef GRAPHLIB_INTERNAL_EDGE_H
2#define GRAPHLIB_INTERNAL_EDGE_H
18namespace GraphLib::Internal {
25template <val
id_
id_type I>
83template <val
id_
id_type I>
96template <val
id_
id_type I, val
id_weight_type W>
117 return this->weight < right.
weight;
143 template <
typename D>
147 os << value <<
" (" << this->weight <<
")";
162template <val
id_
id_type I, val
id_weight_type W>
std::ostream & operator<<(std::ostream &os, const Graph< D, I, E > &graph)
Stream insertion operator for any valid graph type.
Checks whether a type supports streaming to std::ostream.
Placeholder for user-defined data types used in vertices or edges.
Defines C++20 concepts used for type constraints in the GraphLib library.
Represents an unweighted edge to a node identified by an ID.
id_type node_id
The ID of the node this edge points to.
bool operator<(const Edge &right) const
Less-than operator comparing node IDs.
bool operator==(const Edge &other) const
Equality operator comparing node IDs.
I id_type
Alias for the node ID type.
void print_with_data(std::ostream &os, D value) const
Prints an unweighted Edge with its data instead of ID.
Represents a weighted edge to a node identified by an ID, with an associated weight.
W weight_type
Alias for the weight type.
bool operator<(const WeightedEdge &right) const
Less-than operator comparing node IDs and weights.
void print_with_data(std::ostream &os, D value) const
Prints an weighted Edge with its data instead of ID.
weight_type weight
The weight associated with this edge.
bool operator==(const WeightedEdge &other) const
Equality operator comparing both node IDs and weights.