NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement BFS shortest-path finding over a knowledge graph, the real algorithm behind multi-hop relationship queries ('how is A connected to B').
Implement shortest_path(graph, start, end) using BFS on the directed adjacency list graph. Return the list of node names from start to end inclusive (the shortest such path by edge count). Return [] if no path exists, or [start] if start == end.
shortest_path(graph: dict[str, list[str]], start: str, end: str) -> list[str]