Changed graph so edges contain their vertices