Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using dijkstra for top N paths
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yuval  
View profile  
 More options Oct 2 2012, 7:04 pm
From: Yuval <yuvalper...@gmail.com>
Date: Tue, 2 Oct 2012 16:04:00 -0700 (PDT)
Subject: Using dijkstra for top N paths

We would like to present several path results using weighted path finding -
instead of the "lightest" route, we'd like to present the 5 lightest routes.
Is that possible?
Has anyone done something similar?

Yuval


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wes Freeman  
View profile  
 More options Oct 2 2012, 7:13 pm
From: Wes Freeman <freeman....@gmail.com>
Date: Tue, 2 Oct 2012 19:13:16 -0400
Local: Tues, Oct 2 2012 7:13 pm
Subject: Re: [Neo4j] Using dijkstra for top N paths

Please correct me if I'm misunderstanding your goal.

Is "lightest" a calculation of the sum of relationship costs?

If so, check out:
http://stackoverflow.com/questions/12587263/cypher-order-by-path-cost...

And:
http://console.neo4j.org/r/dygqp8

Note: reduce requires 1.9-SNAPSHOT.

Wes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuval Perlov  
View profile  
 More options Oct 2 2012, 7:20 pm
From: Yuval Perlov <yuvalper...@gmail.com>
Date: Wed, 3 Oct 2012 01:20:34 +0200
Local: Tues, Oct 2 2012 7:20 pm
Subject: Re: [Neo4j] Using dijkstra for top N paths

Seems the idea is to traverse all possible paths... what if there are a lot of paths?  Dijkstra allows to find the best route but not the second third etc but all might be too complex.

On Oct 3, 2012, at 1:13, Wes Freeman <freeman....@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wes Freeman  
View profile  
 More options Oct 2 2012, 7:27 pm
From: Wes Freeman <freeman....@gmail.com>
Date: Tue, 2 Oct 2012 19:26:53 -0400
Local: Tues, Oct 2 2012 7:26 pm
Subject: Re: [Neo4j] Using dijkstra for top N paths

So, when you're saying lightest, are you talking about path lengths, or
relationship properties with weights/scores on them?

Yeah, you can limit the result list of my query with LIMIT 5 (or something)
to get the best 5, but if you have hundreds or thousands of paths it
probably would get to be a slow query.

Anyone know a better way to get the top n best paths?

Wes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Oct 3 2012, 12:08 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Wed, 3 Oct 2012 06:08:07 +0200
Local: Wed, Oct 3 2012 12:08 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

Yves,
you could use some other algos such as A-start, see
https://github.com/neo4j-examples/java-astar-routing for an example.
Otherwise, via the Traversal Framewrok you have quite a lot of flexibility,
see http://docs.neo4j.org/chunked/snapshot/tutorial-traversal.html

also, you can use the core Java API and utilities like Gremlin on top of
it, see
http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-f...
an example of an algo built with that.

Enjoy!

/peter

--

Cheers,

/peter neubauer

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

Wanna learn something new? Come to http://graphconnect.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugeny Kozhanov  
View profile  
 More options Oct 3 2012, 1:17 am
From: Eugeny Kozhanov <ving...@gmail.com>
Date: Tue, 2 Oct 2012 22:17:04 -0700 (PDT)
Local: Wed, Oct 3 2012 1:17 am
Subject: Re: Using dijkstra for top N paths

Can you add variable pathsCount to the Dijkstra algorithm and stop the
solve when pathsCount = 5?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lasse Westh-Nielsen  
View profile  
 More options Oct 3 2012, 3:24 am
From: Lasse Westh-Nielsen <lasse.westh-niel...@neopersistence.com>
Date: Wed, 3 Oct 2012 08:24:15 +0100
Local: Wed, Oct 3 2012 3:24 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

On Wed, Oct 3, 2012 at 12:20 AM, Yuval Perlov <yuvalper...@gmail.com> wrote:
> Seems the idea is to traverse all possible paths... what if there are a lot
> of paths?  Dijkstra allows to find the best route but not the second third
> etc but all might be too complex.

Finding the shortest path involves looking at a lot of paths - think
about it, if you didn't, the shortest might be one of the ones you
didn't look at. It is the nature of the problem :)

Dijkstra in particular will find shortest paths to all reachable nodes
using some fixed starting point. Did you need multiple paths between
two fixed points instead? Then Dijkstra is not your friend.

 - Lasse


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuval  
View profile  
 More options Oct 3 2012, 3:50 am
From: Yuval <yuvalper...@gmail.com>
Date: Wed, 3 Oct 2012 00:50:38 -0700 (PDT)
Local: Wed, Oct 3 2012 3:50 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

Do you have any idea who might be my friend?

The end result should be something similar to navigation apps where they
show you several suggested routes.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lasse Westh-Nielsen  
View profile  
 More options Oct 3 2012, 4:00 am
From: Lasse Westh-Nielsen <lasse.westh-niel...@neopersistence.com>
Date: Wed, 3 Oct 2012 09:00:31 +0100
Local: Wed, Oct 3 2012 4:00 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

On Wed, Oct 3, 2012 at 8:50 AM, Yuval <yuvalper...@gmail.com> wrote:
> Do you have any idea who might be my friend?

> The end result should be something similar to navigation apps where they
> show you several suggested routes.

I can't name any algorithms, but it will be some form of breadth-first
search that you terminate once you have enough paths. Maybe a modified
Dijkstra that doesn't optimise away longer paths?

Google is probably your friend, or maybe Peter or Craig who did Neo4j Spatial?

Regards,

Lasse


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Oct 3 2012, 4:45 am
From: Michael Hunger <michael.hun...@neopersistence.com>
Date: Wed, 3 Oct 2012 10:45:04 +0200
Local: Wed, Oct 3 2012 4:45 am
Subject: Re: [Neo4j] Using dijkstra for top N paths
What about allShortestPaths?

Sent from mobile device

Am 03.10.2012 um 10:00 schrieb Lasse Westh-Nielsen <lasse.westh-niel...@neopersistence.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Persson  
View profile  
 More options Oct 3 2012, 6:29 am
From: Mattias Persson <matt...@neotechnology.com>
Date: Wed, 3 Oct 2012 12:29:56 +0200
Local: Wed, Oct 3 2012 6:29 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

Although the current Dijkstra algorithm could (easily) be modified to
return the top N cheapest paths. The reason it stops is that there's an
explicit check in there.

2012/10/3 Michael Hunger <michael.hun...@neopersistence.com>

--
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuval  
View profile  
 More options Oct 8 2012, 2:10 pm
From: Yuval <yuvalper...@gmail.com>
Date: Mon, 8 Oct 2012 11:10:30 -0700 (PDT)
Local: Mon, Oct 8 2012 2:10 pm
Subject: Re: [Neo4j] Using dijkstra for top N paths

allShortestPaths with subsequent path evaluation for some weights is the
stop gap solution. As our data set grows we will manipulate the Dijkstra
algorithm to return top n.
I am guessing algorithms are pluggable but failed to find somewhere that
describes the process. Does anyone have a link?

BTW - is there a repository where we can showoff our Neo4j based creation?

Yuval


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lasse Westh-Nielsen  
View profile  
 More options Oct 8 2012, 3:01 pm
From: Lasse Westh-Nielsen <lasse.westh-niel...@neopersistence.com>
Date: Mon, 8 Oct 2012 20:01:00 +0100
Subject: Re: [Neo4j] Using dijkstra for top N paths

Yuval,

You cannot apply weights after the fact as you will only have one path per destination node to look at. The weights need to be considered as you go along.

(You were looking for single pair shortest path right?)

Regards,

Lasse

On 8 Oct 2012, at 19:10, Yuval <yuvalper...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuval Perlov  
View profile  
 More options Oct 9 2012, 6:49 am
From: Yuval Perlov <yuvalper...@gmail.com>
Date: Tue, 9 Oct 2012 12:48:43 +0200
Local: Tues, Oct 9 2012 6:48 am
Subject: Re: [Neo4j] Using dijkstra for top N paths

i agree it's a heuristic - i assume that if i correctly sort my top 10
shortest paths, the best path will actually be in there.

On Mon, Oct 8, 2012 at 9:01 PM, Lasse Westh-Nielsen <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »