Rhyd Lewis

Cardiff School of Mathematics,

Cardiff University, Cardiff, CF24 4AG, WALES.

Welcome to my webpage. Below you will find information about my teaching, research, publications, and presentations. Some useful research resources, code, and problem instances can also be found by following the links below. If you would like to contact me on any of my research, please do so at the above email address.

Research and Teaching

I am a senior lecturer at Cardiff School of Mathematics and a member of the department's Operational Research Group. I am the director of two MSc programs in the School of Mathematics: the MSc in Operational Research and Applied Statistics, and the MSc in Operational Research, Applied Statistics and Financial Risk. More information can be found here. In addition, here is a nice short video highlighting some of the activities carried by the School.

I am currently leading a two-year £250k Health and Care Research Wales-funded project entitled "Prudent Elective Surgery Scheduling: A Whole Systems Approach". I am also an associate editor for the International Journal of Metaheuristics, having co-founded the journal in 2007. I am a member of the program committees for *Evolutionary Computation in Combinatorial Optimisation*, the *Practice and Theory of Automated Timetabling*, *GECCO*, and the *International Metaheuristics Conference* series.

I am currently teaching the following modules in the School of Mathematics: MAT002: Statistical Methods, MA0276: Visual Basic for Operational Research, and MA3602: Algorithms and Heuristics. Previous modules include MAT004: Computational Methods, and MA0105: Foundations of Probability (at the School of Mathematics), and BSP658 Business Statistics, BS0511 Quantitative Methods for Business, and BS1501 Applied Statistics and Mathematics for Economics and Business (at Cardiff Business School). I am a fellow of the Higher Education Academy.

- The application and analysis of metaheuristic algorithms;

- Graph colouring;

- Operating theatre scheduling;

- School bus routing;

- Automated timetabling (course and exam) and related problems;

- Grouping/Partitioning problems;

- Sports timetabling, particularly round-robin scheduling;

- Solving sudoku problems with metaheuristics;

- The Urban Transport Routing Problem (see here for more information);

- Bin-packing, trapezoid (trapezium) packing, and the equal-piles problem;

- Vehicle routing, particularly dynamic variants of the problem;

- Arc routing, again particularly dynamic variants of the problem.

Publications and Presentations

Resources

Graph colouring is the task of painting all vertices of a graph so that (a) all pairs of adjacent vertices are assigned different colours, and (b) the number of colours used is minimal. This problem has applications in many practical areas of operations research including university timetabling, sports scheduling, creating seating plans, and solving sudoku puzzles. It is also strongly related to the Four Colour Theorem, previously one of the most famous unsolved problems in all of mathematics.

For further information on graph colouring and its applications, please refer to my 2015 book *A Guide to Graph Colouring: Algorithms and Applications*, ISBN: 978-3-319-25728-0. The suite of graph colouring algorithms used in this book is available here. These have been coded in C++, and the resource also contains compilation and usage instructions. Information on these algorithms can also be found in the paper: *"Lewis, R., J. Thompson, C. Mumford, and J. Gillard (2012) 'A Wide-Ranging Computational Comparison of High-Performance Graph Colouring Algorithms'. Computers and Operations Research, vol. 39(9), pp. 1933-1950"*.

Some short introductory videos into the field of graph colouring can be found at the following links:

- An Introduction to Graph Colouring;

- Constructive Algorithms for Graph Colouring;

- Practical Applications of Graph Colouring.

A useful bibliography on the graph colouring problem, maintained by Marco Chiarandini and Stefano Gualandi, can be found here. In addition, information on upper bounds for the DIMACS graph colouring instances can be found here.

In the bin packing problem, objects of different volumes must be packed into a finite number of bins or containers such that the minimum number of bins used. A good resource of benchmark problem instances for the one-dimensional bin packing problem can be found here in the problem repository of Scholl and Klein. The "uniform" and "triplet" bin packing instances of Falkenauer can also be found here and are stored on the Operational Research Library of Beasley.

The Trapezoid Packing Problem is closely related to the one-dimensional bin packing problem. Here, items are trapezoidal in shape with a fixed height and variable width. A practical application arises in the roofing industry, where large numbers of roof trusses of different lengths and different "end angles" have to be cut from boards of a given length such that wastage is minimsed. Though similar to one-dimensional bin packing, the problem is complicated by the fact that the ends of the trapezoids need to be "nested" so that wastage between consecutive shapes is kept to a minimum. This problem was first introduced and analysed in the 2011 paper 'An Investigation into two Bin Packing Problems with Ordering and Orientation Implications'. The problem instances used in this paper can be downloaded here.

In our 2016 publication 'How to Pack Trapezoids: Exact and Evolutionary Algorithms' significant improvements to the results reported in the 2011 paper were achieved by (a) designing and making use of an exact polynomial-time algorithm for optimally packing a set of fixed-height trapezoids into a single bin, and (b) by using a number of specialised evolutionary-based methods when packing across multiple bins. The source code and a detailed breakdown of the results of this work is available here.

Some of my research has focussed on the production of efficient algorithms for timetabling problems. A large number of timetabling problem instances are available for this problem on the website of the Second International Timetabling Competition (ITC2007). Some hard timetabling instances can also be found here. This latter set contains sixty problem instances of varying sizes that are intended to be more difficult than the competition instances with regards to both finding feasibility and satisfying soft constraints. Source code and results for the algorithm presented in *Lewis, R. and J. Thompson (2015) 'Analysing the Effects of Solution Space Connectivity with an Effective Metaheuristic for the Course Timetabling Problem'. European Journal of Operational Research, vol. 240, pp. 637-648* can be found here

An important part of our £250k Health and Care Research Wales-funded project "*Prudent Elective Surgery Scheduling: A Whole Systems Approach*", is the production of optimal surgery schedules at hospitals. When a patient enters a hospital for an elective operation, it is imperative that a bed is available for them to go into after surgery. However, sometimes all beds in the ward will be occupied, meaning that the operation will have to be cancelled. Our research has shown that cancellations occur far less frequently if operations are scheduled throughout the week appropriately. As part of this, our models also need to take into account various hospital requirements, the unexpected arrival or emergency patients, and the variability in the time patients take to recover after their operations. More information can be found in my list of publications.

Many transportation problems in operational research, such as the travelling salesman problem and vehicle routing problem, make use of a distance matrix. This is a matrix that gives the optimal driving distance (or travel time) between all pairs of locations within a set. A small number of online services exist for producing distance matrices, such as the Google Maps Distance Matrix API, but the sizes of matrices offered are usually very limited. To these ends, here is my own program for producing large distance matrices and travel time matrices. This program is coded in C# and uses Bing Maps to produce matrices of up to 1079x1079 entries in a single sitting. Larger matrices can also be produced, though users should ensure they do not exceed the Bing daily usage limit (see the instructions within the attachment).

Some of my work has concerned the use of metaheuristics to help solve sudoku puzzles. The C++ code used for experiments described in *"Lewis, R. (2007). 'Metaheuristics can Solve Sudoku Puzzles' Journal of Heuristics, vol. 13 (4), pp. 387-401"*, can be downloaded here. Code for the random sudoku problem instance generator used in this research can be downloaded here.

Regarding Sudoku, here is a very useful Sudoku to Graph Coloring Converter. This program reads in a single sudoku problem (from a text file) and converts it into the equivalent graph coloring problem. The output file appears in the DIMACS format which can then be used as the input file for any suitable graph coloring algorithm. If a solution using the correct number of colours is found, this can then be easily converted back into the Sudoku representation, giving a valid solution to the original problem.

Previous work has also looked at the scheduling of sports events, and in particular round-robin leagues and tournaments. Here is a link to the ten sports scheduling benchmark problem files used in the paper *"Lewis, R. and J. Thompson (2011) 'On the Application of Graph Colouring Techniques in Round-Robin Sports Scheduling'. Computers and Operations Research, vol. 38(1), pp. 190-204".* Source code (C++) for the round-robin to graph colouring program, which was used to generate many of the graphs in the paper, can be found here.

Want to avoid sitting next to annoying guests at a party? See state of the art combinatorial optimisation techniques in action with this Wedding Seating Planner tool available at www.weddingseatplanner.com.

The travelling salesman problem (TSP) asks the following: "Given a set of cities with distances between each pair, what is the shortest tour that visits each city exactly once?" This is a famous example of an NP-hard problem and it is often used to help motivate the use of heuristics and metaheuristics. To these ends, here is a simple MS Excel-based program for finding approximate solutions to randomly generated Euclidean TSPs. This program is intended to show the run-time characteristics of (1) random descent, (2) simulated annealing, (3) steepest descent, (4) tabu search, and (5) evolutionary algorithms. A number of animated charts are also included to help illustrate their various run-time characteristics.

Photos

Presenting at the Hay Festival of Literature and the Arts, 2017.

Surfing a secret surf spot somewhere in Wales.

Surfing at another break.

...And another break.