diff --git a/exercice2.md b/exercice2.md index 73fb37b..8531455 100644 --- a/exercice2.md +++ b/exercice2.md @@ -60,7 +60,7 @@ MATCH (p:Point) DETACH DELETE p; 2. Quel est le plus court chemin entre le casino et la falaise -a. Un chemin comportant au maximum 8 segments (mais ce n'est pas le plus court !) +a. Un chemin comportant au maximum 8 segments (mais il ne prend pas en compte les coûts, ce n'est pas le plus rapide !) ![](route.png) @@ -68,20 +68,6 @@ Utilisation de la fonction dijkstra de la bibliothèque GDS [49, 54, 46, 28, 45, 24, 23, 13, 6, 7, 2, 1, 8, 9, 18, 19, 20, 57, 21, 31, 38, 39, 40, 58] -```cypher -MATCH (source:Point {id: 49}), (target:Point {id: 58}) -CALL gds.shortestPath.dijkstra.stream('routes_graph', { - sourceNode: source, - targetNode: target, - relationshipWeightProperty: 'cout' -}) -YIELD nodeIds, totalCost -UNWIND range(0, size(nodeIds)-2) AS i -MATCH (n1) WHERE id(n1) = nodeIds[i] -MATCH (n2) WHERE id(n2) = nodeIds[i+1] -MATCH path = (n1)-[r:ROUTE]->(n2) -RETURN collect(path) AS chemin, totalCost; -``` ## Réseau d'amis