I could get the shortest path between two hosts with ODL topology REST API & Python Networkx module. I used mininet simulator and created a custom network topology with multipath.
From ODL network topology REST api response, extracted hosts, switch & links details. You can even use ODL python client SDK python-odl to get the topology information
GET http://192.168.1.124:8181/restconf/operational/network-topology:network-topology
With the links details, i generated a Graph using python networkx module.
import networkx as nx
graph = nx.Graph()
graph.add_edges_from(graph_links)
Then by using Dijkstra's Algorithm, can find the shortest path between any two hosts in the topology
path = nx.dijkstra_path(graph, source_node, dest_node)
Even we can find the list of shortest paths available for a set of hosts
nx.all_shortest_paths(graph, source=source, target=dest)
Please share your comments on this approach.
Thanks.