#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool readInteger(T& x) {
  char c, r = 0, n = 0;
  x = 0;
  while (true) {
    c = getchar();
    if (c < 0 && !r)
      return 0;
    else if (c == '-' && !r)
      n = 1;
    else if (c >= '0' && c <= '9')
      x = x * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) x = -x;
  return 1;
}
template <typename T>
vector<T> readIntegral(int n) {
  vector<T> ret(n);
  for (int i = 0; i < n; i++) readInteger(ret[i]);
  return ret;
}
auto readInts = readIntegral<int>;
auto readLongs = readIntegral<long long>;
template <typename T, T MOD>
struct ModInt {
  T value;
  ModInt() : value(0) {}
  ModInt(T x) {
    x %= MOD;
    if (x < 0) x += MOD;
    value = x;
  }

 public:
  ModInt& operator+=(ModInt x) {
    value += x.value;
    if (value >= MOD) value -= MOD;
    return *this;
  }
  ModInt& operator-=(ModInt x) {
    value -= x.value;
    if (value < 0) value += MOD;
    return *this;
  }
  ModInt& operator*=(ModInt x) {
    value *= x.value;
    value %= MOD;
    return *this;
  }
  ModInt& operator/=(ModInt x) {
    x.invert();
    return *this *= x;
  }
  ModInt operator+(ModInt x) const {
    ModInt o = *this;
    o += x;
    return o;
  }
  ModInt operator-(ModInt x) const {
    ModInt o = *this;
    o -= x;
    return o;
  }
  ModInt operator*(ModInt x) const {
    ModInt o = *this;
    o *= x;
    return o;
  }
  ModInt operator/(ModInt x) const {
    ModInt o = *this;
    o /= x;
    return o;
  }
  bool operator==(ModInt x) const { return value == x.value; }
  bool operator!=(ModInt x) const { return !(*this == x); }
  ModInt operator-() const { return ModInt(0) - *this; }
  ModInt operator^(long long x) const {
    ModInt ret = 1 % MOD;
    ModInt mul = *this;
    while (x) {
      if (x & 1) ret *= mul;
      mul *= mul;
      x >>= 1;
    }
    return ret;
  }
  ModInt& operator^=(long long x) { return *this = *this ^ x; }

 private:
  void invert() { *this ^= MOD - 2; }

 public:
  void answer() { std::cout << value << std::endl; }
};
const int MX = 405;
vector<int> E[MX];
int D[MX][MX];
int n, m;
template <typename T>
void uniquify(vector<T>& v) {
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
}
vector<pair<int, double>> process(vector<pair<int, double>>& v) {
  vector<pair<int, double>> ret;
  sort(v.begin(), v.end());
  for (auto& pr : (v)) {
    if (ret.empty() || pr.first != ret.back().first) {
      ret.push_back(pr);
    } else {
      ret.back().second += pr.second;
    }
  }
  return ret;
}
double dpr[MX];
double stamp[MX];
double f(int x) {
  double base = 1.0 / n;
  vector<double> pdist(n);
  vector<int> countAt(n);
  for (int i = (0); i < int(n); ++i) pdist[D[x][i]] += base;
  for (int i = (0); i < int(n); ++i) ++countAt[D[x][i]];
  vector<vector<pair<int, double>>> possLoc(n);
  for (int i = (0); i < int(n); ++i)
    for (auto& o : (E[i])) possLoc[D[x][i]].push_back({o, base / E[i].size()});
  double tot = 0;
  for (int i = (0); i < int(n); ++i) {
    if (countAt[i] == 0) continue;
    double catchChance = 1.0 / countAt[i];
    possLoc[i] = process(possLoc[i]);
    for (auto& pr : (possLoc[i])) pr.second /= pdist[i];
    for (int j = (0); j < int(n); ++j) stamp[j] = -1;
    for (int j = (0); j < int(n); ++j) {
      double ccatch = 0;
      for (auto& pr : (possLoc[i])) {
        if (stamp[D[j][pr.first]] != j) {
          stamp[D[j][pr.first]] = j;
          dpr[D[j][pr.first]] = 0;
        }
        if (pr.second > dpr[D[j][pr.first]]) {
          ccatch += pr.second - dpr[D[j][pr.first]];
          dpr[D[j][pr.first]] = pr.second;
        }
      }
      catchChance = max(catchChance, ccatch);
    }
    tot += pdist[i] * catchChance;
  }
  return tot;
}
int main() {
  for (int i = (0); i < int(MX); ++i)
    for (int j = (0); j < int(MX); ++j) D[i][j] = ((int)1e9 + 10);
  readInteger(n);
  readInteger(m);
  for (int i = (0); i < int(n); ++i) D[i][i] = 0;
  for (int k = (0); k < int(m); ++k) {
    int a, b;
    readInteger(a);
    readInteger(b);
    --a;
    --b;
    D[a][b] = min(D[a][b], 1);
    D[b][a] = min(D[b][a], 1);
    E[a].push_back(b);
    E[b].push_back(a);
  }
  for (int i = (0); i < int(n); ++i)
    for (int j = (0); j < int(n); ++j)
      for (int k = (0); k < int(n); ++k)
        D[j][k] = min(D[j][k], D[j][i] + D[i][k]);
  double ans = 0;
  for (int i = (0); i < int(n); ++i) ans = max(ans, f(i));
  printf("%.10f\n", ans);
}
