graph-rank icon indicating copy to clipboard operation
graph-rank copied to clipboard

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

Open maia opened this issue 10 years ago • 1 comments

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

maia avatar Oct 19 '14 15:10 maia

Hey @louismullie , what does may cause this issue?

dripisforever avatar Apr 28 '18 09:04 dripisforever