python: add regular/minimum spanning-tree generator