I'm working on a small programme, and I need to check if an element in a dynamically created matrix is connected to another element trough a series of ones.
Bad explanation, I know, so take this example:
Here I need to see if the digit 1 at row 2, column 4 is "connected" to number 2 through the other ones.
If this happens (one 1 becomes a 0):
The 1 is no longer "connected" and I need to convert it to another number.
The problem is that I don't know how to check this, since the matrix will be quite large (10x15) and there wont be a single, simple path of 1s.
I hope I explained my problem in such a way that it is atleast sort of understandable, and I hope someone will be able to guide me in the right direction.