Path queries in Sparksee

54 views
Skip to first unread message

oj

unread,
Jan 22, 2015, 10:54:21 PM1/22/15
to spar...@googlegroups.com
Hi,

How do I essentially perform path queries in Sparksee?

For the following edge set assume that I need to return all the paths between source id 34 and a destination id 56. 
01, 12
34, 12
34, 9
34, 56
34, 28
12, 56
56, 23

Result: 
34 -> 56
34 -> 12 -> 56

Should I run one of the traversal algorithms or use the Context class? I can check the connectivity of these two nodes easily using the Context class, but since the compute() function returns a list of objects, I'm not sure how I can find the depth of the traversal.

I would appreciate a simple example.

Thanks!

c3po.ac

unread,
Jan 26, 2015, 6:37:40 AM1/26/15
to spar...@googlegroups.com

Hi,

Finding absolutely all the paths between two nodes is a very difficult problem because the number of paths could be very big (infinite if you have cycles).

So, unless you know that your graph is very simple you may want to add some restrictions to the paths expected to find (like consider two consecutive nodes the same step no matter which of the possibly several edges that directly join them you use, never visit a node twice, only consider the shorter paths, ...).

None of the algorithms that we provide can be directly used to get what you want. But you can program a custom algorithm to suit your needs yourself using neighbors or explode operations.

Please take a look to our User Manual here: http://www.sparsity-technologies.com/UserManual/API.html#navigation-operations for examples on how to use the explode and neighbors operations. And do not hesitate to contact us again if any doubt arises with those.

Best regards.

El divendres, 23 gener de 2015 4:54:21 UTC+1, oj va escriure:
Reply all
Reply to author
Forward
0 new messages