jybsuper
jybsuper

Reputation: 179

How to avoid duplicate edges in the path in Tinkerpop 3?

In Tinkerpop3, we have SimplePath to prevent a traverser repeating the vertices. But what if I want it to traverse each edge only once?

For example,Graph. In this graph, I want to get all the possible path if I start from V1 and traverse each edge no more than once per path and then return to V1 at last. One possible path is V1->E2->V2->E1->V1->E5->V4->E7->V3->E3->V1.

Upvotes: 0

Views: 571

Answers (1)

Daniel Kuppitz
Daniel Kuppitz

Reputation: 10904

I remember this graph and just recently answered a similar question here: Query to check if there is a cycle in a graph with edges visited only once This should answer your question too.

Upvotes: 1

Related Questions