@@ -0,0 +1,2794 @@
+/*%0AThis class is written following the format in the Oracle PGX core demo%0A*/%0Aimport static oracle.pgx.api.algorithms.Argument.createGraphArg;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport oracle.pgx.api.Core;%0Aimport oracle.pgx.api.InvocationResult;%0Aimport oracle.pgx.api.LoadingResult;%0Aimport oracle.pgx.api.admin.Control;%0Aimport oracle.pgx.api.admin.Pgx;%0Aimport oracle.pgx.api.algorithms.Argument;%0Aimport oracle.pgx.api.algorithms.BuiltinAlgorithms;%0Aimport oracle.pgx.api.analyst.PropertyProxy;%0Aimport oracle.pgx.api.config.GraphConfig;%0Aimport oracle.pgx.common.Types.PropertyType;%0A%0Apublic class ApproximateBC %7B%0A%0A  public static void main(String%5B%5D argv) throws Exception %7B%0A%0A    if (argv.length != 2) %7B%0A      System.err.println(%22usage: %22 + ApproximateBC.class.getName() + %22 %3Cgraph config path%3E%22%0A                          + %22 %3Cnumber of random selected seed nodes to use%3E %22);%0A      System.exit(-1);%0A    %7D%0A    GraphConfig cfg = GraphConfig.fromPath(argv%5B0%5D);%0A%0A    String sessionId = null;%0A    Core core = null;%0A    try %7B%0A      core = Pgx.getCore();%0A      sessionId = core.createSession(%22my-session%22).get();%0A      LoadingResult graph = core.loadGraphWithProperties(sessionId, cfg).get();%0A      String graphName = graph.getGraphName();%0A%0A      %7B%0A        String BCName = core.createNodeProperty(sessionId, graphName, PropertyType.DOUBLE).get();%0A        String ApproxBC = BuiltinAlgorithms.Type.PGX_BUILTIN_K3b_APPROX_NODE_BETWEENNESS_CENTRALITY.getAnalysisName();%0A        Argument%5B%5D args = new Argument%5B%5D %7B%0A          Argument.createGraphArg(graphName), %0A          Argument.createIntArg(Integer.parseInt(argv%5B1%5D)),%0A          Argument.createNodePropertyArg(BCName)%0A        %7D;%0A%0A        InvocationResult%3CVoid%3E ir = core.runAnalysis(sessionId, ApproxBC, args, Void.class).get();%0A        if (ir.isSuccess()) %7B%0A          System.out.println(%22Approximate BC computed in %22 + ir.getExecutionTimeMs() + %22 milliseconds%22);%0A        %7D else %7B%0A          ir.getException().printStackTrace();%0A        %7D%0A        // uncomment the following and adjust accordingly if you want to see the result%0A        // make sure the getNodePropertyValue is called on an existing node%0A        /*%0A        PropertyProxy%3CDouble%3E bc = core.%3CDouble%3EgetNodePropertyProxy(sessionId, graphName, BCName).get();%0A        double value = (Double) core.getNodePropertyValue(sessionId, graphName, BCName, 1).get();%0A        System.out.println(%22getNodePropertyValue(1) = %22 + value);%0A        Iterable%3CMap.Entry%3CObject, Double%3E%3E top3 = bc.getTopKValues(3);%0A        System.out.println(%22top3 = %22 + top3);%0A        */%0A      %7D%0A%0A    %7D finally %7B%0A%0A      Control ctrl = Pgx.getControl();%0A      if (ctrl.isRunning()) %7B%0A        if (sessionId != null) %7B%0A          core.destroySession(sessionId).get();%0A        %7D%0A        ctrl.shutdownNow();%0A      %7D%0A    %7D%0A  %7D%0A%0A%7D%0A

Create ApproximateBC.java