https://medium.com/@monocosmo77/working-with-undirected-graphs-in-machine-learning-part1-5142a8cbeeb3