Аннотация:Given a sequence of bins and n bar charts consisting of two bars each (2-BCs). Every bar has a positive height not exceeding 1. Each bin can contain any subset of bars of total height at most 1. It is required to pack all 2-BCs into the minimal number of bins so that the bars of each 2-BC do not change their order and occupy adjacent bins. Previously, a special case of the problem was considered where the first bars of any two 2-BCs cannot be placed into the same bin. For this case an O(n^2)-time algorithm that constructs a packing of length at most OPT+1, where OPT is the optimum, was presented. In this paper, we propose a new, less time-consuming algorithm that also constructs a packing of length at most OPT+1 for the same case of the problem with time complexity equals to O(nlog n).