Sunday, 22 November 2015

The street light outside my house

... was replaced a few years ago, because the council decided that it was not economic to repair its predecessor.  However, this means that along our road, we have street lights of differing ages and differing styles.  (In an idle moment I wondered whether the makers of the lights have regular fashion shows to publicise their new designs; engineers marching along a catwalk carrying a light to show off to well-healed buyers!)
An old upright with a modern lamp on top in Exeter.
This is the kind of lamp standard that we used to have outside our home;
it was designed in the days when it was safe to do inspection and maintenance from a ladder
This, and another project (unrelated to Operational Research) started me looking at street lights around here with a fresh eye.  The main variation in design is in the upright support for the lamp.  The basic light fittings  are quite similar.   Some are older, others are so new that you expect to se their price label attached.  In a few places round here, we have the upright part of the light, the lamp standard, hinged so that the light fitting can be lowered to ground level without needing a ladder, scissor lift or cherry picker to reach the fitting and bulb.

So I wondered about the maintenance of street lights.  For instance, why are there so few hinged lamp standards?  The few around here are all by footpaths, not easily accessible to scissor lifts and cherry pickers.  Ladders are generally ruled out these days for health and safety reasons.  Obviously the maintenance and inspection staff have fleets of lifts and pickers; increasing the number of hinged lamps standards so they were used by the roadside would lead to a reduction in the size of the fleets.  A search online led to an engineering company who make a hinge that can be retro-fitted to lamp standards, and their tests on the strength of the hinge showed that the lamp standard would buckle before the hinge broke.  They claimed that the payback period for their installation was less than a year.  Maybe installers hesitate for two reasons: first, that if there was an accident where the upper part of the standard fell on a motorist or pedestrian, it would make headlines; second, if a vandal or mischief-maker obtained the correct key for releasing the hinge, it could lead to havoc.
A new housing estate in Exeter with the latest design in lamp standards.
More online searches led to ideas which we used to teach undergraduates as general principles for modelling of inspection and maintenance.  So why do it?  To ensure that the lighting systems are safe, operate correctly, continue to provide the designed performance and to maximise their life.  The specifications reminded readers that maintenance can be divided into two aspects:
1. Cyclical, a process of preventative maintenance carried out on a cyclical basis to help reduce or eliminate failures and to ensure the system is operating at its intended design outputs.
2. Reactive, where failures of equipment are recorded and the equipment repaired or replaced.

And about the decision about what kind of lighting system to buy, it is clearly a multi-criteria decision problem:
"All the equipment should be selected, installed, maintained and operated to give a durable and efficient performance. Each item should be assessed for:"
  • potential life, 
  • availability, 
  • cost of spares and replacements, 
  • ease of maintenance, 
  • recycling/disposal 
  • compatibility with other components. 
That is six criteria, not all of which are quantitative.  (I don't recall mentioning compatibility when I taught the subject. Mea culpa.)

And an objective is suggested:  Initial cost is important but it is whole life costs (manufacturing + procurement + maintenance + energy + recycling/disposal) that should guide the final selection of equipment.

A softish constraint can be added:  there are advantages in limiting the range of equipment types. Lower stock levels, availability of spares, management of repairs and experience in fault finding/repairs are all benefits that can be expected to accrue.

I still don't know what the optimal balance would be between hinged lamp standards and those without hinges (I nearly wrote "unhinged" but that suggests madness), but I can see that ideas from Operational Research have been included in the guidelines for engineers.

My thanks to the Code of Practice for Highway Lighting Management and the makers of the York Hinge for ideas from their websites.

Friday, 20 November 2015

The domino selfies

I am indebted to Laura Albert McLay who writes the Punk Rock OR blog for letting her readers know that they can use Bob Bosch's integer programming formulation for converting a picture into a piece of art using sets of dominoes.  Bob uses sets of dominoes with up to 9 spots, rather than the more common limit of 6 spots.  So this means that the "pixels" of dominoes can have 0 spots (black) through 5 spots (grey) to 9 spots (more or less white). 

The tones of the original picture are converted to an integer in the range 0 to 9, and the model tries to match the spots of the dominoes to these numbers. The trouble is that every picture is constrained to use complete sets of dominoes, and  the resulting art uses the whole of each domino in those sets.  So each "pixel" is linked to another one, as the two ends of the domino.  Laura gives the link for uploading your own picture in her current blog.  

Try it yourself.

I started with a picture with a dark background, which meant that my face could be shaded with the greyer dominoes

... then I tried this which has a lighter background.  Tina asked what I had done to my hair, and I reminded her that we had been walking on the Cornish cliffs and my hair was windswept.  Below is the original.  The constraints on the dominoes have resulted in the darkening of my cheek on the right of the picture

Friday, 30 October 2015

The road repair vehicle routing problem

Potholes in roads are a problem.  They open the road surface to the elements, and often lead to further deterioration of the highway.  All road users hate them. They damage wheels, axles and suspension, and for cyclists and motor-cyclists they can easily lead to injury.  Some accidents are caused by vehicles hitting potholes, or swerving to avoid them.  But repairs cost money, and the highway authorities are short of funds - some estimates say that nationally, it would take another billion pounds a year to keep up to date with pothole repairs.

The internet has led to online forms for reporting potholes.  Here in Devon, we have an interactive map for reporting highway faults including potholes.  However, even with an app for a smartphone, only a small number of potholes will be reported to Devon County Council.  You have to be a little altruistic to report a pothole - or annoyed because it has affected your journey.  And you have to remember where the pothole was!  So, the number of potholes reported per day is comparatively small.   In addition, there is a built-in bias; it is easier to remember a pothole when you walk past it.  So potholes in built-up areas are reported, those in the open country are not so much

And this leads to an O.R. problem.  Given a reported pothole, when should it be repaired?  If you say "immediately" then it is quite likely that the repair team will have long journeys between jobs.  But if you say "wait until there are several in a small area" (so reducing the travelling) the people who make the reports will be annoyed at not seeing any action.  So the O.R. problem is twofold;  first, determining the rules for creating routes for the repair team.  O.R. has the techniques for doing this - it is just like a lot of distribution problems and vehicle routing problems.   In addition, you will need rules for collecting reported potholes from the reporting programs and assigning them to a date for action.  

Quite often, here in Devon, the report leads to an inspection before the repair is carried out, and the inspector marks the pothole with paint for the repair team - and to reassure local people that action will happen.  So there's a further problem - how long to wait between inspection and repair!  Inspection adds a further dimension - the severity of the pothole. 

Looking at the map of Devon today (30th October), there are well over two hundred potholes awaiting repair.  One cluster has 15 in a small radius - but close by there are areas with no potholes - along the roads leading to that locale.

How could you measure what policy would  be best?  Cost of travel is obvious, with constraints on the maximum delay between report and repair.  But a good policy might need regular revision, and that would also carry a cost. 

I shall continue to be altruistic, and add to the number of reported potholes.

Friday, 11 September 2015

September's silly statistic

News item in the property pages today:

Letting agent Rentify has estimated that the 240-bedroom Buckingham Palace would come at a rental cost of £303,340 per month.  

Not, you may think, a round £300,000, but a splendid £3340 per month more. 

However, the estimate is not quite as crazy as it appears, just the way it has been expressed.  Rents for property are usually round sums, either per month or per week.  And this monthly rent is a nice round estimate of £70,000 per week - but someone felt that it would sound better as a monthly amount.  On the Rentify website, the figures are given per month, and you have to make the conversion yourself when some figure looks odd.

Moral - if a figure is an estimate with one set of units, don't change the units!

Wednesday, 2 September 2015

Car park layout - what is good, what is best?

The magazine of the Institute of Mathematics and its Applications (Mathematics Today, August 2015) has an interesting and amusing article about optimising the layout of car parking spaces in a car park.  Tina and I have found several car parks at supermarkets and motorway services where the layout of spaces strikes us as sub-optimal.  (Mind you, the way that drivers negotiate such car parks is also sub-optimal.) 

So, what does the article consider?  It focuses on those which are on one level, not multi-storey.  Most car parks have a rectangular pattern with corridors for cars, and parking spaces at right angles, creating a rectangular pattern.  What happens if you have the spaces at an angle, creating a herringbone pattern?  Or if alternate corridors have traffic moving in opposite directions, so you can have a diagonal pattern?  The corridors can be narrower, because cars do not need so much space to turn.  So, you can have more corridors.  But possibly fewer spaces per corridor.

This problem has been examined in more detail by mathematicians at Bristol University(report here)

In Mathematics Today, the problem is treated as an optimisation problem with the fixed parameters length of bay, width of bay and turning circle of car, and one decision - the angle of the bay.  The car park is assumed to be infinite (as some car parks appear to be).  Taking the fixed parameters of a Rolls Royce Phantom, the best angle is about 36 degrees - but the optimal solution is insensitive to small changes so one could suggest either 30 or 45 (easier to measure).

Car users are very conservative, so it is unlikely that many car park designers will change to increase the capacity of their creations in this way.  But there is scope for designers to think about the likely flow of vehicles to try and achieve designs which are efficient and work.

For a completely whimsical discussion about the possibilities of an irregular layout of markings on a car park, Ian Stewart's book "Another Fine Math You've Got Me Into" has a chapter (The Thermodynamics of Curlicues) where the author imagines someone laying out a car park following Dekking and Mendes-France curves. 

Tuesday, 21 July 2015

Regular road maintenace

How often should a road be completely resurfaced?  What criteria should be used to decide whether to repair damaged surfaces or not, and whether to resurface the whole road?  Interesting questions for operational research. 

Devon has an extensive network of roads, from the motorway (M5) through dual carriageways to minor roads which run through quiet parts of the county.  Each one needs to be cared for.  Finance for the repairs is limited, though it comes from different sources, depending on the importance (load) of the traffic on that road.

Tina and I were walking in South Devon last week.  To get to the starting point we used several minor roads, and part of our walk took in a mile or so of single track roads.

We joke that we enjoy driving on roads where there is grass growing in the centre, a consequence of the fact that the centre of the road is never touched by the wheels of vehicles in such roads. However, one consequence of the growth of vegetation is that the road surface is damaged by the roots.  The surface is also affected by the water which runs off to the road-side. 

In the walk, we noticed a contrast between the minor roads that run through woodland and those that run through farm fields, with hedges or fences.  The latter dry out much more quickly than the former, as they catch the sun.  But, more significantly, any debris on the road surfaces dries and can blow away; it doesn't accumulate.  On the other hand, minor roads in woodland accumulate wet woody debris which doesn't dry out; and then water running off these roads is forced into the road-side where it erodes the surface. 

So, thinking of these observations made me consider those questions of repair or resurfacing, especially for those single-track minor roads.  I suspect that the answer is that nobody has models for it, and work is simply carried out on the basis of inspections and reports from road users.  But there is a student project here for someone.

Optimal portfolios and "diworsification"

Among the mathematical techniques that Operational Research scientists use is Quadratic Programming (QP).  It isn't often included in introductory courses, partly because it is hard to devise simple examples for classroom use.  I suspect that most courses including QP use portfolio optimisation as their introductory example.  This assumes that an investor has a finite sum to invest, and can divide it between a set of investments.  A great deal is known about these investments; the expected return on each, and the variance of each return, and the covariance of the returns between the investments.  Given these data, the expected return of the portfolio is a linear function of the decision variables (amount put into each investment).  The variance of that portfolio is a quadratic function of the same variables.  Then the simplest model is to minimise the variance subject to a constraint on the return.  Since this model was put forward in the research literature in the mid-20th century, it has been widely copied, criticised and developed.  The assumptions have been questioned, particularly the belief that one knows so much data about the investments, and the belief that the distribution of returns follows a normal distribution.

I read somewhere that the proponents of these models do not use their models in their investment holdings; does anyone know if this is so? 

Recent studies by financial analysts have looked at theoretical investments to investigate the effect of the number of alternative investments on the variance of the return, and - as one might expect- the more possible investments, the smaller the variance.  For variance, read "risk".  But, and this seems intuitive, the variance tends to a limit, so that adding one new investment to a choice of five has much more effect than adding one new one to a choice of fifteen, and that in turn has more effect that adding one to a choice of twenty-five.  The phenomenon has been named "deworsification", a portmanteau word combining diversification and worse. 

Analysts claim that once a stock portfolio reaches 20-30 holdings, there is little additional benefit to be gained from adding even more holdings.  Furthermore, a financial manager would like to have the chance to switch holdings, so as to grasp "investment opportunities", and the size of a holding in  a larger portfolio would not be enough to do this.  So there is another psychological advantage to this composition of holdings. 

Discovery of the term "deworsification" made me wonder whether specialists in QP had been involved in the studies mentioned above.  One of my memories of QP models of portfolios is that the optimal solution often occurs at a flattish region of the objective function, so the optimal mix can be varied from the theoretical optimum without significant effect on the "risk", and this phenomenon ties in with the idea of "deworsification"; changing one decision variable from its optimal value to zero (taking it out of the model) has little effect on that measured "risk". 

For many small investors, unit trusts are the way  to start.  Most unit trusts have more than 30 holdings, so they probably could have fewer holdings without serious effect on performance.  But, would a small investor be willing to put money in such a unit trust?  I wonder.