0% found this document useful (0 votes)
11 views3 pages

Untitled Document

The Floyd-Warshall algorithm is a key method in graph theory for finding the shortest paths between all pairs of nodes in a weighted graph, accommodating both positive and negative edge weights. It operates using a dynamic programming approach with a time complexity of O(V^3) and requires O(V^2) auxiliary space. This algorithm has practical applications in computer networking, aviation for flight connectivity, and GIS for analyzing spatial data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Untitled Document

The Floyd-Warshall algorithm is a key method in graph theory for finding the shortest paths between all pairs of nodes in a weighted graph, accommodating both positive and negative edge weights. It operates using a dynamic programming approach with a time complexity of O(V^3) and requires O(V^2) auxiliary space. This algorithm has practical applications in computer networking, aviation for flight connectivity, and GIS for analyzing spatial data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Floyd-Warshall algorithm

The Floyd-Warshall algorithm, named after its creators Robert Floyd


and Stephen Warshall, is a fundamental algorithm in computer science
and graph theory.
It is used to find the shortest paths between all pairs of nodes in a weighted
graph.
This algorithm is highly efficient and can handle graphs with both positive
and negative edge weights, making it a versatile tool for solving a wide
range of network and connectivity problems.

Floyd Warshall Algorithm:


The Floyd Warshall Algorithm is an all pair shortest path algorithm unlike
Dijkstra and Bellman Ford which are single source shortest path algorithms.
This algorithm works for both the directed and undirected weighted graphs.
But, it does not work for the graphs with negative cycles (where the sum of the
edges in a cycle is negative). It follows Dynamic Programming approach to
check every possible path going via every possible node in order to calculate
shortest distance between every pair of nodes.
Complexity Analysis of Floyd Warshall Algorithm:
● Time Complexity: O(V3), where V is the number of vertices in the

graph and we run three nested loops each of size V

● Auxiliary Space: O(V2), to create a 2-D matrix in order to store the

shortest distance for each pair of nodes.

Real World Applications of Floyd-Warshall Algorithm:


● In computer networking, the algorithm can be used to find the

shortest path between all pairs of nodes in a network. This is

termed as network routing.

● Flight Connectivity In the aviation industry to find the shortest path

between the airports.

● GIS(Geographic Information Systems) applications often involve

analyzing spatial data, such as road networks, to find the shortest

paths between locations.

You might also like