Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSSP that collects path and distance #148

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kailashjoshi
Copy link

SSSP that collects path and distance

@dbickson
Copy link
Contributor

dbickson commented Aug 3, 2014

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

@kailashjoshi
Copy link
Author

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

@dbickson
Copy link
Contributor

dbickson commented Aug 5, 2014

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
#148 (comment)
.

@kailashjoshi
Copy link
Author

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

@dbickson
Copy link
Contributor

dbickson commented Aug 6, 2014

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
#148 (comment)
.

@kailashjoshi
Copy link
Author

Yes it does.

@dbickson
Copy link
Contributor

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
#148 (comment)
.

@kailashjoshi
Copy link
Author

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

@dbickson
Copy link
Contributor

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
#148 (comment)
.

@kailashjoshi
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants