this is how I implement Dijkstra algorith to find shortest path on SDN. I used three topologies and OSPF cost based on bandwidth. I declare the distance matrix as constant. maybe when you try the controller code for the first time, it will show you "key error(0)", just be patient the code is taking time to solve your topology
aidakrr/dijkstra-SDN-Ryu
this is how I implement Dijkstra algorith to find shortest path on SDN.
Python