Test_graf
Instructions¶

Implement functions that generate (undirected) complete graphs and path graphs with an arbitrary number of vertices. Vertices are labeled by number, starting from zero. Graphs are represented by dictionaries, whose keys are individual vertices and values are lists of adjacent vertices. Eg., a complete graph of 3 vertices:
{0: [1, 2], 1: [0, 2], 2: [0, 1]}
, a path of 4 vertices: {0: [1], 1: [0, 2], 2: [1, 3], 3: [2]}. 
Implement a graph renumbering function, which can use an abritrary integer renumbering function as its argument. For example:
renumber({0: [1], 1: [0]}, lambda x: x + 1)
returns
{1: [2], 2: [1]}

Using these functions, implement a lollipop graph generator, i.e. a function
lollipop(m, n)
. 
Implement a function that from an arbitrary graph, represented as described above, creates the adjacency matrix as a numpy array. This m x m matrix (m is the graph order) contains only 0 or 1. 1 at (i,j) position represents an edge
(i > j)
. For a complete graph of order 4, the adjacency matrix is[[0 1 1 1] [1 0 1 1] [1 1 0 1] [1 1 1 0]]
and for a path of order 4:
[[0 1 0 0] [1 0 1 0] [0 1 0 1] [0 0 1 0]]