public static Matrice getShortestPaths(Matrice mat){
        Matrice A = new Matrice(mat.getData());
        for(int k=0; k < mat.getNbLines(); k++){
            for(int i=0; i< mat.getNbLines(); i++){
                for(int j=0; j< mat.getNbColumns(); j++){
            if((A.getValueAt(i,k) + A.getValueAt(k,j)) < A.getValueAt(i,j) )
                  A.setValueAt(i,j, (double) Math.min(mat.getValueAt(i,j),(mat.getValueAt(i,k)+mat.getValueAt(k,j) ) ) );
                }
            }
        }
        return A;
    }