[
https://issues.apache.org/jira/browse/TINKERPOP-1967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16561210#comment-16561210
]
ASF GitHub Bot commented on TINKERPOP-1967:
-------------------------------------------
Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/897#discussion_r205981525
--- Diff: docs/src/recipes/connected-components.asciidoc ---
@@ -35,46 +54,92 @@ g.addV().property(id, "A").as("a").
addE("link").from("d").to("e").iterate()
----
-One way to detect the various subgraphs would be to do something like this:
+==== Small graph traversals
+Connected components in a small graph can be determined with either an
OLTP traversal or the OLAP
+`connectedComponent()`-step. The `connectedComponent()`-step is available
as of TinkerPop 3.4.0 and is
+described in more detail in the
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#connectedcomponent-step[Reference
Documentation].
+The traversal looks like:
[gremlin-groovy,existing]
----
-g.V().emit(cyclicPath().or().not(both())).repeat(both()).until(cyclicPath()).
<1>
- path().aggregate("p").
<2>
- unfold().dedup().
<3>
- map(__.as("v").select("p").unfold().
<4>
- filter(unfold().where(eq("v"))).
- unfold().dedup().order().by(id).fold()).
- dedup()
<5>
+g.withComputer().V().connectedComponent().
+ group().by('gremlin.connectedComponentVertexProgram.component').
--- End diff --
I think you should use the constant
`ConnectedComponentVertexProgram.COMPONENT`.
> Add a connectedComponent() step
> -------------------------------
>
> Key: TINKERPOP-1967
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1967
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.3.3
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Minor
> Fix For: 3.4.0
>
>
> Given TINKERPOP-1852 we should probably just simplify and improve performance
> of connected component identification. Implementing this will involved the
> creation of {{ConnectedComponentVertexProgram}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)