Methodboruvka_mst
Implementation of Boruvka's algorithm
>>> g = Graph()
>>> g = Graph.build([0, 1, 2, 3], [[0, 1, 1], [0, 2, 1],[2, 3, 1]])
graphs/minimum_spanning_tree_boruvka.py:150
Functioncentripetal The Centripetal Force formula is given as: (m*v*v)/r >>> round(centripetal(15.5,-30,10),2) 1395.0 >>> round(centripetal(10,15,5),2)
physics/centripetal_force.py:24
Functioncheck_cycle Returns True if graph is cyclic else False >>> check_cycle(graph={0:[], 1:[0, 3], 2:[0, 4], 3:[5], 4:[5], 5:[]}) False >>> check_cycl
graphs/check_cycle.py:6
Functionchinese_remainder_theorem2 >>> chinese_remainder_theorem2(5,1,7,3) 31 >>> chinese_remainder_theorem2(6,1,4,3) 14
maths/chinese_remainder_theorem.py:75
Functioncompute_bridges Return the list of undirected graph bridges [(a1, b1), ..., (ak, bk)]; ai <= bi >>> compute_bridges(__get_demo_graph(0)) [(3, 4), (2, 3),
graphs/finding_bridges.py:60
Functionconstruct_highway Build the highway following the parameters given >>> construct_highway(10, 2, 6) [[6, -1, 6, -1, 6, -1, 6, -1, 6, -1]] >>> construct_
cellular_automata/nagel_schrekenberg.py:31
Functioncreate_ngram Create ngrams from a sentence >>> create_ngram("I am a sentence", 2) ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te',
strings/ngram.py:6