Interpret adjacency matrices for algorithms (#712)

Interpret adjacency matrices for algorithms (#712)

Use matrix entries to represent edge weights or connectivity.