#include <bits/stdc++.h>
using namespace std;
const int maxn = 401;
vector<int> G[maxn];
int dst[maxn][maxn];
double guess(int g, int d, int n) {
  int t = 0;
  vector<double> probs(n + 1, 0);
  vector<bool> mk(n + 1, false);
  vector<int> vis;
  for (int u = 1; u <= n; ++u) {
    if (dst[u][g] == d) {
      t++;
      for (int v : G[u]) {
        if (!mk[v]) {
          mk[v] = true;
          vis.push_back(v);
        }
        probs[v] += 1.0 / G[u].size();
      }
    }
  }
  for (int u = 1; u <= n; ++u) {
    probs[u] /= t;
  }
  double ans = 0;
  vector<double> mxpdst(n + 1);
  for (int g2 = 1; g2 <= n; ++g2) {
    double prob = 0;
    for (int u : vis) {
      mxpdst[dst[u][g2]] = max(mxpdst[dst[u][g2]], probs[u]);
    }
    for (int u : vis) {
      if (mxpdst[dst[u][g2]] > 0) {
        prob += mxpdst[dst[u][g2]];
        mxpdst[dst[u][g2]] = 0;
      }
    }
    ans = max(ans, prob);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  memset(dst, 0x3f, sizeof dst);
  for (int i = 1; i <= n; ++i) dst[i][i] = 0;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
    dst[u][v] = 1;
    dst[v][u] = 1;
  }
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        dst[i][j] = min(dst[i][j], dst[i][k] + dst[k][j]);
  double ans = 0;
  for (int g1 = 1; g1 <= n; ++g1) {
    double prob = 0;
    for (int d1 = 0; d1 < n; ++d1) {
      int t = 0;
      for (int u = 1; u <= n; ++u)
        if (dst[u][g1] == d1) t++;
      if (t == 0) break;
      prob += 1.0 * t / n * max(1.0 / t, guess(g1, d1, n));
    }
    ans = max(ans, prob);
  }
  cout.precision(17);
  cout << fixed << ans << endl;
  return 0;
}
