Can you suggest any alterations to my tarjan algorithm implementation to enhance its efficiency?
def SCC_Tarjan(self,n=None,stack=None,low_link=None,scc=None,visited=None): if visited is None: visited = [self.get_n()[0]] if scc is None: scc = [[]] if low_link is None: low_link = [i for i in range(len(self.nodes))] if n is None: n = [self.get_n()[0],None,0,0] # pos 0: the node / pos 1: the parent / pos 2: low link / pos 3: index if stack […]