#include <bits/stdc++.h>
using namespace std;
int dis[403][403], q[403];
double f[403], c[403], ans;
int n, m, x, y;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) {
        dis[i][j] = 0;
      } else {
        dis[i][j] = 1000;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    dis[x][y] = dis[y][x] = 1;
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    double ret = 0;
    for (int j = 0; j < n; j++) {
      int u = 0, v = 0;
      double tmp = 0;
      memset(f, 0, sizeof(f));
      for (int k = 1; k <= n; k++) {
        if (dis[i][k] == j) {
          int x = 0;
          u++;
          for (int l = 1; l <= n; l++) {
            if (dis[k][l] == 1) {
              x++;
            }
          }
          for (int l = 1; l <= n; l++) {
            if (dis[k][l] == 1) {
              f[l] += 1.0 / x;
            }
          }
        }
      }
      for (int k = 1; k <= n; k++) {
        if (abs(dis[i][k] - j) <= 1) {
          q[++v] = k;
        }
      }
      for (int k = 1; k <= n; k++) {
        double w = 0;
        for (int l = 1; l <= v; l++) {
          c[dis[k][q[l]]] = max(c[dis[k][q[l]]], f[q[l]]);
        }
        for (int l = 1; l <= v; l++) {
          w += c[dis[k][q[l]]], c[dis[k][q[l]]] = 0;
        }
        tmp = max(tmp, w);
      }
      if (u) {
        tmp = max(tmp, 1.0);
      }
      ret += tmp / n;
    }
    ans = max(ans, ret);
  }
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}
