i cannot understand a certain part of the paper published by Donald Johnson about finding cycles (Circuits) in a graph.
More specific i cannot understand what is the
I had sumbitted an edit request to @trashgod's code to fix the exception thrown in unblock(). Essentially, the algorithm states that the element w (which is not an index) is to be removed from the list. The code above used list.remove(w), which treats w as an index.
My edit request was rejected! Not sure why, because I have tested the above with my modification on a network of 20,000 nodes and 70,000 edges and it doesn't crash.
I have also modified Johnson's algorithm to be more adapted to undirected graphs. If anybody wants these modifications please contact me.
Below is my code for unblock().
private void unblock(int u) {
blocked[u] = false;
List list = b.get(u);
int w;
for (int iw=0; iw < list.size(); iw++) {
w = Integer.valueOf(list.get(iw));
//delete w from B(u);
list.remove(iw);
if (blocked[w]) {
unblock(w);
}
}
}