更新时间:2022-12-08 GMT+08:00

Common_neighbors算法

您可以使用GES提供的接口执行common_neighbors算法。示例代码如下

public static void executeAlgorithm(GraphClient graphClient) throws ApiException
{
CommonNeighborsParameters parameters = new CommonNeighborsParameters();
parameters.setSource("46");
parameters.setTarget("38");
AlgorithmReq req = new AlgorithmReq();
req.setAlgorithmName(AlgorithmNames.COMMON_NEIGHBORS);
req.setParameters(parameters);
AsyncAPIResp asyncAPIResp = graphClient.algorithmQuery(req);
String jobId = asyncAPIResp.getJobId();
CommonNeighborsJobReq req1 = new CommonNeighborsJobReq();
req1.setJobId(jobId);
System.out.println(graphClient.queryJobStatus(req1));
}