@Override
        public int compare(Edge<Integer> edge1, Edge<Integer> edge2) {
            if (edge1.getWeight() <= edge2.getWeight()) {
                return -1;
            } else {
                return 1;
            }
        }
Comparator to sort edges by weight in non decreasing order
src/com/interview/graph/KruskalMST.java