networkx

Finding and visualizing the shortest path between graph vertices

I have a graph, let's say, of five vertices. And I need to find the shortest path from one vertex to another using the Floyd ... hat are included in the shortest path. That is, I need to get this list: result = [[0, 2], [2, 1]] Example in the photo:

Python, networkx does not draw a graph

According to the article on the site, I decided to draw a simple graph using networkX. I did everything according to the inst ... edge('B','C', graph) nx.draw_circular(graph, node_color='red', node_size=1000, with_labels=True)

Draw a graph

Need help drawing the graph. There can be any number of elements with different weights. Depending on the weight, the size o ... s inside the elements. I tried using vis.js, but it seems not particularly flexible for the implementation of such a graph.