type
status
date
slug
summary
tags
category
icon
password

1. Get distance matrix from adjacent matrix M using floyd warshall algorithm.


 

2. Compute N clusters from distance matrix using k-means.

🤔
What if we need to specify number of nodes for each cluster?

 

3. Visualize graph using networkx.

💡
To make edges in the visualized graph scaled to their actual values in the adjacency matrix, we need to use nx.draw_kamada_kawai to draw the graph.
Visualized graph:
notion image
NotionNext
NotionNext
一个普通的干饭人🍚
公告
type
status
date
slug
summary
tags
category
icon
password
Welcome to Binhua’s blog!🎉