Creating a graph in VTK

(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Take a look at
https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/CleanPolyData/

You can easily convert C++ to Python using

https://github.com/Kitware/VTK/blob/master/Wrapping/Python/README.md