proper computing of number of edges to be generated, previously it was twice as big. better output
implemented computation timeout, logic extracted to another class.