59 _edges_(edges_size, edges_resize_policy) {
98 for (
const auto& edge: tmp)
121 for (
const auto& edge:
_edges_)
133 for (
const auto& edge:
_edges_) {
134 if (first) first =
false;
156 while (!nodeFIFO.
empty()) {
157 current = nodeFIFO.
front();
161 for (
const auto new_one:
neighbours(current)) {
165 mark.
insert(new_one, current);
168 std::vector< NodeId > v;
170 for (current = n1; current != n2; current = mark[current])
171 v.push_back(current);
190 while (!temp.
empty()) {
192 if (current == n2)
return true;
206 if (except.
contains(n2))
return false;
209 while (!temp.
empty()) {
211 if (current == n2)
return true;
231 while (!temp.
empty()) {
233 if (n2.
contains(current))
return true;
Classes for undirected edge sets.
std::vector< NodeId > undirectedPath(NodeId node1, NodeId node2) const
returns a possible path from node1 to node2 in the edge set
EdgeGraphPart & operator=(const EdgeGraphPart &s)
copy operator
bool hasUndirectedPath(NodeId n1, NodeId n2) const
return true if n1 and n2 are connected (by an undirected path) in the graph.
virtual ~EdgeGraphPart()
destructor
EdgeGraphPart(Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
default constructor
EdgeSet _edges_
the set of all the edges contained within the EdgeGraphPart
Signaler2< NodeId, NodeId > onEdgeDeleted
NodeProperty< NodeSet * > _neighbours_
for each node, the set of its adjacent edges
Signaler2< NodeId, NodeId > onEdgeAdded
virtual std::string toString() const
to friendly display the content of the EdgeGraphPart
virtual void clearEdges()
removes all the edges from the EdgeGraphPart
const NodeSet & neighbours(NodeId id) const
returns the set of node neighbours to a given node
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Generic doubly linked lists.
Val & front() const
Returns a reference to first element of a list, if any.
bool empty() const noexcept
Returns a boolean indicating whether the chained list is empty.
void popFront()
Removes the first element of a List, if any.
Val & pushBack(const Val &val)
Inserts a new element (a copy) at the end of the chained list.
Exception : the element we looked for cannot be found.
iterator begin() const
The usual unsafe begin iterator to parse the set.
bool contains(const Key &k) const
Indicates whether a given elements belong to the set.
void insert(const Key &k)
Inserts a new element into the set.
bool empty() const noexcept
Indicates whether the set is the empty set.
void erase(const Key &k)
Erases an element from the set.
Inline implementation of classes for undirected edge sets.
#define GUM_ERROR(type, msg)
some utils for topology : NodeId, Edge, Arc and consorts ...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
#define GUM_EMIT2(signal, arg1, arg2)