I am trying to write a code to perform the QAP partialling analysis (here's a paper to know more) but the part in which I "scramble" the graph with PermuteSubgraph does nothing, I am actually not pretty sure of how I should use this command, as the guide says almost nothing and no example could be found..
Let's say that I create a graph by writing its adjacency matrix and using the AdjacencyGraph command
Needs["Combinatorica`"]
a = {{0, 1, 0, 0, 0}, {1, 0, 1, 0, 0}, {0, 1, 0, 1, 1}, {0, 0, 1, 0,
1}, {0, 0, 1, 1, 0}};
ag = AdjacencyGraph[{1, 2, 3, 4, 5}, a, VertexLabels -> "Name"]
Problem is: according to what I found on the manual, it should be sufficient to write
PermuteSubgraph[ag, RandomSubset[Range[5]]]
to obtain some permutation of some random subgraph of my graph... But this does nothing!!
Please notice that what I would like to end with is the adjacency matrix of "each possible" permutation of the original graph, so if there is a way to obtain these "permuted adjacency matrices" without having to produce the graphs, that's a plus. (the quotes are because I will be dealing with really large networks, and then I may be able to take only a few of these permutations..)
Thank you in advance for the help,
- Stefano
Permutations[{1, 2, 3, 4}]
lists all permutations of the elements 1,2,3,4. You could then take the matrix form of each of these. $\endgroup$