126
Weighted Graph Representation
Weights can easily be added to:
adjacency matrix representation
(0/1
→
int or float)
adjacency lists representation
(add int/float to list node)
Both representations work whether edges are directed or not.