MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / hasPath

Function hasPath

Source/Falcor/Utils/Algorithm/DirectedGraphTraversal.h:225–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223namespace DirectedGraphPathDetector
224{
225inline bool hasPath(const DirectedGraph& graph, uint32_t from, uint32_t to)
226{
227 DirectedGraphDfsTraversal dfs(graph, from, DirectedGraphDfsTraversal::Flags::IgnoreVisited);
228 uint32_t node = dfs.traverse();
229 node = dfs.traverse(); // skip the root node
230 while (node != DirectedGraph::kInvalidID)
231 {
232 if (node == to)
233 return true;
234 node = dfs.traverse();
235 }
236 return false;
237}
238
239inline bool hasCycle(const DirectedGraph& graph, uint32_t root)
240{

Callers 2

hasCycleFunction · 0.85
addEdgeMethod · 0.85

Calls 1

traverseMethod · 0.80

Tested by

no test coverage detected