import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
G = nx.Graph()
Matrix = np.array(
[
[None, 7, 5, 1, None, None], # a
[7, None, None, 5, 3, None], # b
[5, None, None, 6, None, 2], # c
[1, 5, 6, None, 3, 4], # d
[None, 3, None, 3, None, 3], # e
[None, None, 2, 4, 3, None],
# f
]
)
for i in range(len(Matrix)):
for j in range(len(Matrix)):
G.add_edge(i, j)
nx.draw(G)
plt.show()