I have set of nodes which will be declared by user(I mean user enters some words and those which exist among my nodes will be included in my set of nodes),and I want to find the longest path which exists between just these nodes(does not have to include all of the nodes in set ,but should not include a node which is not exist in my set of nodes)in neo4j embedded java database.(I do not know what is the start node,all of them can be the start node.)
First I thought maybe I have to make a subgraph of these nodes and relations between them,and then find the longest path in that subgraph,but I don't know what is the right and best thing to do?
Then i thought,I can directly find longest path between the set of nodes(can that be done?).
Or if this can't be done,how about finding the relations of the certain nodes(set of nodes) and make a set of relations,and then find the longest path between set of relations?
I want the optimum and fastest way in performance,and I don't want cypher query,because I am using java core api(it is faster),so please tell me what is the best way?
Consider it as a large scale database,with so many nodes.
Thanks in advance.