Hi,
i'm using neo4j 2.0.3 with embedded DB,in order to build a route system.
I created my graph (with around 1 Million of Nodes, and 50 Million of
relationships; ) in this way:
-
create nodes :
Label mainNodeLabel = DynamicLabel.label("nodoPrincipale");
// initialize batchInserter
BatchInserter inserter = BatchInserters.inserter(neo4jDbPath, config);
BatchInserterIndexProvider indexProvider = new
LuceneBatchInserterIndexProvider(inserter);
inserter.createDeferredSchemaIndex(mainNodeLabel).on("y").create();
inserter.createDeferredSchemaIndex(mainNodeLabel).on("x").create();
BatchInserterIndex osmWayIdPropertyIndex =
indexProvider.relationshipIndex("osmWayIdProperties",
MapUtil.stringMap("type", "exact"));
osmWayIdPropertyIndex.setCacheCapacity(OSMAttribute.OSM_WAY_ID_PROPERTY,
100000);
Map<String, Object> nodeProps = new HashMap<String, Object>();
double x = ...;
double y = ...;
nodeProps.put("y", y);
nodeProps.put("x", x);
long graphNodeId = inserter.createNode(nodeProps, mainNodeLabel);
-
create relationships between created nodes :
Map<String, Object> relationProps = new HashMap<String, Object>();
relationProps.put(OSMAttribute.EDGE_LENGTH_PROPERTY, lunghezzaArco);
long relId = inserter.createRelationship(startNode, endNode,
"CAR_MAIN_NODES_RELATION", relationProps);
osmWayIdPropertyIndex.add(relId, relationProps)
- Neo4j Configuration :
nodestore_mapped_memory_size=100M
relationshipstore_mapped_memory_size=3G
nodestore_propertystore_mapped_memory_size=100M
strings_mapped_memory_size=200M
arrays_mapped_memory_size=50M
When I Calculate shortest path between startNode and endNode with Dijkstra:
PathFinder<WeightedPath> finder =
GraphAlgoFactory.dijkstra(PathExpanders.forTypeAndDirection(relationType,
Direction.OUTGOING), "edgeLength");
WeightedPath path = finder.findSinglePath(startNode, endNode);
I have very slow performance... about 68194 millis for a distance of 42km.
Is there something wrong?
Maybe i should index relationship cost property too? (edgeLength)
Thanks
Antonio
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.