#include <bits/stdc++.h>
using namespace std;
int dis[505][505], q[505];
double b[505], c[505];
int n, m, x, y;
double ans;
int main() {
  scanf("%d%d", &n, &m);
  memset(dis, 1, sizeof(dis));
  for (int i = 1; i <= n; i++) dis[i][i] = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &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 r = 0;
    for (int j = 0; j < n; j++) {
      int u = 0, p = 0;
      double t = 0;
      memset(b, 0, sizeof(b));
      for (int k = 1; k <= n; k++)
        if (dis[i][k] == j) {
          int v = 0;
          u++;
          for (int l = 1; l <= n; l++)
            if (dis[k][l] == 1) v++;
          for (int l = 1; l <= n; l++)
            if (dis[k][l] == 1) b[l] += 1.0 / v;
        }
      for (int k = 1; k <= n; k++)
        if (abs(dis[i][k] - j) <= 1) q[++p] = k;
      for (int k = 1; k <= n; k++) {
        double w = 0;
        for (int l = 1; l <= p; l++)
          if (b[q[l]] > c[dis[k][q[l]]]) c[dis[k][q[l]]] = b[q[l]];
        for (int l = 1; l <= p; l++) w += c[dis[k][q[l]]], c[dis[k][q[l]]] = 0;
        t = max(t, w);
      }
      if (t > u + 1) puts("!!!");
      if (u) t = max(t, 1.0);
      r += t / n;
    }
    ans = max(ans, r);
  }
  printf("%.12lf\n", ans);
}
