Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-graph-concepts.H File Reference

C++20 concepts for the protocol shared by graph algorithms. More...

#include <concepts>
#include <cstddef>
#include <type_traits>
#include <ah-concepts.H>
Include dependency graph for ah-graph-concepts.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::graph_concepts_detail
 

Concepts

concept  Aleph::graph_concepts_detail::AlephGraphImpl
 Unqualified form of AlephGraph, applied to a cv/ref-free type.
 
concept  Aleph::AlephGraph
 A graph usable by the graph algorithms.
 
concept  Aleph::NodeFilter
 A node filter (SN) for graph GT.
 
concept  Aleph::ArcFilter
 An arc filter (SA) for graph GT.
 
concept  Aleph::ArcDistance
 An arc distance (Distance) for graph GT.
 
concept  Aleph::FlowNetwork
 A flow network usable by the max-flow and min-cost algorithms.
 

Typedefs

template<class GT >
using Aleph::graph_concepts_detail::graph_t = std::remove_cvref_t< GT >
 GT with cv-qualifiers and references removed.
 

Detailed Description

C++20 concepts for the protocol shared by graph algorithms.

The graph algorithms have always relied on an implicit protocol for their template parameters. These concepts write down its minimal, common part:

  • AlephGraph<GT> — node/arc types and the core queries every graph algorithm relies on (List_Graph, Array_Graph, List_SGraph, their Digraph<> wrappers, Net_Graph and derivatives).
  • NodeFilter<SN, GT> / ArcFilter<SA, GT> — the SN/SA filters, invoked the way Filter_Iterator invokes them.
  • ArcDistance<D, GT> — the Distance functor: a Distance_Type and a call on an arc. Zero_Distance/Max_Distance/set_zero are not part of it: no algorithm relies on them generally.
  • FlowNetwork<Net> — what the flow algorithms need from a network.

Each concept states a condition every algorithm that constrains with it needs anyway, so it never rejects a type the algorithm would accept; an algorithm may still need more than its concept states.

Warning
Constrain algorithms, never GraphCommon or types used while a graph class is still being defined (iterators, default filters, Dft_Dist): the graph type is incomplete there.
Author
Leandro Rabindranath Leon

Definition in file ah-graph-concepts.H.