- Directed weighted graph class implemented as an adjacency list is provided by default as shown below. In all matters Please use objects of this class. t diass DirectedWeightedGraph: def_init_(seit, num_vertices): selt num_vertices = num_vertices def add_edge(self, start_vertex, end_vertex, weight): self_oulgoing_edges(start_vertex] append(/end_veriex, weight)] sellincoming_edges[end_vertex]_append/[start_vertex, weight)] Question 1. [10 pts] Write a function that generates an arbitrary simple undirecled weighted graph using a directed weighted graph. box The lifespan is generate random simple undirected weighled graph with num vertices as input argument. num edges is a positive integer. Retum value graph is an object of the class provided above. Edge weight ranges from 0 to 10. You can set it to any integer. Question 2. [30 pts] Implement Dikstra's algorithm to find the shortest path between an arbitrary source vertex and a sink verlex. The function name is dijkstra is the shortest path, and the input arguments graph, source, and sink are each a graph object and a random vertex number. There are 2 numbers. Retum value shortest path is a list consisting of onily the vertex numbers that make up the path (scurce and sink. includes). To adjust the dilficulty, we give you the basic code below, and you can fill in the while statement corresponding lo Line 16. You can ignore the provided part and write your own function. 2 def djkstra_shortest path(graph, source, sink): num_vertices = graph_num_vertices \#Pnarty queue to store vertipes with ther current distances pq=[0, source } \# Dictionary to store the ahorlest dislances and prodecessors detance = (vertex flosk'inf) for vertex in range(num_vertices)) dstance[source] =0 \#Dictionary io stare predecessors predecessors = \{vertex: None for vertex in range(inum_vertioes)] while pq: \# Writo your own code \# Reconsinuct the shortest paith shortest path =0 current_vertex = sirk. while current_vertex is nat None: shortest path append(current_vertex) current_vertex = predecessors[ourrent_vertex] return shortest potry =1] if shortest patt[-1] = source else []