diff --git a/Documentation/Books/AQL/Examples/MultiplePaths.md b/Documentation/Books/AQL/Examples/MultiplePaths.md
index af1862cee1..759802af9f 100644
--- a/Documentation/Books/AQL/Examples/MultiplePaths.md
+++ b/Documentation/Books/AQL/Examples/MultiplePaths.md
@@ -10,32 +10,33 @@ then a shortest path query from **A** to **C** may return the path `A -> B -> C`
You can use the efficient shortest path algorithm however, to determine the shortest path length:
-```
-RETURN LENGTH(
- FOR v IN OUTBOUND
- SHORTEST_PATH "verts/A" TO "verts/C" edges
- RETURN v
-)
-```
+
+ @startDocuBlockInline GRAPHTRAV_multiplePathSearch
+ @EXAMPLE_AQL{GRAPHTRAV_multiplePathSearch}
+ @DATASET{mps_graph}
+ RETURN LENGTH(
+ FOR v IN OUTBOUND
+ SHORTEST_PATH "verts/A" TO "verts/C" edges
+ RETURN v
+ )
+ @END_EXAMPLE_AQL
+ @endDocuBlock GRAPHTRAV_multiplePathSearch
+
The result is 3 for the example graph (includes the start vertex). Now, subtract 1 to get the edge count / traversal depth. You can run a pattern matching traversal to find all paths with this length (or longer ones by increasing the min and max depth). Starting point is **A** again, and a filter on the document ID of v (or p.vertices[-1]) ensures that we only retrieve paths that end at point **C**.
The following query returns all parts with length 2, start vertex **A** and target vertex **C**:
-```
-FOR v, e, p IN 2..2 OUTBOUND "verts/A" edges
- FILTER v._id == "verts/C"
- RETURN CONCAT_SEPARATOR(" -> ", p.vertices[*]._key)
-```
-Output:
+ @startDocuBlockInline GRAPHTRAV_multiplePathSearch2
+ @EXAMPLE_AQL{GRAPHTRAV_multiplePathSearch2}
+ @DATASET{mps_graph}
+ FOR v, e, p IN 2..2 OUTBOUND "verts/A" edges
+ FILTER v._id == "verts/C"
+ RETURN CONCAT_SEPARATOR(" -> ", p.vertices[*]._key)
+ @END_EXAMPLE_AQL
+ @endDocuBlock GRAPHTRAV_multiplePathSearch2
-```
-[
- "A -> B -> C",
- "A -> D -> C"
-]
-```
A traversal depth of `3..3` would return `A -> E -> F -> C` and `2..3` all three paths.
diff --git a/Documentation/Examples/GRAPHTRAV_multiplePathSearch.generated b/Documentation/Examples/GRAPHTRAV_multiplePathSearch.generated
new file mode 100644
index 0000000000..313680923f
--- /dev/null
+++ b/Documentation/Examples/GRAPHTRAV_multiplePathSearch.generated
@@ -0,0 +1,11 @@
+@Q:
+ RETURN LENGTH(
+ FOR v IN OUTBOUND
+ SHORTEST_PATH "verts/A" TO "verts/C" edges
+ RETURN v
+ )
+
+@R
+[
+ 3
+]
\ No newline at end of file
diff --git a/Documentation/Examples/GRAPHTRAV_multiplePathSearch2.generated b/Documentation/Examples/GRAPHTRAV_multiplePathSearch2.generated
new file mode 100644
index 0000000000..c69980d14b
--- /dev/null
+++ b/Documentation/Examples/GRAPHTRAV_multiplePathSearch2.generated
@@ -0,0 +1,10 @@
+@Q:
+ FOR v, e, p IN 2..2 OUTBOUND "verts/A" edges
+ FILTER v._id == "verts/C"
+ RETURN CONCAT_SEPARATOR(" -> ", p.vertices[*]._key)
+
+@R
+[
+ "A -> B -> C",
+ "A -> D -> C"
+]
\ No newline at end of file
diff --git a/js/common/modules/@arangodb/examples/examples.js b/js/common/modules/@arangodb/examples/examples.js
index 36fe18c11e..7b6d636f59 100644
--- a/js/common/modules/@arangodb/examples/examples.js
+++ b/js/common/modules/@arangodb/examples/examples.js
@@ -37,6 +37,14 @@ exports.Examples = {
examples.dropGraph("traversalGraph");
}
},
+ 'mps_graph': {
+ createDS: function() {
+ examples.loadGraph("mps_graph");
+ },
+ removeDS: function() {
+ examples.dropGraph("mps_graph");
+ }
+ },
'joinSampleDataset': {
createDS: function() {
db._create("users");
diff --git a/js/common/modules/@arangodb/graph-examples/example-graph.js b/js/common/modules/@arangodb/graph-examples/example-graph.js
index f712e30dbf..3dc63134f7 100644
--- a/js/common/modules/@arangodb/graph-examples/example-graph.js
+++ b/js/common/modules/@arangodb/graph-examples/example-graph.js
@@ -52,6 +52,28 @@ var createTraversalExample = function () {
return g;
};
+// we create a graph with 'edges' pointing from 'verts' to 'verts'
+var createMpsTraversal = function () {
+ var g = Graph._create('mps_graph',
+ [Graph._relation('edges', 'verts', 'verts')]
+ );
+ var a = g.verts.save({_key: 'A'});
+ var b = g.verts.save({_key: 'B'});
+ var c = g.verts.save({_key: 'C'});
+ var d = g.verts.save({_key: 'D'});
+ var e = g.verts.save({_key: 'E'});
+ var f = g.verts.save({_key: 'F'});
+ g.edges.save(a._id, b._id, {vertex:a._key});
+ g.edges.save(a._id, e._id, {vertex:a._key});
+ g.edges.save(a._id, d._id, {vertex:a._key});
+ g.edges.save(b._id, c._id, {vertex:b._key});
+ g.edges.save(d._id, c._id, {vertex:d._key});
+ g.edges.save(e._id, f._id, {vertex:e._key});
+ g.edges.save(f._id, c._id, {vertex:f._key});
+ return g;
+};
+
+
// we create a graph with 'relation' pointing from 'female' to 'male' and 'male
var createSocialGraph = function () {
db._create("female");
@@ -375,6 +397,9 @@ var knownGraphs = {
'knows_graph': {create: createTraversalExample, dependencies: [
'knows', 'persons'
]},
+ 'mps_graph': {create: createMpsTraversal, dependencies: [
+ 'edges', 'verts'
+ ]},
'routeplanner': {create: createRoutePlannerGraph, dependencies: [
'frenchHighway', 'frenchCity', 'germanCity', 'germanHighway', 'internationalHighway'
]},