list2edges function

Convert list to edge matrix