Skip to content

Commit e8de4bc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c0e24ac commit e8de4bc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

graphs/page_rank.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ def page_rank(nodes, limit=None, d=0.85, tol=1e-8, max_iter=100):
5353
ranks[inbound_node] / outbounds[inbound_node]
5454
for inbound_node in node.inbound
5555
)
56-
new_ranks[node.name] = (1 - d) / n + d * (
57-
inbound_rank + dangling_sum / n
58-
)
56+
new_ranks[node.name] = (1 - d) / n + d * (inbound_rank + dangling_sum / n)
5957

6058
if sum(abs(new_ranks[name] - ranks[name]) for name in ranks) < tol:
6159
return new_ranks

0 commit comments

Comments
 (0)