A general-purpose hill-climbing method for order independent minimum grouping problems: A case study in graph colouring and bin packing

https://doi.org/10.1016/j.cor.2008.09.004Get rights and content

Abstract

A class of problems referred to as order independent minimum grouping problems is examined and an intuitive hill-climbing method for solving such problems is proposed. Example applications of this generic method are made to two well-known problems belonging to this class: graph colouring and bin packing. Using a wide variety of different problem instance-types, these algorithms are compared to two other generic methods for this problem type: the iterated greedy algorithm and the grouping genetic algorithm. The results of these comparisons indicate that the presented applications of the hill-climbing approach are able to significantly outperform these algorithms in many cases. A number of reasons for these characteristics are given in the presented analyses.

Introduction

Problems that require the grouping or partitioning of a set of entities arise regularly in computer science and operations research in areas as diverse as timetabling and scheduling [1], [2], [3], packing [4], [5], load balancing [6], frequency assignment [7], in addition to various theoretical and mathematical problems such as graph colouring [8] and partitioning [9]. In simple terms, grouping problems involve a collection of “items” that are to be divided into a number of “groups”, subject to certain constraints. Formally, given a set I of n distinct items, the task is to construct a set of subsets U={U1,,UG} such that the following three criteria are met:Ui=I(fori=1,,G)UiUj=(for1ijG)Ui(fori=1,,G)

Though simple in definition, grouping problems are often quite challenging in practice because the imposed constraints might be quite difficult to satisfy. Indeed, many grouping problems, including all of the examples mentioned in this paper, belong to the set of NP-complete problems, implying that we cannot hope to find a polynomially bounded algorithm for solving them in general [10]. Given this latter characteristic it is therefore appropriate to consider heuristic- and metaheuristic-based approximation algorithms for tackling these problems, particularly for those instances where exact algorithms are simply too inefficient for practical purposes.

A useful way of categorising grouping problems is to consider the number G of groups that are used to contain the items. In some cases, such as the bin balancing (equal piles) problem [6] or the k-way graph partitioning problem [9], G will be stated explicitly as part of the problem, and any candidate solution seen to be using more or less than this will be considered illegal. In other cases, however, G will not be given, and the aim will be to produce a solution that minimises G, or a least gets G below some given bound, while still obeying the constraints of the problem. This latter class of problem can be referred to as minimum grouping problems (MGPs).

Within the class of MGPs, two further types of problem can be identified. The first is the order dependent minimum grouping problem. Here, as well as seeking to minimise the number of groups, the quality and/or validity of a candidate solution is influenced by the way in which the groups are ordered. An example of this is the exam timetabling problem encountered at universities, where the task is to group a set of exams into a certain number of “timeslots” (below some imposed bound) whilst not forcing any student to be in two places at once, and also paying heed to the fact that students do not want to sit exams in successive timeslots [1], [3]. The frequency assignment problem is another example of this sort of problem [7]. Naturally, the other problem type occurring in the class of MGPs is the Order Independent Minimum Grouping Problem (OIMGP). In these problems the ordering of the groups is not relevant, and it is these problems that form the basis of this study.

Examples of OIMGPs include the following:

The 1D bin packing problem: Given n items of various “sizes” and an infinite number of “bins” (each with a fixed finite capacity C), group the items into a minimal number of bins so that no bin is over-filled [10], [11].

The graph colouring problem: Given an undirected graph with n nodes, group the nodes into a minimum number of “colour classes” so that no pair of adjacent nodes is assigned to the same colour (Here the “items” are the nodes.) [8], [12].

Various timetabling problems: E.g.: Given n events that are attended by various subsets of students within an educational institution, and given a set of rooms, each with a specific seating capacity; group the events into “timeslots” so that (a) no student is required to attend more than one event in the same timeslot, (b) the events in each timeslot can each be allocated a room with sufficient seating capacity, and (c) the number of timeslots being used is less than or equal to the maximum number allowed by the institution (Here the “items” are the events.) [2], [13].

The edge colouring problem: Given an undirected graph with n edges, group all of the edges into a minimum number of “colours” so that no pair of edges sharing a common node are assigned the same colour (Here the “items” are the edges.) [10], [14].

The cutting stock problem: Given an unlimited number of “stocks” of a fixed finite length, and given n requests for items of different lengths to be cut from these stocks, minimise the number of stocks that will be needed in order to produce all of the requested items [15].

In this paper, the term “feasible” is used exclusively to describe any candidate solution (or group) in which no problem-specific constraints are being violated. The symbol χ is also used to denote the minimum number of groups needed to feasibly contain the n items of a given problem. (For graph colouring, χ is known as the chromatic number.) An optimal solution for an OIMGP is thus any solution that uses χ feasible groups to contain the n items.

Although the above listed problems are usually considered to belong to other problem-classes (such as the class of packing problems, the class of graph-theoretic problems, etc.), it is useful to consider the OIMGP classification in order to highlight the common features that they exhibit. Note also that in all of the above cases the task of calculating χ is considered to be NP-hard [10]. In addition, all of the corresponding decision problems are NP-complete.1 In view of such similarities, it is thus appropriate to consider whether the shared features of these problems can be exploited via common methods. It is also useful to ask whether techniques proposed for one particular problem might also turn out to be suitable for other problems belonging to this domain.

Considering existing methods for OIMGPs, a large number of algorithms have previously been proposed in the literature, including various constructive algorithms [16], [17], [18] and exact algorithms [1], [4], [19], [20], [21]. For larger and/or more difficult problem instances where such methods are not considered efficient, a number of heuristic and metaheuristic methods have also been proposed, including various applications of evolutionary algorithms [11], [14], [22], [23], [24], [25], [26], [27], iterated local search [28], [29], simulated annealing [12], [30], tabu-search [31], variable neighbourhood search [32], hyper-heuristics [33] and ant colony optimisation [15], [34], [35]. Considering heuristic and metaheuristic methods, we have observed that the majority of these actually follow one of two basic schemes, depending to some extent on whether the decision or optimisation variants of the problem are being considered:

Decision variant: First a target number of groups k is proposed and each of the items is assigned to one of these groups using some heuristics, or possibly randomly. Items that cannot be feasibly assigned to any of the k groups are then left to one side, and/or are assigned to one of the k groups anyway. The aim of the algorithm is to then try and reduce the number of unplaced items (and/or constraint violations) down to zero. Typically, the algorithm will alter k during execution if it is deemed necessary.

Optimisation variant: The number of groups to be used in a candidate solution is not specified in advance. Instead, additional groups are created whenever an item is encountered that cannot be feasibly assigned to an existing group. The number of groups is thus variable, and the aim of the algorithm is to try and reduce this number as much as possible, ensuring that no constraint violations occur in the process.

In purely practical terms, the scheme that turns out to be the most suitable will usually be influenced by the requirements of the end-user: for example, when attempting to timetable courses at a university, an upper bound on the number of available groups (timeslots) might be specified in advance, and it might be necessary to allow some of the items (courses) to remain unplaced or to allow some of the imposed constraints to be broken (see, for example, the work of Corne et al. [36] and Paechter et al. [37]). Meanwhile, in other situations it might not be appropriate to leave items unplaced (or break constraints) or there may simply be more flexibility as to the number of groups that can be used, suggesting that the optimisation variant might be more suitable. Another issue with the decision variant is that a suitable value for k needs to be defined. If χ is known in advance then we could simply set k=χ. However, if χ is unknown, and a value k>χ is chosen, then an optimal grouping cannot be achieved unless k is subsequently reduced. Also, if k<χ then it is obvious that the algorithm will not be able to feasibly place all of the items (or eliminate all of the constraint violations). On the other hand, algorithms of the second type, by their very nature, will always guarantee a feasible solution. In addition, some algorithms of this type, such as those by Erben [24], Culberson and Luo [38], Falkenauer [25], and Levine [15] do not require any choice of k or knowledge of χ in order to be applied.

In this paper, we outline a new method for tackling OIMGPs that also displays the characteristics of these latter algorithms. The aim is to explore the capabilities of this generic method by making applications to two well-known problems of this type: graph colouring and one-dimensional bin packing (herein referred to as simply “bin packing”). To aid this investigation we compare the performance of these applications with two other generic methods for this problem type: the iterated greedy (IG) algorithm of Culberson and Luo [38] and the grouping genetic algorithm (GGA), originally proposed by Falkenauer [11]. We have chosen these methods in particular, as they are both well-documented and have both shown to produce good results in the past [24], [38], [39]. In addition, these algorithms are also similar in style to the hill-climbing (HC) approach presented here, as both follow the second algorithmic scheme outlined above, both are applicable to a wide variety of grouping problem, both make use of the so-called “greedy algorithm” (Section 2.1), and neither requires any knowledge of χ (or setting for k) to be applied to a problem.

In the next section we will describe the HC method for OIMGPs. In general, the terms “groups” and “items” will be used in these descriptions, therefore implying universal applicability to OIMGPs (though, for clarity, when problem-specific details are considered later on, we will also use problem-specific terms, such as “colour”, “node”, and “bins”). In Section 3 we then give details of our application and resultant comparison using the graph colouring problem. Section 4 then contains a similar comparison for the bin packing problem. Section 5 concludes the paper and makes some general points regarding future research.

Section snippets

The greedy algorithm and related features

An integral part of the HC approach is the greedy (or first fit) algorithm. This procedure—described in the pseudo-code in Fig. 1—operates by taking any arbitrary permutation π of unplaced items and then inserts these one-by-one from left to right into the lowest indexed group where such an insertion preserves feasibility (lines 2–9).2

Application to the graph colouring problem

In this section we propose an application of the HC method to the graph colouring problem and analyse its performance over a large number of different problem instances (in all cases, these problems were produced using the problem generator of Culberson [42]). We begin in the next subsection by describing the various problem-specific details that were used in the HC algorithm; Section 3.2 then contains information on the algorithms used in our analysis for comparative purposes. Section 3.3 then

Application to the bin packing problem

In this section we now move our attention to the second OIMGP considered in this study—the bin packing problem (see Section 1 for a definition). In the next section we describe our application of the HC method to this problem; Section 4.2 then contains details on the IG and GGA-version used for the comparison. Finally, Section 4.3 gives details on the experiments performed and results gained.

For this problem, recall that n represents the number of items in a problem instance, and χ the smallest

Conclusions and discussion

In this paper we have presented an algorithmic framework for a class of problems referred to as order independent minimum grouping problems and have provided example applications to two popular problems of this type. In the author's experience these algorithms were simple to implement and robust to alterations in the small number of parameters that they required. This latter feature contrasts the GGA in particular, which we found to be quite sensitive to parameter alterations.

Two prominent

Acknowledgements

The author would like to give thanks to Bruce Curry, Peter Morgan, and Christine Mumford of Cardiff University, and also two anonymous referees for their helpful comments on earlier versions of this work.

References (57)

  • M. Carter et al.

    Examination timetabling: algorithmic strategies and applications

    Journal of the Operational Research Society

    (1996)
  • R. Lewis et al.

    Finding feasible timetables using group based operators

    IEEE Transactions on Evolutionary Computation

    (2007)
  • E. Falkenauer

    Solving equal piles with the grouping genetic algorithm

  • C.M. Valenzuela

    A study of permutation operators for minimum span frequency assignment using an order based representation

    Journal of Heuristics

    (2001)
  • T.R. Jensen et al.

    Graph coloring problems

    (1994)
  • G.V. von Lazewski

    Intelligent structural operators for the k-way graph partitioning problem

  • M.R. Garey et al.

    Computers and intractability—a guide to NP-completeness

    (1979)
  • E. Falkenauer

    Genetic algorithms and grouping problems

    (1998)
  • Morgenstern C. Algorithms for general graph coloring. PhD thesis, University of New Mexico;...
  • J. Thompson et al.

    Variants of simulated annealing for the examination timetabling problem

    Annals of Operational Research

    (1996)
  • S. Khuri et al.

    A grouping genetic algorithm for coloring the edges of graphs

  • Levine J, Ducatelle F. Ant colony optimisation and local search for bin packing and cutting stock problems. Journal of...
  • D. Brelaz

    New methods to color the vertices of a graph

    Communications of the ACM

    (1979)
  • F.T. Leighton

    A graph coloring algorithm for large scheduling problems

    Journal of Research of the National Bureau of Standards

    (1979)
  • A. Mehrotra et al.

    A column generation approach for graph coloring

    INFORMS Journal on Computing

    (1996)
  • J. Randall-Brown

    Chromatic scheduling and the chromatic number problem

    Management Science

    (1972)
  • R. Dorne et al.

    A new genetic local search algorithm for graph coloring

  • A.E. Eiben et al.

    Graph coloring with adaptive evolutionary algorithms

    Journal of Heuristics

    (1998)
  • Cited by (0)

    View full text