1
0
Fork 0
arangodb/Documentation/Examples/generalGraphModuleShortestP...

270 lines
7.3 KiB
Plaintext

arangosh> var examples = require("org/arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("routeplanner");
arangosh> g._shortestPath({}, {}, {weight : 'distance', endVertexCollectionRestriction : 'frenchCity',
........> startVertexCollectionRestriction : 'germanCity'});
[
[
{
"startVertex" : "germanCity/Berlin",
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
},
"paths" : [
{
"edges" : [
{
"_id" : "internationalHighway/496036187",
"_key" : "496036187",
"_rev" : "496036187",
"_from" : "germanCity/Berlin",
"_to" : "frenchCity/Lyon",
"distance" : 1100
}
],
"vertices" : [
{
"_id" : "germanCity/Berlin",
"_key" : "Berlin",
"_rev" : "493676891",
"isCapital" : true,
"population" : 3000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
}
]
}
],
"distance" : 1100
},
{
"startVertex" : "germanCity/Berlin",
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
},
"paths" : [
{
"edges" : [
{
"_id" : "internationalHighway/496232795",
"_key" : "496232795",
"_rev" : "496232795",
"_from" : "germanCity/Berlin",
"_to" : "frenchCity/Paris",
"distance" : 1200
}
],
"vertices" : [
{
"_id" : "germanCity/Berlin",
"_key" : "Berlin",
"_rev" : "493676891",
"isCapital" : true,
"population" : 3000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
}
]
}
],
"distance" : 1200
},
{
"startVertex" : "germanCity/Cologne",
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
},
"paths" : [
{
"edges" : [
{
"_id" : "internationalHighway/497019227",
"_key" : "497019227",
"_rev" : "497019227",
"_from" : "germanCity/Cologne",
"_to" : "frenchCity/Paris",
"distance" : 550
}
],
"vertices" : [
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "493873499",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
}
]
}
],
"distance" : 550
},
{
"startVertex" : "germanCity/Cologne",
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
},
"paths" : [
{
"edges" : [
{
"_id" : "internationalHighway/496822619",
"_key" : "496822619",
"_rev" : "496822619",
"_from" : "germanCity/Cologne",
"_to" : "frenchCity/Lyon",
"distance" : 700
}
],
"vertices" : [
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "493873499",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
}
]
}
],
"distance" : 700
},
{
"startVertex" : "germanCity/Hamburg",
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
},
"paths" : [
{
"edges" : [
{
"_id" : "internationalHighway/496429403",
"_key" : "496429403",
"_rev" : "496429403",
"_from" : "germanCity/Hamburg",
"_to" : "frenchCity/Paris",
"distance" : 900
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "494070107",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "494659931",
"isCapital" : true,
"population" : 4000000
}
]
}
],
"distance" : 900
},
{
"startVertex" : "germanCity/Hamburg",
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
},
"paths" : [
{
"edges" : [
{
"_id" : "germanHighway/495380827",
"_key" : "495380827",
"_rev" : "495380827",
"_from" : "germanCity/Hamburg",
"_to" : "germanCity/Cologne",
"distance" : 500
},
{
"_id" : "internationalHighway/496822619",
"_key" : "496822619",
"_rev" : "496822619",
"_from" : "germanCity/Cologne",
"_to" : "frenchCity/Lyon",
"distance" : 700
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "494070107",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "493873499",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "494463323",
"isCapital" : false,
"population" : 80000
}
]
}
],
"distance" : 1200
}
]
]