35#ifndef __ADS_PointerGraph
36 #define __ADS_PointerGraph
63template<
class T ,
class W =
int >
84 std::list< Edge >
out;
95 [[nodiscard]]
int n(
void )
const {
return(
int( f_V.size() ) ); }
178 [[nodiscard]]
bool owns(
const Node * u )
const;
181 [[nodiscard]]
bool consistent(
void )
const;
183 std::list< Node > f_V;
195#include "ADS/graph/impl/PointerGraph.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
void deleteEdge(Node *u, Node *v)
void forceDeleteNode(Node *u)
deletes the edges of and then
Node * find(const T &t)
the first node of label , nullptr if none
std::vector< Node * > adjacent(const Node *u) const
the nodes adjacent to
void dfs(Node *r, F &&f)
the depth first visit from , on each node reached
PointerGraph & operator=(const PointerGraph &)=delete
no copy, since the nodes are linked by pointers
PointerGraph(const PointerGraph &)=delete
no copy, since the nodes are linked by pointers
bool hasEdge(const Node *u, const Node *v) const
PointerGraph(void)=default
the empty graph
void bfs(Node *r, F &&f)
the breadth first visit from
Node * insertNode(const T &t)
a new isolated node of label
int n(void) const
the number of nodes
Definition PointerGraph.h:95
void insertEdge(Node *u, Node *v, const W &w=W())
the edge of weight , if not there
bool deleteNode(Node *u)
deletes if isolated; false otherwise
an edge, to its other end
Definition PointerGraph.h:73
Node * to
the other end
Definition PointerGraph.h:74
W weight
the weight
Definition PointerGraph.h:75
a node
Definition PointerGraph.h:80
bool seen
the flag of the visits
Definition PointerGraph.h:83
T label
the label
Definition PointerGraph.h:81
std::list< Edge > out
the edges that leave it
Definition PointerGraph.h:84
int degree
the edges that enter or leave it
Definition PointerGraph.h:82