Translating Dijkstra's Algorithm from Python to C++
Avoid translating Pythonisms


  Dijkstra's algorithm really exploits nested dictionaries and weak typing which I used as an excuse to try out std::optional.


No, Dijkstra's algorithm does not require nested dictionaries nor weak typing. Maybe the Python implementation you are translating used these things, but maybe just because it was convenient in Python.

I strongly advise you to try to write idiomatic C++ code, not idiomatic Python translated to C++. What is convenient in Python might not be the best fit for C++, especially not when it comes to performance. I recommend you try to implement Dijkstra's using a priority queue.

Furthermore, putting everything into main() is bad practice. It's better to organize your code into functions and classes as appropriate, and that's true even in Python.

Use of typedefs

It's always a good idea to give a name to things, including types, that you use in multiple places in your code. However, in this case I think it would be better to create a class WeightedGraph that contains all the information about a graph with weighted edges. Then you can add member functions to this graph to add and remove vertices and edges, and a member function get_shortest_path() that uses Dijkstra's to calculate the shortest path between two given vertices and returns the list of vertices.

Use of std::optional

While it's possible to use std::optional here to represent the parent of a vertex, it might not be necessary. If you represent vertices by their name, then an empty string for the name might be used as the equivalent of None. And a more idiomatic C++ implementation of this algorithm would probably store each vertex's parent vertex using a pointer, in which case the nullptr would be the equivalent of None.