You are given a directed graph with non-negative edge weights. Write a function that returns the shortest distance from a start node to an end node, along with the actual path taken.
If the end node is unreachable, return (-1, []).
n, the number of nodes labeled 0 to n - 1edges, a list of [u, v, w] triples representing a directed edge from u to v with weight wstart, the source nodeend, the destination node(distance, path) where distance is the minimum total weight from start to end, and path is a list of node labels from start to endUse an algorithm that is efficient for sparse graphs and handles up to large input sizes.
def shortest_path(n, edges, start, end):