Graph generator

Solution for the 'Graph Generator' task