MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / main

Function main

graphs/page_rank.py:52–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def main():
53 names = list(input("Enter Names of the Nodes: ").split())
54
55 nodes = [Node(name) for name in names]
56
57 for ri, row in enumerate(graph):
58 for ci, col in enumerate(row):
59 if col == 1:
60 nodes[ci].add_inbound(names[ri])
61 nodes[ri].add_outbound(names[ci])
62
63 print("======= Nodes =======")
64 for node in nodes:
65 print(node)
66
67 page_rank(nodes)
68
69
70if __name__ == "__main__":

Callers 1

page_rank.pyFile · 0.70

Calls 5

page_rankFunction · 0.85
splitMethod · 0.80
add_inboundMethod · 0.80
add_outboundMethod · 0.80
NodeClass · 0.70

Tested by

no test coverage detected