jaswalashish131's blog

By jaswalashish131, history, 6 weeks ago, In English

How to solve this problem?

Marius, Emily, and Merle are bothered by the fact that clothing is only worn briefly and then thrown away. They find out that large clothing retailers even discard new merchandise that hasn't been sold in the current season. At the same time, they have come across advertising from a company that sells complete outfits. The three of them now want to apply this idea to discarded clothing.

TASK They have purchased a large stock of leftover goods to assemble outfit boxes that combine various types (for example, pants, tops, jackets, shoes, etc.). They make sure that the assembled boxes only contain clothing items that match in style (for example, casual, sporty, elegant, formal, etc.). For this purpose, the three of them have created a table indicating which styles are compatible. For example, casual clothing can be combined with sporty and also with elegant clothing, but not necessarily sporty with elegant.

Specifically, the following should apply to each packed box: a) At least one clothing item of each type is packed, but not more than three. b) All involved styles match.

Task Write a program to help the budding fashion designers. It should read the style table and output how the boxes should be packed for the purchased leftover goods, so that as few clothing items as possible are left over.

Apply your program to at least all the examples you find on the BWINF websites, and document the results. Formatting of the txt files:

Explanation of the format:

• First line: The first number is the quantity s of types, the second number is the quantity r of styles. • In the following lines until the next empty line, there are two numbers x and y each, indicating that style x is compatible with style y (and vice versa). • After that, there is an empty line followed by lines with three numbers i, j, and n each, indicating that there are exactly n pieces available of type i in style j. • If a combination of type and style does not appear, it means that the corresponding clothing item is not available in this type. https://bwinf.de/fileadmin/user_upload/paeckchen0.txt https://bwinf.de/fileadmin/bundeswettbewerb/42/paeckchen1.txt https://bwinf.de/fileadmin/user_upload/paeckchen2.txt https://bwinf.de/fileadmin/user_upload/paeckchen3.txt https://bwinf.de/fileadmin/user_upload/paeckchen4.txt https://bwinf.de/fileadmin/user_upload/paeckchen5.txt https://bwinf.de/fileadmin/bundeswettbewerb/42/paeckchen6.txt https://bwinf.de/fileadmin/user_upload/paeckchen7.txt

6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by jaswalashish131 (previous revision, new revision, compare).