Implement a basic search algorithm such as A* or Dijkstra and explain its time and space complexity.
Implement Dijkstra's algorithm in dijkstra_shortest_path(graph, start, target). The graph is a map from string nodes to arrays of [neighbor, weight] pairs, with nonnegative integer weights. Return a shortest path as an array of node names, or an empty array when the target is unreachable. If start equals target, return an array containing only start.
def dijkstra_shortest_path(graph, start, target):