The DFSGraph uses a time attribute to note when a vertex is first encountered (discovery attribute)...
The DFSGraph uses a time attribute to note when a vertex is first encountered (discovery attribute) in the depth-first search (dfs) and when a vertex is backtracked thro (finish attribute). Consider the prerequisite graph for the courses in Bob's Computer Science minor. CS 1410 CS 3470 CS 4400) CS 1510 CS 1510) CS 1520 C$ 1520) CS 2530 S 2530 from graph import Graph class DFSGraph(Graph): definit__(self): super() . _init_0 self. time = 0 def dfs (self): for aVertex in self: aVertex.setColor('white') aVertex.setPred (-1) for a Vertex in self: if a Vertex.getColor() == 'white': self.dfsvisit (aVertex) def dfsvisit (self, startVertex): startVertex.setColor('gray') self. time += 1 startVertex.setDiscovery (self. time) for nextVertex in startVertex.getConnections(): if next Vertex.getColor() == 'white': nextVertex.setPred (startVertex) self.dfsvisit (nextVertex) startVertex.setColor('black') self. time + 1 start Vertex. setFinish (self. time) CS 1800 CS 1800 CS 2720 Assume that the for-loops always iterate through the vertices alphabetically (e.g., "CS 1410", "CS 1510", "CS 1520", "CS 1800", ...) by their ids. If we execute the dfs method to set all the discovery and finish times, what would be the topological sort found using the finish times? CS 1410, CS 1510, CS 1520, CS 1800, CS 2530, CS 2720, CS 3470, CS 4400 CS 1510, CS 1410, CS 1520, CS 1800, CS 2530, CS 2720, CS 3470, CS 4400 O CS 1510, CS 1800, CS 1520, CS 2720, CS 2530, CS 1410, CS 3470, CS 4400 None of the above answers