PowerGraph icon indicating copy to clipboard operation
PowerGraph copied to clipboard

SSSP that collects path and distance

Open kailashjoshi opened this issue 10 years ago • 10 comments

SSSP that collects path and distance

kailashjoshi avatar Jul 27 '14 20:07 kailashjoshi

Hi Kailash, We would love code contributions! I looked at the code and it is not so clear

  1. can you have the same syntax as sssp.cpp so we could diff the two files and learn what are the changes (you changes spaces and end of lines so it is hard to compare)
  2. not clear what the path collection is doing - it does not store the shortest path but does store nodes when a new path is found
  3. edge_data can be IS_POD_TYPE - this allows us to save it without the load/save functions

dbickson avatar Aug 03 '14 12:08 dbickson

Hi Danny,

Thank you for checking the code. As per your suggestion I have added POD to edge data. And yes it was just capturing nodes as it move but not shortest path. However I have fixed the issue and tested it properly. I am confident that its now capturing shortest path.

I would be really glad if you can test the code and let me know if there is any issue with it.

Thanks Kailash

kailashjoshi avatar Aug 05 '14 18:08 kailashjoshi

Does it capture all the shortest path from the same length, or does it capture various paths from different length?

http://www.graphlab.com Danny Bickson Co-Founder US phone: 206-691-8266 Israeli phone: 073-7312889 https://twitter.com/graphlabteam http://www.linkedin.com/company/graphlab https://www.facebook.com/graphlabinc http://www.youtube.com/user/GraphLabInc

On Tue, Aug 5, 2014 at 9:07 PM, kailashjoshi [email protected] wrote:

Hi Danny,

Thank you for checking the code. As per your suggestion I have added POD to edge data. And yes it was just capturing nodes as it move but not shortest path. However I have fixed the issue and tested it properly. I am confident that its now capturing shortest path.

I would be really glad if you can test the code and let me know if there is any issue with it.

Thanks Kailash

— Reply to this email directly or view it on GitHub https://github.com/graphlab-code/graphlab/pull/148#issuecomment-51236093 .

dbickson avatar Aug 05 '14 18:08 dbickson

graph

In the above graph let say your source is node 4. So the node 1 has three path to reach node 4 i.e. 10, 6 and 18. But node 18 has large distance than 10 and 6 so the program ignore node 18. The program only gives you immediate node of the shortest but not a whole path.

so the full output will be vid--distance--paths

16 1 '4' 10 4 '15' 23 4 '36' 18 5 '23' 43 1 '4' 6 4 '12' 36 3 '8' 1 5 '6''10' 12 3 '8' 15 3 '8' 8 2 '16''43' 4 0 '4'

and the input data is 1 10 1 6 1 18 10 15 6 12 18 23 15 8 12 8 23 36 36 8 8 16 8 43 16 4 43 4

kailashjoshi avatar Aug 05 '14 19:08 kailashjoshi

Nice image! But did you say that the program also compute multiple short paths from the same length?

http://www.graphlab.com Danny Bickson Co-Founder US phone: 206-691-8266 Israeli phone: 073-7312889 https://twitter.com/graphlabteam http://www.linkedin.com/company/graphlab https://www.facebook.com/graphlabinc http://www.youtube.com/user/GraphLabInc

On Tue, Aug 5, 2014 at 10:29 PM, kailashjoshi [email protected] wrote:

[image: graph] https://cloud.githubusercontent.com/assets/3769544/3817190/a5ec5c34-1cd5-11e4-9668-73acd0996e49.png

In the above graph let say your source is node 4. So the node 1 has three path to reach node 4 i.e. 10, 6 and 18. But node 18 has large distance than 10 and 6 so the program ignore node 18. The program only gives you immediate node of the shortest but not a whole path.

so the full output will be

16 1 '4' 10 4 '15' 23 4 '36' 18 5 '23' 43 1 '4' 6 4 '12' 36 3 '8' 1 5 '6''10' 12 3 '8' 15 3 '8' 8 2 '16''43' 4 0 '4'

and the input data is 1 10 1 6 1 18 10 15 6 12 18 23 15 8 12 8 23 36 36 8 8 16 8 43 16 4 43 4

— Reply to this email directly or view it on GitHub https://github.com/graphlab-code/graphlab/pull/148#issuecomment-51247217 .

dbickson avatar Aug 06 '14 06:08 dbickson

Yes it does.

kailashjoshi avatar Aug 06 '14 08:08 kailashjoshi

In that case, please prepare a file named sssp_mult_path.cpp to be under toolkits/graph_analytics/ and please verify that it is easy to diff (in terms of spaces and alignment) so people can view sssp.cpp vs. your file (for example using "vimdiff sssp.cpp sssp_mult_path.cpp") Then send a pull request and I will merge it in.

Best,

http://www.graphlab.com Danny Bickson Co-Founder US phone: 206-691-8266 Israeli phone: 073-7312889 https://twitter.com/graphlabteam http://www.linkedin.com/company/graphlab https://www.facebook.com/graphlabinc http://www.youtube.com/user/GraphLabInc

On Wed, Aug 6, 2014 at 11:04 AM, kailashjoshi [email protected] wrote:

Yes it does.

— Reply to this email directly or view it on GitHub https://github.com/graphlab-code/graphlab/pull/148#issuecomment-51304883 .

dbickson avatar Aug 10 '14 06:08 dbickson

Formatted code so that it is easy to compare with sssp and send pull request.

kailashjoshi avatar Aug 11 '14 05:08 kailashjoshi

Hi, I did not find the pull request, I see just the old one. Can you try again?

http://www.graphlab.com Danny Bickson Co-Founder US phone: 206-691-8266 Israeli phone: 073-7312889 https://twitter.com/graphlabteam http://www.linkedin.com/company/graphlab https://www.facebook.com/graphlabinc http://www.youtube.com/user/GraphLabInc

On Mon, Aug 11, 2014 at 8:26 AM, kailashjoshi [email protected] wrote:

Formatted code so that it is easy to compare with sssp and send pull request.

— Reply to this email directly or view it on GitHub https://github.com/graphlab-code/graphlab/pull/148#issuecomment-51743080 .

dbickson avatar Aug 11 '14 05:08 dbickson

I have added a file in https://github.com/kailashjoshi/graphlab/blob/master/toolkits/graph_analytics/sssp_mult_path.cpp

Do you want me to close this pull request and create a new one?

kailashjoshi avatar Aug 11 '14 06:08 kailashjoshi