I'm having a hard time thinking of an appropriate data structure to use to represent an adjacency matrix for an undirected graph.
I want to be able to take the nodes from these graphs and insert them into random positions in arrays, and then "score" the arrays based on how well they've managed to keep the adjacent nodes apart. i.e if node A and node B are connected in my graph, and the array places them next to each other, +1 would be added to the array's score, with the lowest scoring array being the best.
So what would be the best data structure to use to represent a collection of nodes, and the neighbouring nodes of each one in the collection?