#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  x = ch - '0';
  while (1) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    x = x * 10 + ch - '0';
  }
  return x * f;
}
const int maxn = 510;
vector<int> w[maxn], d[maxn], po, len;
int n, m, g[maxn][maxn], tag1, tag2, vis1[maxn], vis2[maxn];
double ans, p1[maxn], maxp[maxn];
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) g[i][j] = g[j][i] = maxn;
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    g[u][v] = g[v][u] = 1;
    w[u].push_back(v);
    w[v].push_back(u);
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
  for (int i = 1; i <= n; i++) {
    double p = 0.0;
    for (int l = 0; l < n; l++) d[l].clear();
    for (int j = 1; j <= n; j++) d[g[i][j]].push_back(j);
    for (int l = 0; l < n; l++)
      if (d[l].size()) {
        if (d[l].size() == 1) {
          p += 1. / n;
          continue;
        }
        double maxx = 0;
        tag1++;
        po.clear();
        for (int u = 0; u < (int)d[l].size(); u++) {
          int v = d[l][u];
          double P = 1. / d[l].size() / w[v].size();
          for (int k = 0; k < (int)w[v].size(); k++) {
            int pos = w[v][k];
            if (vis1[pos] != tag1)
              vis1[pos] = tag1, po.push_back(pos), p1[pos] = 0;
            p1[pos] += P;
          }
        }
        for (int j = 1; j <= n; j++) {
          double q = 0;
          tag2++;
          len.clear();
          for (int u = 0; u < (int)po.size(); u++) {
            int v = po[u];
            if (vis2[g[v][j]] != tag2)
              vis2[g[v][j]] = tag2, len.push_back(g[v][j]), maxp[g[v][j]] = 0;
            maxp[g[v][j]] = max(maxp[g[v][j]], p1[v]);
          }
          for (int u = 0; u < (int)len.size(); u++) q += maxp[len[u]];
          maxx = max(maxx, q);
        }
        p += max(1. / n, maxx * d[l].size() / n);
      }
    ans = max(ans, p);
  }
  printf("%.10f\n", ans);
  return 0;
}
