Is there a well-known algorithm for allocating planks to trucks? -


i have implement algorithm described below, , have 2 questions:

  • is problem np-complete?
  • is similar well-known algorithmic problem?

the problem

i have planks of wood of 3 lengths: 10m, 8m , 5m.

i need transport these 1 place another.

i have 3 types trucks can use this, truck a, truck b , truck c.

each truck can carry @ 10 planks, truck can carry types of planks, , truck b can carry planks of 8m , 5m, , truck c can carry planks of 5m.

each truck has own price list transporting planks:

truck 1 plank $50  2-5 planks $100 6-10 planks $150  truck b 1 plank $30 2-5 planks $90 6-10 planks $140  truck c 1 plank $20 2-5 planks $80 6-10 planks $110 

the goal of algorithm: find cheapest way transport collection of planks.

example: have 5 planks of 10m, , 1 plank of 8m.

there 2 possible distributions:

  1. 6 on truck a: $150
  2. 5 on truck , 1 on truck b: $100 + $30.

so option 2 best. start solving more planks, number of possible combinations grow.

the specific pricelist can change, remain true never saves money divide planks of same size on more trucks needed.

so: if have 20 planks of same size, solution always: 2 trucks each 10 planks. don't need try combinations 3 or more trucks.

if have 21 planks of same size, have try combinations involve 3 trucks.

this problem generalization of bin-packing problem makes np-hard problem. refer link: http://en.wikipedia.org/wiki/bin_packing_problem


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -