Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/882#discussion_r207375700
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
---
@@ -2451,6 +2452,24 @@ else if (value instanceof Traversal)
return this.asAdmin().addStep((Step<E, E>) new
PeerPressureVertexProgramStep(this.asAdmin()));
}
+ /**
+ * Executes a Shortest Path algorithm over the graph.
+ *
+ * @return the traversal with the appended {@link
ShortestPathVertexProgramStep}
+ * @see <a
href="http://tinkerpop.apache.org/docs/${project.version}/reference/#shortestpath-step"
target="_blank">Reference Documentation - ShortestPath Step</a>
+ */
+ public default GraphTraversal<S, Path> shortestPath() {
+ if (this.asAdmin().getEndStep() instanceof GraphStep) {
--- End diff --
Oh, totally forgot about this corner case (that's something you should test
in `ConnectedComponentVP` too). And right, if you only have `g.V().has(...)`
followed by a VP step, your VP won't see any halted traversers and thus behave
like it was just `g.V()`. I spent quite some time trying to fix that properly,
but couldn't come up with anything.
---