galera vou colocar o código do floyd warshall que fiz, mas não ta fechando com o meu teste de mesa. Se notarem um erro de cara desculpem a noobice! 
public int valorAresta(int i, int j){
Nodo n1 = nodos.get(i);
Nodo n2 = nodos.get(j);
List<Aresta><A>> aux = n1.getArestas();
if(temAresta(n1, n2)){
for(Aresta ares: aux){
if(ares.getNodo().equals(n2)){
return (Integer) ares.getValor();
}
}
}
return 1000000;
}
private boolean temAresta(Nodo<E> or, Nodo<E> de){
if(or.getAdjacentes().contains(de)){
return true;
}
else{
return false;
}
}
public void printMatriz(int[][] mat){
for(int i = 0;i < mat.length; i++){
for(int j = 0; j < mat[i].length; j++){
System.out.println(mat[i][j]);
}
}
}
public int[][] floydwarshall(){
int [][] fw = new int[nodos.size()][nodos.size()];
for(int i = 0 ;i < nodos.size(); i++){
for(int j = 0;j < nodos.size(); j++){
fw[i][j] = valorAresta(i, j);
}
}
printMatriz(fw);
System.out.println("----------------------------------");
for(int k = 0; k < nodos.size();k++){
for(int i = 0; i < nodos.size();i++){
for(int j = 0; j < nodos.size();j++){
fw[i][j] = Math.min(fw[i][j], fw[i][k]+fw[k][j]);
}
}
}
return fw;
}
Aqui os nodos que eu coloco no grafo e as arestas.
GrafoComAresta<String,Integer> grafo = new GrafoComAresta<String, Integer>();
grafo.addNodo("A");
grafo.addNodo("B");
grafo.addNodo("C");
grafo.addNodo("D");
grafo.addNodo("E");
grafo.addAresta("A", "B",5);
grafo.addAresta("C", "B",3);
grafo.addAresta("E", "A",12);
grafo.addAresta("D", "B",10);
grafo.addAresta("E", "C",7);