MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / get_all_paths

Method get_all_paths

detectron2/export/shared.py:795–813  ·  view source on GitHub ↗
(self, s, d)

Source from the content-addressed store, hash-verified

793
794 # grab from https://www.geeksforgeeks.org/find-paths-given-source-destination/
795 def get_all_paths(self, s, d):
796 visited = {k: False for k in self.vertices}
797 path = []
798 all_paths = []
799
800 def _get_all_paths_util(graph, u, d, visited, path):
801 visited[u] = True
802 path.append(u)
803 if u == d:
804 all_paths.append(copy.deepcopy(path))
805 else:
806 for i in graph[u]:
807 if not visited[i]:
808 _get_all_paths_util(graph, i, d, visited, path)
809 path.pop()
810 visited[u] = False
811
812 _get_all_paths_util(self.graph, s, d, visited, path)
813 return all_paths
814
815 @staticmethod
816 def from_ssa(ssa):

Callers 1

_get_dependency_chainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected