Generate edges