@Override
        public int compareTo(Pair p) {
            return (int) (this.weight - p.weight);
        }
This is optimized version of shortest path algorithm, whose running time is O(E logE)
this works better than other implementations in practise
src/algo/graph/Dijsktra.java