graph - delete nodes at random in an adjacency matrix in matlab -
I have some problem tests.
I want to remove the nodes at random, so to see how strong this model is, nodes (randomly)?
My proximity matrix is adj
How can I remove nodes on random in matlab?
is quite good, but I have some reservations
- < P>
Putty can
return the same pointer more than once, for example& gt; & Gt; Randy (10,1,5) ans = 6 3 10 6 2
Returned
6
twice because of elements of then
Compared to less may be lower. - What is the element in the matrix? It is more efficient to compare the composition of creating the complete matrix and relinquishing its elements: You actually copy large parts of the matrix in each command.
Therefore, my solution will use:
n = size (adj, 1); Copy the current number of nodes / n = n; % // n is the number to extract idx = randsample (N, toKeep); Without replacing% // sample newadj = adj (idx, idx); % // Only copy the relevant elements
Comments
Post a Comment