adrian0010 / Percolation

1 stars 0 forks source link

[BUG] Function minCut: Entry nodes #43

Closed discoleo closed 1 year ago

discoleo commented 1 year ago

Bug in Function minCut: Entry Nodes

There is a problem if the entry-nodes are part of the min-cut:

R Code

Also make function which.neighbors more robust:

which.neighbors = function(m, npos, val = -1) {
    if(length(npos) == 0) return(integer(0));
    # ...
discoleo commented 1 year ago

The entry-nodes must be removed from the partition as well:

Helper function

prune.part = function(x, id) {
    idE = which(x %in% id);
    x = x[ - idE];
    invisible(x);
}