the last helper method is the get_next_node functiondef get_next_node(tablevisited_nodes)unvisited_nodes list(set(table keys()difference(set(visited_nodes))assumed_min table[unvisited_nodes[ ]][distancemin_vertex unvisited_nodes[ for node in unvisited_nodesif table[node][distanceassumed_minassumed_min table[node][distancemin_vertex node return min_vertex the get_next_node function resembles function to find the smallest item in list the function starts off by finding the unvisited nodes in our table by using visited_nodes to obtain the difference between the two sets of lists the very first item in the list of unvisited_nodes is assumed to be the smallest in the shortest distance column of table if lesser value is found while the for loop runsthe min_vertex will be updated the function then returns min_vertex as the unvisited vertex or node with the smallest shortest distance from the source the worst-case running time of dijkstra' algorithm is (| |vlog | |)where |vis the number of vertices and |eis the number of edges complexity classes the problems that computer algorithms try to solve fall within range of difficulty by which their solutions are arrived at in this sectionwe will discuss the complexity classes nnpnp-completeand np-hard problems versus np the advent of computers has sped up the rate at which certain tasks are performed in generalcomputers are good at perfecting the art of calculation and all problems that can be reduced to set of mathematical computations howeverthis assertion is not entirely true there are some nature or classes of problems that just take an enormous amount of time for the computer to make sound guesslet alone find the right solution