[ 
https://issues.apache.org/jira/browse/TINKERPOP-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17701310#comment-17701310
 ] 

Stephen Mallette commented on TINKERPOP-2851:
---------------------------------------------

You have to be careful with {{repeat()}}. It doesn't surprise me that you could 
experience a timeout with:

{code}
g.V(36).repeat(out().simplePath()).until(hasId(259)).
            repeat(out()).until(hasId(21)).path()
{code}

your second {{repeat(out())}} traverses until it finds 21. that's good, you at 
least have some limit to the {{repeat()}} but what if the graph has a cycle in 
those 10 vertices and 20 edges and vertex 21 is never hit? It will just keep 
traversing until it times out. you could perhaps add another {{simplePath()}} 
assuming those are the semantics you want there.

> TinkerPop could not deal with correct path traversal results
> ------------------------------------------------------------
>
>                 Key: TINKERPOP-2851
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2851
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.10, 3.6.1
>         Environment: Version: 3.4.10
> Storage Backend: in-memory
>            Reporter: Zeyang Zhuang
>            Priority: Major
>
> - Expected Behavior:
> We construct the following scenario: x equals count nodes(A->B) path numbers, 
> y equals count nodes(B->C) path numbers, z equals count(A->B->C) path 
> numbers. Then z should equal to x*y.
> We generate graph schema and data based on random strings and values. We 
> build the graph with 100 vertexes, 200 edges, 20 vertex labels, and 20 edge 
> labels.
> `g.V().id()` is used to get the node ids of the graph, then can use for loop 
> to traverse all the nodes. Here is one of our examples executed.
> 1) `g.V(46).repeat(out().simplePath()).until(hasId(0)).path().size()` return 9
> 2) `g.V(0).repeat(out().simplePath()).until(hasId(276)).path().size()` return 
> 8
> 3) 
> `g.V(46).repeat(out().simplePath()).until(hasId(0)).repeat(out().simplePath()).until(hasId(276)).path().size()`,
>  should return 9*8.
> - Current Behavior:
> The query 3 return 7 != 9*8.
> - Steps to Reproduce:
> Although the randomness of the graph data generation process, we still find 
> the problem after many attempts. Reproduce: Generate a large enough graph -> 
> Get all node ids -> Count the number of paths for any two ids -> Multiply and 
> compare following our strategy.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to