Using neo4j for multiple edges between nodes

684 views
Skip to first unread message

pdj...@gmail.com

unread,
Sep 30, 2013, 12:43:53 PM9/30/13
to ne...@googlegroups.com
Hi,

I'm quite new to neo4j and graph databases. I'm considering using it for one of my projects where each pair of nodes has multiple edges between them. Each edge has a set of properties which I need to query. If an edge has property X that equals Y(X may not be unique), then the edge is added to the results.

My concern is that this design makes performance degrade because between two nodes, there's no index and lookup time approaches the number of edges between the nodes. Is there another design that optimizes performance ?

Thanks

Peter Neubauer

unread,
Oct 1, 2013, 3:52:18 AM10/1/13
to Neo4j User
Do you have any size estimations on the number of relationships between two nodes, and the total number of nodes in the graph?

/peter


G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

The graphgist challenge - Bring your own graph - http://www.neo4j.org/learn/graphgist_challenge


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

pdj...@gmail.com

unread,
Oct 1, 2013, 4:05:08 PM10/1/13
to ne...@googlegroups.com
Eventually the number of nodes should reach 10^5. Number of relationships between two nodes shouldn't be more than 100.

Michael Hunger

unread,
Oct 1, 2013, 4:21:54 PM10/1/13
to ne...@googlegroups.com
That shouldn't be a problem at all.

Michael
Message has been deleted

pdj...@gmail.com

unread,
Oct 1, 2013, 6:11:28 PM10/1/13
to ne...@googlegroups.com
So, neo4j can handle 5*10^11((10^5)C2 *100) entities of data without performance degradation ?

Michael Hunger

unread,
Oct 1, 2013, 6:18:31 PM10/1/13
to ne...@googlegroups.com
How do you get from

10^5 = 100k x 100 = 10^7 to 10^11 ?

pdj...@gmail.com

unread,
Oct 1, 2013, 7:10:01 PM10/1/13
to ne...@googlegroups.com
10^5 nodes. For worst case scenario, assume each node is connected to every other node by atleast one edge. That means we'll have a minimum of (10^5)C2 edges(~5*10^9). Now add the fact that there are 100 edges between two node and you get 5*10^11 edges. 

pdj...@gmail.com

unread,
Oct 1, 2013, 10:48:02 PM10/1/13
to ne...@googlegroups.com
On an unrelated note, I was wondering if instead of having multiple edges, I have a single edge and store a 2D-array of the data, can I hash/index this 2D structure to improve lookup time during queries?
Reply all
Reply to author
Forward
0 new messages