An evolution simulator based on graphs and trees