def analyze(self):
results=[]
#Making all of the possibilities
allGraphs = product(*self.countries)
for g in allGraphs:
results.append(hasCycle(g))
#Now searching for cycles
#results = [hasCycle(graph) for graph in allGraphs]
numCycles = results.count(True)
#Seeing if it's definately an anomolous path
if numCycles == len(results):
self.result = 1
#Seeing if it's only potentially anomolous
elif numCycles > 0:
self.result = 2
#Everying seems to be fine
else:
self.result = 0
评论列表
文章目录