Skip to content

Commit d8b24e9

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

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

graphs/page_rank.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def page_rank(nodes, limit=3, d=0.85):
6262
for node in nodes:
6363
outbound_count = outbounds[node.name]
6464
if outbound_count == 0:
65-
ranks[node.name] = (1 - d) + d * sum(ranks[ib] for ib in node.inbound) / n
65+
ranks[node.name] = (1 - d) + d * sum(
66+
ranks[ib] for ib in node.inbound
67+
) / n
6668
else:
6769
ranks[node.name] = (1 - d) + d * sum(
6870
ranks[ib] / outbounds[ib] for ib in node.inbound
@@ -90,4 +92,4 @@ def main():
9092

9193

9294
if __name__ == "__main__":
93-
main()
95+
main()

0 commit comments

Comments
 (0)