Would cartesian product be the best approach for this

旧巷老猫 提交于 2019-12-01 11:23:02

问题


Related Questions:

  • Matrix Combination Logic
  • Efficient way to determine the outcome of test matrix

I have 25 individual validations that I need to test all possible combinations, I have seen a couple of questions related to what I'm looking for. The answers suggested something along the lines of using the cartesian product. Would that be the best method for finding the results I'm looking for or is there a better way?

Example:

Think about a 9 by 9 number grid starting from 0 - 9 on the X and Y axis:

|0|1|2|3|4|5|6|7|8|9|
|1|
|2|
|3|
|4|
|5|
|6|
|7|
|8|
|9|

All the individual validations are boolean ( true = passed, false = failed ).

The X Axis represents all the test results, Example:

|0|1|2|3|4|5|6|7|8|9|
|1|T|T|T|T|T|T|T|T|T|
|2|
|3|
|4|
|5|
|6|
|7|
|8|
|9|

And the Y Axis represents all the possible combinations, Example:

|0|1|2|3|4|5|6|7|8|9|
|1|T|T|T|T|T|T|T|T|T|
|2|F|T|T|T|T|T|T|T|T|
|3|F|F|T|T|T|T|T|T|T|
|4|F|F|F|T|T|T|T|T|T|
|5|F|F|F|F|T|T|T|T|T|
|6|F|F|F|F|F|T|T|T|T|
|7|F|F|F|F|F|F|T|T|T|
|8|F|F|F|F|F|F|F|T|T|
|9|F|F|F|F|F|F|F|F|T|

There will be more Y Axis combinations but I hope you get the point.

My question is how would I go about solving all the possible combinations?

来源:https://stackoverflow.com/questions/13282688/would-cartesian-product-be-the-best-approach-for-this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!