#include <bits/stdc++.h>
using namespace std;
const int MAX = 500;
vector<int> edge[MAX];
int G[MAX][MAX];
int cnt_nxt[MAX];
double p_nxt[MAX], p_dist[MAX];
bool vis[MAX];
int n, m;
double solve(int g1, int dist1) {
  double rst = 0;
  for (int i = 1; i <= n; i++) {
    p_nxt[i] = 0;
    vis[i] = false;
  }
  vector<int> city;
  for (int v = 1; v <= n; v++) {
    if (G[g1][v] != dist1) continue;
    for (auto b : edge[v]) {
      p_nxt[b] += 1.0 / n / edge[v].size();
      if (!vis[b]) vis[b] = true, city.push_back(b);
    }
  }
  for (int g2 = 1; g2 <= n; g2++) {
    double tmp = 0;
    for (auto b : city) p_dist[G[g2][b]] = max(p_dist[G[g2][b]], p_nxt[b]);
    for (auto b : city) {
      tmp += p_dist[G[g2][b]];
      p_dist[G[g2][b]] = 0;
    }
    rst = max(rst, tmp);
  }
  return rst;
}
int main() {
  scanf("%d %d", &n, &m);
  memset(G, 0x3f, sizeof(G));
  for (int i = 1; i <= n; i++) G[i][i] = 0;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
    G[u][v] = G[v][u] = 1;
  }
  for (int b = 1; b <= n; b++) {
    for (int a = 1; a <= n; a++) {
      for (int c = 1; c <= n; c++) {
        G[a][c] = min(G[a][c], G[a][b] + G[b][c]);
      }
    }
  }
  double ans = 0;
  for (int g1 = 1; g1 <= n; g1++) {
    double tans = 0;
    for (int dist1 = 0; dist1 <= n; dist1++) {
      int cnt_city = 0;
      for (int i = 1; i <= n; i++)
        if (G[g1][i] == dist1) cnt_city++;
      if (!cnt_city) continue;
      tans += max(1.0 / n, solve(g1, dist1));
    }
    ans = max(tans, ans);
  }
  printf("%.12f\n", ans);
}
