Thanks for your answer. I prefer need to the second answer that i don't know where is the best relationship.
But, I have try to implement your algorithm to my graph but until now still get some error null return like this. What I Missed..?
{
"statement": {
"text": "MATCH (a:lokasi {nama:'Terminal Batu'}), (b:lokasi {nama:'Terminal Gadang Malang'})\nWITH a, b, [(a)-[r]-() | r.id] as aIds, [(a)-[r]-() | b.id] as bIds\nWITH a, b, apoc.coll.intersection(aIds, bIds) as ids\nUNWIND ids as id\nMATCH path = shortestPath((a)--(b))\nWHERE all(rel in relationships(path) WHERE rel.id = id)\nRETURN path\nORDER BY length(path) DESC\nLIMIT 1",
"parameters": {}
},
"statementType": "r",
"counters": {
"_stats": {
"nodesCreated": 0,
"nodesDeleted": 0,
"relationshipsCreated": 0,
"relationshipsDeleted": 0,
"propertiesSet": 0,
"labelsAdded": 0,
"labelsRemoved": 0,
"indexesAdded": 0,
"indexesRemoved": 0,
"constraintsAdded": 0,
"constraintsRemoved": 0
}
},
"updateStatistics": {
"_stats": {
"nodesCreated": 0,
"nodesDeleted": 0,
"relationshipsCreated": 0,
"relationshipsDeleted": 0,
"propertiesSet": 0,
"labelsAdded": 0,
"labelsRemoved": 0,
"indexesAdded": 0,
"indexesRemoved": 0,
"constraintsAdded": 0,
"constraintsRemoved": 0
}
},
"plan": false,
"profile": false,
"notifications": ,
"server": {
"address": "localhost:7687",
"version": "Neo4j/3.5.0"
},
"resultConsumedAfter": {
"low": 1,
"high": 0
},
"resultAvailableAfter": {
"low": 3,
"high": 0
}
}