#include <bits/stdc++.h>
using namespace std;
const int N = 405;
int g[N][N];
vector<int> adj[N];
double f[N], max_p[N];
double solve1(int s, int n, const vector<int> &vec) {
  memset(f, 0, sizeof(f));
  for (int x : vec) {
    for (int y : adj[x]) {
      f[y] += 1.0 / vec.size() / adj[x].size();
    }
  }
  vector<int> v;
  for (int i = (1); i <= (n); ++i)
    if (f[i] > 1e-8) v.push_back(i);
  double ret = 0;
  for (int i = (1); i <= (n); ++i) {
    memset(max_p, 0, sizeof(max_p));
    for (int x : v) max_p[g[i][x]] = max(max_p[g[i][x]], f[x]);
    double tmp = 0;
    for (int x : v) tmp += max_p[g[i][x]], max_p[g[i][x]] = 0;
    ret = max(ret, tmp);
  }
  return ret;
}
vector<int> vec[N];
double solve(int s, int n) {
  for (int i = 0; i < (n); ++i) vec[i].clear();
  for (int i = (1); i <= (n); ++i) vec[g[s][i]].push_back(i);
  double ret = 0;
  for (int i = 0; i < (n); ++i) {
    if (!vec[i].size()) continue;
    double tmp1 = 1.0 / vec[i].size();
    double tmp2 = solve1(s, n, vec[i]);
    ret += max(tmp1, tmp2) * (double)vec[i].size() / n;
  }
  return ret;
}
int main() {
  int n, m, u, v;
  while (cin >> n >> m) {
    memset(g, 0x3f, sizeof(g));
    for (int i = (1); i <= (n); ++i) g[i][i] = 0, adj[i].clear();
    while (m--) {
      scanf("%d%d", &u, &v);
      g[u][v] = g[v][u] = 1;
      adj[u].push_back(v), adj[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]);
    double ret = 0;
    for (int i = (1); i <= (n); ++i) ret = max(ret, solve(i, n));
    printf("%.8lf\n", ret);
  }
  return 0;
}
