@@ -0,0 +1,1745 @@
+package com.yipeipei.algs;%0A%0Aimport java.util.HashSet;%0A%0A/**%0A * 2 hop labels of vertex v%0A * @author peipei%0A *%0A */%0Apublic class HopLabel %7B%0A    int v;  // 2 hop label of vertex v, default -1%0A    HashSet%3CInteger%3E lin;%0A    HashSet%3CInteger%3E lout;%0A    %0A    public HopLabel(int v)%7B%0A        this.v = v;%0A        this.lin = new HashSet%3CInteger%3E();%0A        this.lout = new HashSet%3CInteger%3E();%0A    %7D%0A    %0A    public HopLabel()%7B%0A        this(-1);%0A    %7D%0A    %0A    /**%0A     * reachability query u-%3Ev, aka. lout(u) %5Ccap lin(v)%0A     * @return%0A     */%0A    public boolean reach(HopLabel v)%7B%0A        throw new UnsupportedOperationException(%22under construction...%22);%0A    %7D%0A    %0A    @Override%0A    public String toString() %7B%0A        StringBuilder sb = new StringBuilder();%0A        String NEWLINE = System.getProperty(%22line.separator%22);%0A        %0A        sb.append(NEWLINE + this.v);    // head new line%0A        sb.append(NEWLINE + %22Lin:  %22);%0A        sb.append(this.lin.toString());%0A        sb.append(NEWLINE + %22Lout: %22);%0A        sb.append(this.lout.toString());%0A        sb.append(NEWLINE); // tail new line%0A        %0A        return sb.toString();%0A    %7D%0A%0A    /**%0A     * test whether the intersection of two set is empty%0A     * @param lout%0A     * @param lin%0A     * @return%0A     */%0A    public static boolean intersectionNotEmpty(HashSet%3CInteger%3E lout, HashSet%3CInteger%3E lin)%7B%0A        throw new UnsupportedOperationException(%22under construction...%22);%0A    %7D%0A    %0A    /**%0A     * calculate the intersection of two set%0A     * @param lout%0A     * @param lin%0A     * @return intersection, in HashSet%3C%3E%0A     */%0A    public static HashSet%3CInteger%3E intersection(HashSet%3CInteger%3E lout, HashSet%3CInteger%3E lin)%7B%0A        throw new UnsupportedOperationException(%22under construction...%22);%0A    %7D%0A%7D%0A

create HopLabel for 2 hop labels of vertex v