Convert MSM adjacency matrix into a JSON-formatted graph