|
43 | 43 | import org.neo4j.gds.core.loading.validation.NodePropertyTypeGraphStoreValidation; |
44 | 44 | import org.neo4j.gds.core.loading.validation.SeedPropertyGraphStoreValidation; |
45 | 45 | import org.neo4j.gds.core.loading.validation.UndirectedOnlyGraphStoreValidation; |
| 46 | +import org.neo4j.gds.core.utils.paged.dss.DisjointSetStruct; |
46 | 47 | import org.neo4j.gds.hdbscan.HDBScanParameters; |
47 | 48 | import org.neo4j.gds.hdbscan.Labels; |
48 | 49 | import org.neo4j.gds.k1coloring.K1ColoringParameters; |
|
70 | 71 | import org.neo4j.gds.triangle.TriangleCountParameters; |
71 | 72 | import org.neo4j.gds.triangle.TriangleCountResult; |
72 | 73 | import org.neo4j.gds.triangle.TriangleResult; |
| 74 | +import org.neo4j.gds.wcc.WccParameters; |
73 | 75 |
|
74 | 76 | import java.util.List; |
75 | 77 | import java.util.Optional; |
@@ -603,5 +605,35 @@ public <TR> CompletableFuture<TR> triangles( |
603 | 605 | ).thenApply(resultTransformerBuilder.build(graphResources)); |
604 | 606 | } |
605 | 607 |
|
| 608 | + public <TR> CompletableFuture<TR> wcc( |
| 609 | + GraphName graphName, |
| 610 | + GraphParameters graphParameters, |
| 611 | + Optional<String> relationshipProperty, |
| 612 | + WccParameters parameters, |
| 613 | + JobId jobId, |
| 614 | + boolean logProgress, |
| 615 | + ResultTransformerBuilder<TimedAlgorithmResult<DisjointSetStruct>, TR> resultTransformerBuilder |
| 616 | + ) { |
| 617 | + // Fetch the Graph the algorithm will operate on |
| 618 | + var graphResources = graphStoreCatalogService.fetchGraphResources( |
| 619 | + graphName, |
| 620 | + graphParameters, |
| 621 | + relationshipProperty, |
| 622 | + SeedPropertyGraphStoreValidation.create(parameters.seedProperty().orElse(null)), |
| 623 | + Optional.empty(), |
| 624 | + user, |
| 625 | + databaseId |
| 626 | + ); |
| 627 | + var graph = graphResources.graph(); |
| 628 | + |
| 629 | + return computeFacade.wcc( |
| 630 | + graph, |
| 631 | + parameters, |
| 632 | + jobId, |
| 633 | + logProgress |
| 634 | + |
| 635 | + ).thenApply(resultTransformerBuilder.build(graphResources)); |
| 636 | + } |
| 637 | + |
606 | 638 |
|
607 | 639 | } |
0 commit comments