1 |
francois |
113 |
#include "gestionversion.h" |
2 |
francois |
283 |
#include "HypergraphLib_platform.h" |
3 |
|
|
|
4 |
|
|
#include "HypergraphLib_dfs.h" |
5 |
|
|
#include "HypergraphLib_Node.h" |
6 |
|
|
#include "HypergraphLib_Graph.h" |
7 |
|
|
|
8 |
|
|
using namespace HypergraphLib; |
9 |
|
|
|
10 |
|
|
HYPERGRAPHLIB_ITEM void |
11 |
|
|
HypergraphLib::dfs(Node *__n, std::set < Node * > & __depthFirstSearchNodes) |
12 |
|
|
{ |
13 |
|
|
std::set < Node * > adj; |
14 |
|
|
__n->AdjacentNodes( adj ); |
15 |
|
|
__depthFirstSearchNodes.insert (__n); |
16 |
|
|
for ( std::set < Node * >::const_iterator it = adj.begin(); |
17 |
|
|
it != adj.end() ; |
18 |
|
|
it++) |
19 |
|
|
if ( __depthFirstSearchNodes.find(*it) == __depthFirstSearchNodes.end()) |
20 |
|
|
HypergraphLib::dfs (*it, __depthFirstSearchNodes); |
21 |
|
|
} |
22 |
|
|
|