Solve a problem involving graph traversal or tree manipulation.
Implement shortest_path(graph, source, target) using a weighted directed graph. Return the minimum distance and one corresponding path, or {"distance": -1, "path": []} when the target is unreachable.
graph maps each node to a list of [neighbor, nonnegative_weight] pairs. Return {"distance": 0, "path": [source]} when source and target are identical.
def shortest_path(graph, source, target):