I have a graph in which the connection of the friends and the cities where they live are shown. The connection of the friends is specified by means of black arrows and that of the cities is specified with dotted lines. I want to get the longest path of friends who live in a common city, between Mr. A and Mr. D. The answer would be the route: A-> B-> E-> D. What query should be written for it?
get longest path between two nodes with common nodes
165 Views Asked by mohsen ahmadi At
1
There are 1 best solutions below
Related Questions in GRAPH
- Find a MST in O(V+E) Time in a Graph
- Using chart and tooltip
- What clustering algorithms can I consider for graph?
- Clustering on Graph (using Boost Graph Library)
- How to set a domain on an axis and have the axis intervals not constant or take up different amount of interval spaces using d3
- sort graph by distance to end nodes
- Construct and label a uniform graph in NetworkX using dictionaries?
- Plot: Add legend that overlay several Frames
- Labelling nodes in networkx
- Plotting a data frame in R
- How does boost::subgraph work? Can we use filtered graph?
- How do I make a decaying oscilating function in python?
- Deserialize tree given inorder format?
- Having issues with D3 scale and data binding
- ArangoDB graph operations via REST API
Related Questions in NEO4J
- case insensitive search for labels
- How to parameterize the sort filter using tinkerpop gremlin / frames?
- Cypher performance in graph with large number of relatinships from one node
- neo4j load csv invalid "ON MATCH"
- Finding Common Node for given two nodes in neo4j through java
- how to count 2 relationships as one in neo4j
- Neo4j HA Replication tx_push_factor
- Neo4j Aggregate Multiple Lines into a Map
- ClassNotFound: UpdateableState in spring-data-neo4j-rest 3.3.0
- number of connected nodes to specific nodes in a path
- Can I count the precedence relation if all the paths on the same set of nodes
- Inherited properties of related entities are not visible in spring-data-neo4j-rest
- Class atributes not updating [node.js - express ]
- Symbols within a Neo4j case-insensitive regex
- Failed to add a node to spatial layer with https post request in Neo4j php
Related Questions in PATH
- formatting path string in javascript
- Simplexml get path from variable
- Azure Web App PATH Variable Modification
- In Android, would it be possible to open a file in the 'values' folder and to read its content?
- Using paths bonded to a XCode project to be shared
- How would I be able to use a file in visual studio project on any computer?
- How to add directories to Cygwin gcc default search path
- Joomla css path incorrect
- R CMD recognize only some commands
- Generate TCPDF output to a shared drive folder
- How to get the exe path in nsis script?
- Issues with relative/absolute path
- relative path to .Exe
- Path of the current, parents and root directory
- JOptionPane Message with File Path
Related Questions in NODES
- Issues with reversing the linkedlist
- C++ Unable to Print Pointer Data of a Linked List
- Send information to Maya node instance in cpp
- Couting nodes with onyl one child in BST
- Find the parent node of a node in binary search tree
- Tree implementation in C++: Cannot convert Node to Node*
- From 2 column csv to 2 color NetworkX graph
- SQL Tree Structure Table
- Multiple Node Styles
- Javax JCR Node getProperties and Titles
- Check if item exists in XML with AS3
- Constructor and const reference
- How to add children nodes to the last parent node
- Show nodes with more than one relationship using NEO4j
- How do I go about the traversal of Binary Search Trees?
Related Questions in LONGEST-PATH
- Find Longest Weighted Path from DAG with Networkx in Python?
- Longest path of weighted DAG using R igraph
- How to find the longest simple path (including all intermediate nodes) in a directed cyclic graph?
- Is longest possibly non-simple path in NP?
- Why is topological sort needed for Longest Path in Directed Acyclic Graph?
- How to get the longest path in a DAG starting at a fixed node?
- Dijkstra for longest path in a DAG
- Time and Space Complexity of my Algorithm
- Finding the longest simple path on the divisor graph using linear programming
- Get all Paths between 2 Nodes in a simple graph using JGraphT
- How to find the longest path in an acyclic directed graph using OGDF library?
- Longest Path Algorithm for Layer Assignment
- Return the list of items which are part of the longest path from Tree's root to a Leaf in a General Tree
- get longest path between two nodes with common nodes
- Print the longest path starting from root in a binary tree
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Native query (without using APOC add-on):
To search for the longest path of a specific city (e.g. P1), change the first line to:
APOC versions might be more performant, but, honestly, it would need to be measured. One of the possibilities: