Fingers-on explanations assisted by easy JavaScript code The Floyd-Warshall algorithm is important in graph idea because…