graphs.minimum_spanning_tree_prims

Attributes

edges_number

Classes

Heap

Functions

prisms_algorithm(adjacency_list)

Module Contents

class graphs.minimum_spanning_tree_prims.Heap
bottom_to_top(val, index, heap, position)
delete_minimum(heap, positions)
get_position(vertex)
heapify(heap, positions)
set_position(vertex, pos)
top_to_bottom(heap, start, size, positions)
node_position = []
graphs.minimum_spanning_tree_prims.prisms_algorithm(adjacency_list)
>>> adjacency_list = {0: [[1, 1], [3, 3]],
...                   1: [[0, 1], [2, 6], [3, 5], [4, 1]],
...                   2: [[1, 6], [4, 5], [5, 2]],
...                   3: [[0, 3], [1, 5], [4, 1]],
...                   4: [[1, 1], [2, 5], [3, 1], [5, 4]],
...                   5: [[2, 2], [4, 4]]}
>>> prisms_algorithm(adjacency_list)
[(0, 1), (1, 4), (4, 3), (4, 5), (5, 2)]
graphs.minimum_spanning_tree_prims.edges_number