1
1
1Danshin12020-04-22 20:05:46
Python
1Danshin1, 2020-04-22 20:05:46

How to make a matrix-based algorithm for the rational use of area?

There are 5 rooms with different areas, represented by a matrix, where the 1st place is empty, the 0th place is filled:
"Matrices in the comments"
4 different objects are used to fill them:
1)3x3 = [
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
]
2)4x4 = [
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0],
[0 , 0, 0, 0]
]
3)6x6 = [
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0]
]
4)7x7 = [
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0 , 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]
]
I. For which out of 5 rooms a, b, c, d, e, it will be more rational (with a minimum number of 1 in the matrix) to fill with items: 1-2 pcs., 3-1 pcs., 4-1 pcs., 2 in the range from 2 to ∞ pcs. ?
II. What would be a more rational filling with items: 1-2 pieces, 3-1 pieces, 4-1 pieces, 2 in the range from 2 to ∞ pieces. all rooms a,b,c,d,e at once?
III. For which two rooms would it be more rational to fill with objects: 1-2 pieces, 3-1 pieces, 4-1 pieces, 2 in the range from 2 to ∞ pieces?
(The presence of items 1-2 pieces, 3-1 pieces, 4-1 pieces, 2-2 pieces is mandatory for each task)
* What would be a more rational filling with items: 1-2 pcs., 3-1 pcs., 4-1 pcs., 2 in the range from 8 to ∞ pcs., 5-∞ pcs. all rooms a,b,c,d,e at once?
5)9x9 = [
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0]
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2020-04-22
@1Danshin1

Google the Packing Problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question