MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / my_dfs

Function my_dfs

graphs/frequent_pattern_graph_miner.py:172–181  ·  view source on GitHub ↗

find different DFS walk from given node to Header node

(graph, start, end, path=None)

Source from the content-addressed store, hash-verified

170
171
172def my_dfs(graph, start, end, path=None):
173 """
174 find different DFS walk from given node to Header node
175 """
176 path = (path or []) + [start]
177 if start == end:
178 paths.append(path)
179 for node in graph[start]:
180 if tuple(node) not in path:
181 my_dfs(graph, tuple(node), end, path)
182
183
184def find_freq_subgraph_given_support(s, cluster, graph):

Callers 1

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected