I have a grid of 10x10 nodes where all adjacent nodes are linked to create a graph of 180 links - i.e:
What I hope to do is create a procedure which will break x% of these links, but importantly do so without creating any isolated subgraphs - that is, so that any 1 of the 100 nodes remain accessible from all other 99 nodes - i.e.
I initially (and naively) thought I could do something like the following:
ask n-of 45 nodes with [count my-links > 1] [ ask one-of my-links [die] ]
However, this does not prevent sub-graphs from being orphaned from the main graph - i.e.
Another option might be to repeatedly ask single links to die and then check the total number of graphs does not exceed 1 - if it does, recreate the link and choose another to break. However, (1) this does not seem particularly elegant; and (2) I have been unable to find a way to count the number of distinct graphs using the inbuilt link or nw procedures.
I do think that part of my problem is not knowing the correct terminology for these subgraphs/isolates/cliques etc...
If anyone has any ideas on how this might be done (or can correct my woefully inadequate comprehension of graph theory terminology) it would be much appreciated.