N
N
Neonoviiwolf2015-10-31 11:11:53
MySQL
Neonoviiwolf, 2015-10-31 11:11:53

What sorting and searching to use?

Good afternoon!
I'm thinking of a small project.
Tell me how resource-intensive and what is better to use?
Let there be 1000 objects, each object has 15 parameters - numerical values, all are different. The user enters a limit on the maximum mass of objects in the aggregate (one of the parameters of each object). Those. the user writes that the maximum mass of all objects is not more than 1500 kg, the volume is up to 100,000 cm3, etc., the allowable error is 10%. Then he puts the price for everything no more than 100,000 rubles. Further, the program must, in the set parameters, the user select from the existing list of objects that in the aggregate, i.e. from the addition of object parameters, it must select what is possible to collect, then break them into shipments, i.e. 40% can be included in one delivery, 40% in the second, and the remaining 20% ​​in the third. Those. we have a mass of 1500 kg and a maximum volume of 100,000 cm3., the program issues: here is a list of 15-30 (no less and no more) objects (some can be repeated, but no more than 2-3 times). They fit into the maximum mass, volume, means and another 12 parameters. Should break them down into batches for shipping. Further, it is important that when specifying the same parameters, the program displays a new list that has no more than 50% similarity with the previous one, if it is possible to select other objects that, in the aggregate of parameters, will satisfy the user's criteria. Also, the user can choose one of the objects himself and make a request for a possible replacement. which has a similarity with the previous one no more than 50%, if it is possible to select other objects that, in the aggregate of parameters, will satisfy the user's criteria. Also, the user can choose one of the objects himself and make a request for a possible replacement. which has a similarity with the previous one no more than 50%, if it is possible to select other objects that, in the aggregate of parameters, will satisfy the user's criteria. Also, the user can choose one of the objects himself and make a request for a possible replacement.
Sorry for the complexity of the wording.
At first I thought about making all requests on the server, but it seems to me that searching for so many parameters will eat up a lot of resources, so I decided that it’s worth resetting these calculations to the user, and the server will only give the current database to the user. How resource intensive should it be, searching only by numeric values? The second is how to deal with a simple tablet, it is desirable that it fit in 2 seconds, and preferably faster. Advise how to sort in order to speed up the search, here, as I understand it, it is necessary to have a separate sorting by all parameters or can somehow be combined? Programming language I think to choose C ++, mySQL base. It’s easy to sort, I’m generally zero (the current at the university is a bubble, etc. the simplest), and for the first time collide with databases

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MiiNiPaa, 2015-10-31
@MiiNiPaa

So it's a packing problem.
https://ru.wikipedia.org/wiki/%D0%97%D0%B0%D0%B4%D...
https://ru.wikipedia.org/wiki/%D0%97%D0%B0% D0%B4%D...
NP-complete, most adequate algorithms are only approximate (do not give an optimal solution)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question