weighted graphs the all-pairs shortest-path problem in discussing connectivity in we wanted to know whether it was possible to fly from athens to murmansk if we didn' care how many stops we made with weighted graphs we can answer the second question that might occur to you as you wait at the hubris airlines ticket counterhow much will the journey costto find whether trip was possiblewe created connectivity table with weighted graphs we want table that gives the minimum cost from any vertex to any other vertex using multiple edges this is called the all-pairs shortest-path problem you can create such table by running the path java program using each vertex in turn as the starting vertex this will yield something like table table all-pairs shortest-path table -- -- -- --in the preceding we found that warshall' algorithm was quicker way to create table showing which vertices could be reached from given vertex using one or many steps an analogous approach for weighted graphs uses floyd' algorithmdiscovered by robert floyd in this is another way to create the kind of table shown in table let' discuss floyd' algorithm with simpler graph figure shows weighted directed graph and its adjacency matrix figure weighted graph and its adjacency matrix the adjacency matrix shows the cost of all the one-edge paths we want to extend this matrix to show the cost of all paths regardless of length for exampleit' clear