AudioManager  7.6.6
Native Application Runtime Environment
CAmGraph.h
Go to the documentation of this file.
1 
24 #ifndef GRAPH_H
25 #define GRAPH_H
26 
27 #include <functional>
28 #include <iostream>
29 #include <vector>
30 #include <map>
31 #include <list>
32 #include <stack>
33 #include <queue>
34 #include <algorithm>
35 #include <limits.h>
36 #include <iomanip>
37 #include <cstring>
38 #include <set>
39 
40 
41 namespace am
42 {
46  typedef enum:uint8_t
47  {
48  GES_NOT_VISITED,
50  GES_VISITED
52 
56  typedef enum:uint8_t
57  {
58  GRAPH_PATH_START, //at the beginning of the path
59  GRAPH_PATH_MIDDLE, //in middle of the path
60  GRAPH_PATH_END //at the end of the path
62 
63 
68  {
69  am_GraphElementStatus_e mStatus;
70  public:
71  CAmGraphElement(): mStatus(GES_NOT_VISITED) { };
76  void setStatus(const am_GraphElementStatus_e s) { mStatus = s; };
77  am_GraphElementStatus_e getStatus() const { return mStatus; };
78  };
79 
80  template <class NodeData> class CAmNode : public CAmGraphElement
81  {
82  uint16_t mIndex;
83  NodeData mData;
84  public:
85  CAmNode(const NodeData & in):CAmGraphElement(), mIndex(0), mData(in) { };
86  CAmNode(const NodeData & in, const uint16_t index):CAmGraphElement(), mIndex(index), mData(in) { };
87  ~CAmNode() { };
91  NodeData & getData() { return mData; }
92  const NodeData & getData() const { return mData; }
93  uint16_t getIndex() const { return mIndex; }
94  void setIndex(uint16_t index) { mIndex = index; }
95  };
96 
97  template <class NodeData, class VertexData> class CAmVertex : public CAmGraphElement
98  {
99  CAmNode<NodeData>* mpNode;
100  VertexData mVertexData;
101  uint16_t mWeight;
102  public:
103  CAmVertex(CAmNode<NodeData> *aNode, const VertexData & vertexData, const uint16_t weight):CAmGraphElement(),
104  mpNode(aNode), mVertexData(vertexData), mWeight(weight) { };
105  ~CAmVertex() { };
109  CAmNode<NodeData>* getNode() const { return mpNode; }
110  VertexData & getData() { return mVertexData; }
111  uint16_t getWeight() const { return mWeight; }
112  void setWeight(const uint16_t weight) { mWeight=weight; }
113  };
114 
119  template <class T, class V> class CAmGraph
120  {
121  typedef typename std::vector<CAmNode<T>*> CAmListNodePtrs;
122  typedef typename std::list<CAmVertex<T,V>> CAmListVertices;
123  typedef typename std::list<CAmVertex<T,V>>::iterator CAmListVerticesItr;
124  typedef typename std::list<CAmVertex<T,V>>::const_iterator CAmListVerticesItrConst;
125  typedef typename std::list<CAmListVertices> CAmNodesAdjList;
126  typedef typename std::list<CAmListVertices>::iterator CAmNodesAdjListItr;
127  typedef typename std::list<CAmListVertices>::const_iterator CAmNodesAdjListItrConst;
128  typedef typename std::list<CAmNode<T>> CAmListNodes;
129  typedef typename std::list<CAmNode<T>>::iterator CAmListNodesItr;
130  typedef typename std::list<CAmNode<T>>::const_iterator CAmListNodesItrConst;
131  typedef typename std::vector<CAmNode<T>*> CAmNodeReferenceList;
132  typedef typename std::vector<CAmListVertices*> CAmVertexReferenceList;
133 
134  CAmListNodes mStoreNodes;
135  CAmNodesAdjList mStoreAdjList;
136  CAmNodeReferenceList mPointersNodes;
137  CAmVertexReferenceList mPointersAdjList;
138  bool mIsCyclic;
139 
140  struct IterateThroughAllNodesDelegate
141  {
142  CAmNode<T> * source;
143  CAmNode<T> * destination;
144  CAmNodeReferenceList visited;
145  std::function<bool(const CAmNode<T> * )> shouldVisitNode;
146  std::function<void(const CAmNode<T> *)> willVisitNode;
147  std::function<void(const CAmNode<T> *)> didVisitNode;
148  std::function<void(const CAmNodeReferenceList & path)> didFindPath;
149  };
150 
151  struct VisitNodeDelegate
152  {
153  CAmNode<T> * source;
154  CAmNode<T> * destination;
155  std::function<void(const am_GraphPathPosition_e, CAmNode<T> &)> visitedNode;
156  };
157 
163  void updateIndexes(const int16_t fromIndex)
164  {
165  if( fromIndex<mPointersNodes.size() )
166  {
167  for(auto iter = mPointersNodes.begin()+fromIndex; iter!=mPointersNodes.end(); iter++)
168  (*iter)->setIndex(iter-mPointersNodes.begin());
169  }
170  }
171 
172 
181  typedef uint16_t vertex_t;
182  typedef uint16_t weight_t;
183 
184  void findShortestPathsFromNode(const CAmNode<T> & node, std::vector<weight_t> &minDistance, std::vector<CAmNode<T> *> &previous)
185  {
186  typename CAmListVertices::const_iterator nIter;
187  CAmListVertices * neighbors;
188  weight_t dist, weight, v, distanceThroughU;
189  CAmNode<T>* pU;
190  CAmVertex<T,V> * pVertex;
191  CAmNode<T> *pDstNode;
192 
193  size_t n = mPointersAdjList.size();
194  std::set<std::pair<weight_t, CAmNode<T>*> > vertexQueue;
195 
196  minDistance.clear();
197  minDistance.resize(n, std::numeric_limits<weight_t>::max());
198  minDistance[node.getIndex()] = 0;
199  previous.clear();
200  previous.resize(n, NULL);
201 
202  vertexQueue.insert(std::make_pair(minDistance[node.getIndex()], (CAmNode<T>*)&node));
203 
204  while (!vertexQueue.empty())
205  {
206  dist = vertexQueue.begin()->first;
207  pU = vertexQueue.begin()->second;
208  vertexQueue.erase(vertexQueue.begin());
209  //todo: terminate the search at this position if you want the path to a target node ( if(pU==target)break; )
210 
211  // Visit each edge exiting u
212  neighbors = mPointersAdjList[pU->getIndex()];
213  nIter = neighbors->begin();
214  for (; nIter != neighbors->end(); nIter++)
215  {
216  pVertex = (CAmVertex<T,V> *)&(*nIter);
217  pDstNode = pVertex->getNode();
218 
219  v = pDstNode->getIndex();
220  weight = pVertex->getWeight();
221  distanceThroughU = dist + weight;
222  if (distanceThroughU < minDistance[pDstNode->getIndex()])
223  {
224  vertexQueue.erase(std::make_pair(minDistance[v], pDstNode));
225  minDistance[v] = distanceThroughU;
226  previous[v] = pU;
227  vertexQueue.insert(std::make_pair(minDistance[v], pDstNode));
228  }
229  }
230  }
231  }
232 
240  void constructShortestPathTo(const CAmNode<T> & node, const std::vector<CAmNode<T> *> &previous, CAmListNodePtrs & result)
241  {
242  CAmNode<T> * vertex = (CAmNode<T> *)&node;
243 
244  int i=0;
245  while ( (vertex = previous[vertex->getIndex()])!=NULL )
246  {
247  result.insert(result.begin(), vertex);
248  i++;
249  }
250  if(i)
251  result.push_back((CAmNode<T> *)&node);
252  }
253 
262  void constructShortestPathTo(const CAmNode<T> & node, const std::vector<CAmNode<T> *> &previous, std::function<void(const am_GraphPathPosition_e pos, CAmNode<T> &)> cb)
263  {
264  CAmNode<T> * vertex = (CAmNode<T> *)&node;
265  CAmNode<T> * prev = vertex;
266  int i=0;
267  while ( (vertex = previous[vertex->getIndex()])!=NULL )
268  {
269  cb(i==0?GRAPH_PATH_START:GRAPH_PATH_MIDDLE, *prev);
270  prev = vertex;
271  i++;
272  }
273  if(i)
274  cb(GRAPH_PATH_END, *prev);
275  }
276 
284  void findAllPaths(IterateThroughAllNodesDelegate & delegate)
285  {
286  CAmListVertices * nodes = mPointersAdjList[delegate.visited.back()->getIndex()];
287  CAmListVerticesItrConst vItr(nodes->begin());
288 
289  CAmVertex<T,V> * pNextVertex;
290  CAmNode<T> * pNextNode;
291  for (; vItr != nodes->end(); ++vItr)
292  {
293  pNextVertex = (CAmVertex<T,V> *)&(*vItr);
294  pNextNode = pNextVertex->getNode();
295  if(
296  pNextNode->getStatus()!=GES_NOT_VISITED ||
297  !delegate.shouldVisitNode(pNextNode)
298  )
299  continue;
300  if (pNextNode==delegate.destination)
301  {
302  delegate.willVisitNode(pNextNode);
303  pNextNode->setStatus(GES_IN_PROGRESS);
304  delegate.visited.push_back(pNextNode);
305  //notify observer
306  delegate.didFindPath(delegate.visited);
307  //remove last node from the list
308  auto last = delegate.visited.end()-1;
309  delegate.visited.erase(last);
310  pNextNode->setStatus(GES_NOT_VISITED);
311  delegate.didVisitNode(pNextNode);
312  break;
313  }
314  }
315  vItr = nodes->begin();
316  //bfs like loop
317  for (; vItr != nodes->end(); ++vItr)
318  {
319  pNextVertex = (CAmVertex<T,V> *)&(*vItr);
320  pNextNode = pNextVertex->getNode();
321 
322  if(pNextNode->getStatus()!=GES_NOT_VISITED ||
323  pNextNode==delegate.destination ||
324  !delegate.shouldVisitNode(pNextNode)
325  )
326  continue;
327  delegate.willVisitNode(pNextNode);
328  pNextNode->setStatus(GES_IN_PROGRESS);
329  delegate.visited.push_back(pNextNode);
330  findAllPaths(delegate);
331  //remove last node from the list
332  auto last = delegate.visited.end()-1;
333  delegate.visited.erase(last);
334  pNextNode->setStatus(GES_NOT_VISITED);
335  delegate.didVisitNode(pNextNode);
336  }
337  }
338 
339  public:
340 
341  explicit CAmGraph(const std::vector<T> &v):mStoreNodes(), mStoreAdjList(), mPointersNodes(), mPointersAdjList()
342  {
343  typedef typename std::vector<T>::const_iterator inItr;
344  inItr itr(v.begin());
345 
346  for (; itr != v.end(); ++itr)
347  {
348  addNode(*itr);
349  }
350 
351  mIsCyclic = false;
352  };
353  CAmGraph():mStoreNodes(), mStoreAdjList(), mPointersNodes(), mPointersAdjList(), mIsCyclic(false){};
355 
356  const CAmListNodes & getNodes() const
357  {
358  return mStoreNodes;
359  }
360 
361  const CAmVertexReferenceList & getVertexList() const
362  {
363  return mPointersAdjList;
364  }
365 
370  const CAmNode<T>* findNode(const T & in)
371  {
372  typename CAmNodeReferenceList::const_iterator itr (mPointersNodes.begin());
373 
374  for (; itr != mPointersNodes.end(); ++itr)
375  {
376  if ((*itr)->getData() == in) {
377  return (*itr);
378  }
379  }
380  return NULL;
381  }
382 
387  const CAmVertex<T,V>* findVertex(const CAmNode<T> & edge1, const CAmNode<T> & edge2) const
388  {
389  const CAmNode<T> * pEdge2 = (CAmNode<T> *)&edge2;
390  const CAmListVertices * list = mPointersAdjList[edge1.getIndex()];
391  CAmListVerticesItrConst result = std::find_if(list->begin(), list->end(), [&](const CAmVertex<T,V> & refObject){
392  return refObject.getNode()==pEdge2;
393  });
394  if(result!=list->end())
395  return (CAmVertex<T,V>*)&(*result);
396 
397  return NULL;
398  }
399 
400  bool hasCycles() const
401  {
402  return mIsCyclic;
403  }
404 
405 
410  CAmNode<T> & addNode(const T & in)
411  {
412  size_t index = mStoreNodes.size();
413  mStoreNodes.emplace_back(in, index);
414  mStoreAdjList.emplace_back();
415  mPointersNodes.push_back(&mStoreNodes.back());
416  mPointersAdjList.push_back(&mStoreAdjList.back());
417  return mStoreNodes.back();
418  }
419 
423  void removeVertex(const CAmNode<T> & edge1, const CAmNode<T> & edge2)
424  {
425  const CAmListVertices * list = mPointersAdjList[edge1.getIndex()];
426  CAmListVerticesItr iter = std::find_if(list->begin(), list->end(), [&edge2](const CAmVertex<T,V> & refVertex){
427  return (refVertex.getNode()==&edge2);
428  });
429  if(iter!=list->end())
430  list->erase(iter);
431  }
432 
437  {
438  auto comparator = [&node](const CAmVertex<T,V> & refVertex){
439  return (refVertex.getNode()==&node);
440  };
441  auto itr = mPointersAdjList.begin();
442  for(;itr!=mPointersAdjList.end();itr++)
443  {
444  CAmListVertices * vertices = *itr;
445  auto iterVert = std::find_if(vertices->begin(), vertices->end(), comparator);
446  if(iterVert!=vertices->end())
447  vertices->erase(iterVert);
448  }
449  }
450 
454  void removeNode(const T & in)
455  {
456  CAmNode<T> * node = findNode(in);
457  if(node!=NULL)
458  removeNode(*node);
459  }
460 
464  void removeNode(const CAmNode<T> & node)
465  {
466  uint16_t index = node.getIndex();
467  removeAllVerticesToNode(node);
468  mPointersAdjList.erase(mPointersAdjList.begin()+index);
469  mPointersNodes.erase(mPointersNodes.begin()+index);
470  auto iter = std::find_if(mStoreNodes.begin(), mStoreNodes.end(), [&node](const CAmNode<T> & otherNode){
471  return &otherNode==&node;
472  });
473  if(iter!=mStoreNodes.end())
474  mStoreNodes.erase(iter);
475  updateIndexes(index);
476  }
477 
481  void connectNodes(const CAmNode<T> & first, const CAmNode<T> & last, const V & vertexData, const int16_t weight = 1)
482  {
483  CAmListVertices * list = mPointersAdjList[first.getIndex()];
484  CAmNode<T> * node = mPointersNodes[last.getIndex()];
485  list->emplace_back(node, vertexData, weight);
486  }
487 
492  bool isAnyVertex(const CAmNode<T> & edge1, const CAmNode<T> & edge2) const
493  {
494  return findVertex(edge1, edge2)!=NULL;
495  }
496 
500  void reset()
501  {
502  // set all nodes to GES_NOT_VISITED
503  std::for_each(mPointersNodes.begin(), mPointersNodes.end(), [](CAmNode<T> * refNode){
504  if(refNode->getStatus()!= GES_NOT_VISITED)
505  refNode->setStatus(GES_NOT_VISITED);
506  });
507  // set all vertices to GES_NOT_VISITED
508  auto action = [](CAmVertex<T,V> & refVertex){
509  if(refVertex.getStatus()!= GES_NOT_VISITED)
510  refVertex.setStatus(GES_NOT_VISITED);
511  };
512  auto itr1(mPointersAdjList.begin());
513  for (; itr1 != mPointersAdjList.end(); ++itr1)
514  {
515  CAmListVertices * vertices = *itr1;
516  std::for_each(vertices->begin(), vertices->end(), action);
517  }
518  }
519 
523  void clear()
524  {
525  mStoreNodes.clear();
526  mStoreAdjList.clear();
527  mPointersAdjList.clear();
528  mPointersNodes.clear();
529  mPointersAdjList.clear();
530  }
531 
535  void trace(std::function<void(const CAmNode<T> &, const std::vector<CAmVertex<T,V>*> &)> cb)
536  {
537  std::for_each(mPointersNodes.begin(), mPointersNodes.end(), [&](CAmNode<T> * refNode){
538  CAmListVertices * vertices = this->mPointersAdjList[refNode->getIndex()];
539  std::vector<CAmVertex<T,V>*> list;
540  std::for_each(vertices->begin(), vertices->end(), [&list](CAmVertex<T,V> & refVertex){
541  list.push_back(&refVertex);
542  });
543  cb(*refNode, list);
544  });
545  }
546 
554  void getShortestPath(const CAmNode<T> & source, const CAmListNodePtrs & listTargets, std::vector<CAmListNodePtrs> & resultPath )
555  {
556  const size_t numberOfNodes = mPointersNodes.size();
557  if(numberOfNodes==0)
558  return;
559 
560  std::vector<weight_t> min_distance;
561  std::vector<CAmNode<T>*> previous;
562  findShortestPathsFromNode(source, min_distance, previous);
563 
564  for(auto it=listTargets.begin(); it!=listTargets.end(); it++)
565  {
566  CAmNode<T> *node = *it;
567  resultPath.emplace_back();
568  CAmListNodePtrs & path = resultPath.back();
569  constructShortestPathTo(*node, previous, path);
570  if(path.empty())
571  {
572  typename std::vector<CAmListNodePtrs>::iterator iter = resultPath.end();
573  resultPath.erase(--iter);
574  }
575  }
576  }
577 
585  void getShortestPath(const CAmNode<T> & source, const CAmNode<T> & destination, CAmListNodePtrs & resultPath )
586  {
587  const size_t numberOfNodes = mPointersNodes.size();
588  if(numberOfNodes==0)
589  return;
590  std::vector<weight_t> min_distance;
591  std::vector<CAmNode<T>*> previous;
592  findShortestPathsFromNode(source, min_distance, previous);
593  constructShortestPathTo(destination, previous, resultPath);
594  }
595 
604  void getShortestPath(const CAmNode<T> & source,
605  const CAmListNodePtrs & listTargets,
606  std::function<void(const am_GraphPathPosition_e, CAmNode<T> &)> cb )
607  {
608  const size_t numberOfNodes = mPointersNodes.size();
609  if(numberOfNodes==0)
610  return;
611 
612  std::vector<weight_t> min_distance;
613  std::vector<CAmNode<T>*> previous;
614  findShortestPathsFromNode(source, min_distance, previous);
615 
616  for(auto it=listTargets.begin(); it!=listTargets.end(); it++)
617  {
618  CAmNode<T>* node = *it;
619  constructShortestPathTo(*node, previous, cb);
620  }
621  }
622 
631  void getShortestPath(const CAmNode<T> & source,
632  const CAmNode<T> & destination,
633  std::function<void(const am_GraphPathPosition_e, CAmNode<T> &)> cb )
634  {
635  const size_t numberOfNodes = mPointersNodes.size();
636  if(numberOfNodes==0)
637  return;
638 
639  std::vector<weight_t> min_distance;
640  std::vector<CAmNode<T>*> previous;
641  findShortestPathsFromNode(source, min_distance, previous);
642  constructShortestPathTo(destination, previous, cb);
643  }
644 
657  CAmNode<T> & dst,
658  std::function<bool(const CAmNode<T> * )> cbShouldVisitNode,
659  std::function<void(const CAmNode<T> *)> cbWillVisitNode,
660  std::function<void(const CAmNode<T> *)> cbDidVisitNode,
661  std::function<void(const CAmNodeReferenceList & path)> cbDidFindPath)
662  {
663  IterateThroughAllNodesDelegate delegate;
664  delegate.source = &src;
665  delegate.destination = &dst;
666  delegate.shouldVisitNode = cbShouldVisitNode;
667  delegate.willVisitNode = cbWillVisitNode;
668  delegate.didVisitNode = cbDidVisitNode;
669  delegate.didFindPath = cbDidFindPath;
670  delegate.visited.push_back((CAmNode<T>*)&src);
671  ((CAmNode<T>*)&src)->setStatus(GES_VISITED);
672  findAllPaths(delegate);
673  ((CAmNode<T>*)&src)->setStatus(GES_NOT_VISITED);
674  }
675  };
676 
677 }
678 
679 #endif
void removeNode(const CAmNode< T > &node)
Removes the given node from the graph .
Definition: CAmGraph.h:464
void setWeight(const uint16_t weight)
Definition: CAmGraph.h:112
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
const CAmNode< T > * findNode(const T &in)
Returns pointer to a node which data is equal to the given.
Definition: CAmGraph.h:370
bool hasCycles() const
Definition: CAmGraph.h:400
void getShortestPath(const CAmNode< T > &source, const CAmListNodePtrs &listTargets, std::vector< CAmListNodePtrs > &resultPath)
Finds the shortest path from given node to all nodes in listTargets.
Definition: CAmGraph.h:554
void connectNodes(const CAmNode< T > &first, const CAmNode< T > &last, const V &vertexData, const int16_t weight=1)
Connect first with last node and set user data and weight to the vertex.
Definition: CAmGraph.h:481
const NodeData & getData() const
Definition: CAmGraph.h:92
NodeData & getData()
Setters and getters.
Definition: CAmGraph.h:91
const CAmVertex< T, V > * findVertex(const CAmNode< T > &edge1, const CAmNode< T > &edge2) const
Returns pointer to a vertex which two ends are equal to the given nodes.
Definition: CAmGraph.h:387
CAmNode< T > & addNode(const T &in)
Adds a new node to the graph with given user data.
Definition: CAmGraph.h:410
Class representing a directed or undirected graph.
Definition: CAmGraph.h:119
CAmVertex(CAmNode< NodeData > *aNode, const VertexData &vertexData, const uint16_t weight)
Definition: CAmGraph.h:103
bool isAnyVertex(const CAmNode< T > &edge1, const CAmNode< T > &edge2) const
Exists any vertex with two given ends.
Definition: CAmGraph.h:492
CAmGraph(const std::vector< T > &v)
Definition: CAmGraph.h:341
void setStatus(const am_GraphElementStatus_e s)
Setter and getter.
Definition: CAmGraph.h:76
VertexData & getData()
Definition: CAmGraph.h:110
CAmNode< NodeData > * getNode() const
Setters and getters.
Definition: CAmGraph.h:109
typedef GES_IN_PROGRESS
Definition: CAmGraph.h:48
GRAPH_PATH_END am_GraphPathPosition_e
Definition: CAmGraph.h:58
am_GraphElementStatus_e getStatus() const
Definition: CAmGraph.h:77
GES_VISITED am_GraphElementStatus_e
Definition: CAmGraph.h:48
CAmNode(const NodeData &in)
Definition: CAmGraph.h:85
This class is base class for nodes and vertices.
Definition: CAmGraph.h:67
void trace(std::function< void(const CAmNode< T > &, const std::vector< CAmVertex< T, V > * > &)> cb)
Goes through all nodes and vertices and calls the callback.
Definition: CAmGraph.h:535
void getShortestPath(const CAmNode< T > &source, const CAmListNodePtrs &listTargets, std::function< void(const am_GraphPathPosition_e, CAmNode< T > &)> cb)
Finds the shortest path from given node to all nodes in listTargets.
Definition: CAmGraph.h:604
const CAmListNodes & getNodes() const
Definition: CAmGraph.h:356
void getShortestPath(const CAmNode< T > &source, const CAmNode< T > &destination, std::function< void(const am_GraphPathPosition_e, CAmNode< T > &)> cb)
Finds the shortest path between two given nodes.
Definition: CAmGraph.h:631
typedef GRAPH_PATH_MIDDLE
Definition: CAmGraph.h:58
void clear()
Clears all nodes and vertices.
Definition: CAmGraph.h:523
void reset()
Sets the status of all nodes and vertices to GES_NOT_VISITED.
Definition: CAmGraph.h:500
void removeNode(const T &in)
Removes a node with given user data .
Definition: CAmGraph.h:454
uint16_t getIndex() const
Definition: CAmGraph.h:93
void getAllPaths(CAmNode< T > &src, CAmNode< T > &dst, std::function< bool(const CAmNode< T > *)> cbShouldVisitNode, std::function< void(const CAmNode< T > *)> cbWillVisitNode, std::function< void(const CAmNode< T > *)> cbDidVisitNode, std::function< void(const CAmNodeReferenceList &path)> cbDidFindPath)
Finds all possible paths between two given nodes.
Definition: CAmGraph.h:656
uint16_t getWeight() const
Definition: CAmGraph.h:111
void getShortestPath(const CAmNode< T > &source, const CAmNode< T > &destination, CAmListNodePtrs &resultPath)
Finds the shortest path between two nodes.
Definition: CAmGraph.h:585
const CAmVertexReferenceList & getVertexList() const
Definition: CAmGraph.h:361
void removeVertex(const CAmNode< T > &edge1, const CAmNode< T > &edge2)
Removes a vertex with two ends equal to the given nodes .
Definition: CAmGraph.h:423
void removeAllVerticesToNode(const CAmNode< T > &node)
Removes all vertices to given node .
Definition: CAmGraph.h:436
void setIndex(uint16_t index)
Definition: CAmGraph.h:94
CAmNode(const NodeData &in, const uint16_t index)
Definition: CAmGraph.h:86