src/main/java/thinkd/ExampleAcc.java
/**
     * Example Code for ThinkD (Accurate Ver.)
     * @throws IOException
     */
Example Code for ThinkD (Accurate Ver.)
@throws IOException
Example Code for ThinkD ( Accurate Ver . ) @throws IOException
public static void main(String[] ar) throws IOException {
        final String dataPath = "example_graph.txt";
        final String delim = "\t";
        final ThinkD module = new ThinkDAcc(72000, 0);
        BufferedReader br = new BufferedReader(new FileReader(dataPath));
        int count = 0;
        while(true) {
            final String line = br.readLine();
            if(line == null) {
                break;
            }
            int[] edge = Common.parseEdge(line, delim);
            if(edge[2] > 0) {
                module.processAddition(edge[0], edge[1]);
            }
            else {
                module.processDeletion(edge[0], edge[1]);
            }
            if((++count) % 10000 == 0) {
                System.out.println("Number of Elements Processed: " + count +", Estimated Number of Global Triangles: " + module.getGlobalTriangle());
            }
        }
        br.close();
        return;
    }
public static void main ( String [ ] ar ) throws IOException { final String dataPath = "example_graph.txt" ; final String delim = "\t" ; final ThinkD module = new ThinkDAcc ( 72000 , 0 ) ; BufferedReader br = new BufferedReader ( new FileReader ( dataPath ) ) ; int count = 0 ; while ( true ) { final String line = br . readLine ( ) ; if ( line == null ) { break ; } int [ ] edge = Common . parseEdge ( line , delim ) ; if ( edge [ 2 ] > 0 ) { module . processAddition ( edge [ 0 ] , edge [ 1 ] ) ; } else { module . processDeletion ( edge [ 0 ] , edge [ 1 ] ) ; } if ( ( ++ count ) % 10000 == 0 ) { System . out . println ( "Number of Elements Processed: " + count + ", Estimated Number of Global Triangles: " + module . getGlobalTriangle ( ) ) ; } } br . close ( ) ; return ; }
Example Code for ThinkD (Accurate Ver.)
Example Code for ThinkD ( Accurate Ver . )