Generate the reverse graph