public int networkDelayTime(int[][] times, int n, int k) {
        if (times == null || times.length == 0)
            return 0;
        Map<Integer, Map<Integer, Integer>> map = new HashMap<>();
        for (int i = 0; i < times.length; i++) {
            int[] current = times[i];
            Map<Integer, Integer> set = map.getOrDefault(current[0], new HashMap<>());
            set.put(current[1], current[2]);
            map.put(current[0], set);
        }
        if (!bfs(map, n, k))
            return -1;

        int[] d = new int[n + 1];
        Arrays.fill(d, Integer.MAX_VALUE);
        d[k] = 0;
        int max = 0;
        for (int i = 1; i < n; i++) {
            for (Integer node : map.keySet()) {
                Map<Integer, Integer> current = map.get(node);
                if (d[node] == Integer.MAX_VALUE)
                    continue;
                for (Integer nei : current.keySet()) {
                    int dis = d[node] + current.get(nei);
                    d[nei] = Math.min(d[nei], dis);
                }
            }
        }
        for (int i = 0; i < d.length; i++) {
            max = Math.max(max, d[i] == Integer.MAX_VALUE ? 0 : d[i]);
        }
        return max;
    }
Why Did you create this class? what does it do?
src/problems/medium/NetworkDelay.java