graph add edge structure, rewrite linkedlist