I'm dealing with a complete weighted graph composed of 8 nodes. The graph is complete and weighted
#Name of the nodes
namesofthenodes = ['a__node', 'b__node', 'c__node', 'd__node', 'e__node', 'f__node', 'g__node', 'h__node']
#Adjacency matrix
adjacencymatrix = [[0.0, 0.08, 0.13, 0.06, 0.06, 0.07, 0.14, 0.12],
[0.08, 0.0, 0.09, 0.06, 0.06, 0.06, 0.07, 0.08],
[0.13, 0.09, 0.0, 0.07, 0.07, 0.07, 0.13, 0.12],
[0.06, 0.06, 0.07, 0.0, 0.04, 0.04, 0.05, 0.06],
[0.06, 0.06, 0.07, 0.04, 0.0, 0.05, 0.04, 0.06],
[0.07, 0.06, 0.07, 0.04, 0.05, 0.0, 0.07, 0.07],
[0.14, 0.07, 0.13, 0.05, 0.04, 0.07, 0.0, 0.11],
[0.12, 0.08, 0.12, 0.06, 0.06, 0.07, 0.11, 0.0]]
I put it in a pandas dataframe
import numpy as np
import pandas as pd
#Transforming the matrix in a pandas dataframe
adjacency_df = pd.DataFrame(adjacencymatrix)
adjacency_df.index = namesofthenodes
adjacency_df.columns = namesofthenodes
If you know a way to do it in R, you could export the data in R:
adjacency_df.to_csv("adjacency_df.csv")
How can I visualize it in a smart and understandable way? I would like to highlight the intensity of each relation based on the weight of each edge.