added code for node and edge generators, C++ template dispatch from Python