Note that there are some explanatory texts on larger screens.

plurals
  1. POiterate through a 3d matrix, finding all solutions
    primarykey
    data
    text
    <p>iterate through a 3d matrix</p> <p>i need to check every possible solution to a certain predicament.</p> <p>i have a matrix[x][y][z] that represents possible nodes to travel through. I already finished a method that should give me a set of solutions (it disables a single path every iteration and recalculates the entire solution, disable priority is based on travel capacity of the last solution) but i need to see how effective my method is in terms of total time taken to calculate a set. For this i require a method calculate the solution on every permutation of these paths. </p> <p>currently it only has a single layer in between 2 main layers (L1) where 0 is a free path and 1 is a non accessible path. This here is the starting layout where i can toggle the values on layer L1 from 0 to 1 to disable a path and the basis of my shortest path search algorithm.</p> <pre><code>L0 0 0 0 0 0 L1 0 1 0 1 0 L2 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 </code></pre> <p>how can i iterate through every possible combination of disabling the free paths when the dimensions of the matrix are non constant (meaning they are already user defined on compile time and can be changed whenever)? there are 2^n solutions where n is the number of free path on all mediary layers. (a quick explanation in C or C++ would be best, even pseudo code is good) since there currently 9 free path to make combinations with there should be about 2^9 solutions which i need to test with. I havent done any brute force algorithms before so i have no idea how to make one.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COCan you move inside a layer as part of a path too? I mean, can you go from L0(0,0) to L1(0,0) to L1(1,0) to L2(1,0)? Can you go back in layers? e.g. L0->L1->L2->L2->L1->L1->L2->L3. Can you move diagonally inside layers and in-between layers? Are the starting and ending points specified in the first and last layers, or just reaching from anywhere in the first layer to anywhere in the last layer in enough?
      singulars
    2. COyes, the path can be from anywhere to anywhere along lines with 0-s. The idea is though to disable mid layer links and save on area cost (basically mid layer links increase chip size so therefore every midlayer link increases regular link lenght by a small percentage) The idea is to minimize this penatly compared to time it takes to travel between nodes, because the more area penalty is applied the slower the regular links become compared to what they are without any mid layer links.
      singulars
    3. COforgot to mention that diagonal movement is not possible in this system. And as you probably understood from my last comment, the only combinations i need to try are the ones concering midlayer links (for example if theres 3 layers like in the example above, then only middle layer is important, but if theres 5 layers for example from L0 to L4 then L1 and L3 links make up the search space)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload