MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / DFS

Function DFS

src/algorithms/dfs.c:54–64  ·  view source on GitHub ↗

Returns a single path from S to a reachable node at distance level.

Source from the content-addressed store, hash-verified

52
53// Returns a single path from S to a reachable node at distance level.
54QGEdge **DFS(QGNode *s, int level, bool close_cycle) {
55 int current_level = 0; // Tracks BFS level.
56 rax *visited = raxNew(); // Dictionary of visited nodes.
57 rax *used_edges = raxNew(); // Dictionary of used edges.
58 QGEdge **path = array_new(QGEdge *, 0); // Path found.
59
60 _DFS(s, level, close_cycle, current_level, visited, used_edges, &path);
61 raxFree(visited);
62 raxFree(used_edges);
63 return path;
64}

Callers 2

test_DFSLevelsFunction · 0.85

Calls 1

_DFSFunction · 0.85

Tested by 1

test_DFSLevelsFunction · 0.68