edge generation code
First version with real data :)