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

PageRank: NoMethodError: undefined method `-' for nil:NilClass #1

Open
maia opened this issue Oct 19, 2014 · 1 comment
Open

PageRank: NoMethodError: undefined method `-' for nil:NilClass #1

maia opened this issue Oct 19, 2014 · 1 comment

Comments

@maia
Copy link

maia commented Oct 19, 2014

There's a problem with PageRank calculation: whenever you add a source that's not the destination of any other source, you end up with:

lib/graph-rank/page_rank.rb:67:in `block in convergence'
lib/graph-rank/page_rank.rb:66:in `each'
lib/graph-rank/page_rank.rb:66:in `convergence'
lib/graph-rank/page_rank.rb:40:in `calculate'

E.g. try:

pr = GraphRank::PageRank.new
pr.add 1,2
pr.add 3,1
pr.calculate
@dripisforever
Copy link

Hey @louismullie , what does may cause this issue?

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

No branches or pull requests

2 participants