#include <bits/stdc++.h>
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << " = " << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << " = " << h << ", ";
  _dbg(sdbg + 1, a...);
}
const int maxn = (1e3) + 7;
const int maxk = 20;
const int inf = (1e9) + 7;
const long long LLinf = (1e18) + 7;
const long double eps = 1e-9;
const long long mod = 1e9 + 7;
vector<int> wek[maxn];
int odl[maxn][maxn];
long double p[maxn];
bool vis[maxn];
int n;
long double res[maxn];
long double ress = 0.0;
long double dru(int pier, int dist) {
  for (int i = 0; i <= n; i++) vis[i] = 0, p[i] = 0.0;
  vector<int> V;
  for (int i = 1; i <= n; i++)
    if (odl[i][pier] == dist)
      for (auto s : wek[i]) {
        p[s] += (1 / (long double)n) / (long double)((int)(wek[i]).size());
        if (vis[s] == 0) {
          vis[s] = 1;
          V.push_back(s);
        }
      }
  long double xd = 0.0;
  for (int i = 1; i <= n; i++) {
    long double cnt = 0.0;
    for (auto s : V) res[odl[s][i]] = max(res[odl[s][i]], p[s]);
    for (auto s : V) {
      cnt += res[odl[s][i]];
      res[odl[s][i]] = 0.0;
    }
    xd = max(xd, cnt);
  }
  return xd;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) odl[i][j] = inf;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    odl[a][b] = odl[b][a] = 1;
    wek[a].push_back(b);
    wek[b].push_back(a);
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        odl[i][j] = min(odl[i][j], odl[i][k] + odl[k][j]);
  for (int i = 1; i <= n; i++) {
    long double suma = 0.0;
    for (int d = 0; d <= n; d++) {
      int ile = 0;
      for (int j = 1; j <= n; j++)
        if (odl[i][j] == d) ile++;
      if (ile == 0) continue;
      long double cnt1 = 1.0 / (long double)n;
      long double cnt2 = dru(i, d);
      suma += max(cnt1, cnt2);
    }
    ress = max(ress, suma);
  }
  cout << fixed << setprecision(20) << ress;
  return 0;
}
