Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated README

  • Loading branch information...
commit 2204dd7016835651fcf1a7290fa7d24773100d6c 1 parent f615832
@dcadenas dcadenas authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 README.rdoc
View
30 README.rdoc
@@ -34,6 +34,36 @@ Which outputs
Node 8888 rank is 0.0375000014901161
This ranks represent the probabilities that a certain node will be visited.
+
+If you want to calculate the rank of another graph is recommended to call the clear method and reuse the RankableGraph instance as this frees the used memory without relying in the Ruby garbage collector.
+So instead of:
+
+ rankable_graph = RankableGraph.new
+
+ rankable_graph.link(0, 1)
+ rankable_graph.link(1, 2)
+ rankable_graph.rank(0.85, 0.0001){ |identifier, rank| puts "Node #{identifier} rank for graph1 is #{rank}" }
+
+ rankable_graph = RankableGraph.new
+
+ rankable_graph.link(0, 1)
+ rankable_graph.link(2, 1)
+ rankable_graph.rank(0.85, 0.0001){ |identifier, rank| puts "Node #{identifier} rank for graph2 is #{rank}" }
+
+It's better if you do:
+
+ rankable_graph = RankableGraph.new
+
+ rankable_graph.link(0, 1)
+ rankable_graph.link(1, 2)
+ rankable_graph.rank(0.85, 0.0001){ |identifier, rank| puts "Node #{identifier} rank for graph1 is #{rank}" }
+
+ rankable_graph.clear
+
+ rankable_graph.link(0, 1)
+ rankable_graph.link(2, 1)
+ rankable_graph.rank(0.85, 0.0001){ |identifier, rank| puts "Node #{identifier} rank for graph2 is #{rank}" }
+
For more examples please refer to the tests.
== Requirements
Please sign in to comment.
Something went wrong with that request. Please try again.