I have a list like following
list = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};
I want get this list by a more better method:
I don't care the ordering of its elements.This is my current method.I'm missed in cloud when I manage to write it.
Flatten[MapThread[
Distribute[List[##], List, List, List, UndirectedEdge] &, {{a, b},
list}]]
{a<->1,a<->2,a<->3,a<->4,a<->5,b<->6,b<->7,b<->8,b<->9,b<->10}



Join@@ MapThread[Thread[#1 <-> #2] &, {{a, b}, list}]orFlattenorCatenateto flatten list – ubpdqn Jun 13 '16 at 06:36