Algorithm's problems.

leonardo_13 (1530 points)
6 13 20
asked Dec 11, 2021 in HW8 by leonardo_13 (1,530 points)
retagged Dec 12, 2021 by iacopomasi
Unfortunately, even if I thought about it for days I have no ideas about how to start, can I have any advice?

3 Answers

Best answer
gianluca5539 (9820 points)
3 6 44
answered Dec 11, 2021 by gianluca5539 (9,820 points)
selected Dec 13, 2021 by leonardo_13
Try, for every pattern, to generate rows that already match the requirements of the pattern, and then you can assemble these rows into matrices (see the recursion here?)
Luigi Pizza (6120 points)
11 20 65
answered Dec 11, 2021 by Luigi Pizza (6,120 points)
Probably the best strategy here is to "divide and impera". Create algorithms that work for each property, then put them together. I can't say more than this.
gabrimat (5630 points)
2 2 25
commented Dec 11, 2021 by gabrimat (5,630 points)
Totally agree, you can't take such a big problem all together. Think how to solve each small step.
iacopomasi (2760 points)
13 19 39
answered Dec 11, 2021 by iacopomasi (2,760 points)
edited Dec 12, 2021 by iacopomasi
You can model the problem as a "Game Tree" where the state (node) is the current matrix/image that gets built and the "move" (edge) is adding something to the image so that you go into another state.

In the end, you should hit a final state in which the image is complete. In the case of a pattern, think well at the "moves" you have to do to keep your solution valid. Hope this helps.