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

  1. < 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 the n Compared to less may be lower.

  2. 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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -