Saturday, 6 February 2016

Measuring is not (necessarily) controlling

We refer to it as "Big Brother".  Our electricity utility company has replaced our consumption meter with a smart meter, which can be interrogated remotely, removing the need for an official to come and read the meter every three or six months.  They told us that the old unit was out-of-date.  In the conversation about when to replace the meter, I was asked what the mobile phone strength was like by the meter; I answered that I never had tried to make mobile phone calls from underneath the stairs in our house.  (There is a good signal under the stairs on one phone network - not the one that we use!)
Part of the deal with the replacement meter is that we were given a smart monitor.  This interrogates the meter several times each minute and indicates our usage of electricity, with a three-colour light (green, amber, red for increased usage) and with a segmented dial with the same colours.  It also indicates the usage for different periods of time.  Default is the cost of electricity since midnight, so I am getting used to coming down to the kitchen each morning to find that Big Brother tells me that we have used 12 pence worth of electricity so far.  This comes from the background usage - clocks, freezer, refrigerator, central heating pump, radios on standby, chargers, and about 2 pence for the first kettle of the day for a pot of tea as we wake up. 
We do not have the toy!  The blue sectors are for those who monitor gas use as well as electric
We have both muttered "Measuring is not controlling" because there are comparatively few ways that we can reduce the amount of electricity that we use.  Nonetheless, we haven't turned Big Brother off yet, because it is interesting to watch the costs rise during the day, and associate activities (microwave on, thermostat on the electric iron reaching operating temperature) with changes to the light and sector dial.  And maybe we do not now boil too much water because each litre boiled costs 2 pence.
But, in the wider world, monitoring and measurement can be a good first step to controlling; so good O.R. may start with monitoring to obtain a series of appropriate measurements

Saturday, 30 January 2016

Seasonal variation - cycle helmets

For a time, I once taught a module on time series analysis and forecasting to undergraduates.  One aspect of such a module is to show different sorts of time series and how to build reasonably accurate forecasting models for them.  As the models became more complex, we looked at real life time series to identify what sorts of models were best for each one.  Of course, sooner or later, we had to model seasonality.  After dispensing with the absurd series for the sales of Christmas trees. month by month, we looked at more serious examples.  As I cycled to work, I brought in two series related to cyclists in the UK.  The first showed the monthly distance cycled by people in the UK, month by month, based on surveys of people's travel habits.  The second showed the monthly numbers of accidents to cyclists in the UK, taken from hospital admissions.  Both showed strong seasonality, with peaks in the summer months.  (Many casual cyclists do not use their bicycles in the colder months.  I did and still do.)  With my tongue in my cheek, I graphed these two series and announced that it was clearly more dangerous to cycle in the summer ... and waited for a response.  Sooner or later, someone would point out that the total number did not represent risk.  So, what does represent risk?  A little more thought, and the answer came back; why not take the ratio of accidents to distance?  With appropriate scales, that gave a third time series, and that too had seasonality.  It peaked in September-October.  Now we moved into the psychology behind such a seasonal variation, and my researches had shown that in those months it was still warm enough for the casual cyclists, but many neglected to use lights.

The BBC radio programme "More of Less" earlier this month included Rob Eastaway, playing a statistical game with children on a bus in London - spot the cyclist.  One pupil scored the number of cyclists with helmets, the second counted those without.  First one to reach a score of ten wins.  Now helmet-wearing is not compulsory in the UK, but many cyclists wear helmets.  Rob espected the game to end at about 10:5, but in the end it was 10:9 for helmets.

Tina and I have amused ourselves doing this counting on several rides on the cycle paths by the river Exe recently.  Generally we find that about 20 to 25% of cyclists are without helmets on these paths, but there is some seasonal variation, by day of the week and time of day.  More riders are helmetless at weekends, when there are leisure cyclists.  Early morning cyclists are more inclined to wear helmets than those mid-morning.  More riders are helmetless within a 3 mile radius of the city centre - suggesting that those who do a longer commute tend to wear a helmet.  But there is another factor to the seasonality which the time series models would have difficulty representing- that of people cycling in groups.  Three of four people together will often affect one another's use of helmets - either all with or all without. 

I can't think of any serious reason for wanting to forecast the number of cyclists wearing helmets that you would see on a given day and time, but the analysis of past data would be an interetsing exercise for students.  Any offers?

Wednesday, 23 December 2015

Bus fleet replacement

Something odd is happening to our local bus fleet. 

All the buses that serve the Exeter to Exmouth route have been replaced together.  And all the vehicles are dedicated to that route.  So the company has acquired eleven new buses,  branded them as "Stagecoach Gold" with comfortable seats, wi-fi, USB sockets at the seats.  The timetable hasn't been significantly changed, but the service has been relaunched with gold coloured buses, labelled all over with the route name and number.  (Link here for the story.)

It seems odd to have a large bus fleet and then to divide it into - what shall we call them? - sub-fleets which cannot be interchanged.  Naively, one would expect that it would be more efficient if no vehicle was dedicated to a particular route.  Then, when wear and tear meant that one vehicle needed maintenance or other attention, any of the other similar vehicles could take its place.  But a bus which is labelled "Exeter to Exmouth" on the side cannot be used for the route from Exeter to Barnstaple.  And the buses that go between Exeter and Barnstaple are plain, and would not be appropriate for the Exmouth service.  So, I deduce that there must be enough flexibility in the Exeter-Exmouth sub-fleet to ensure that the service can be supported with vehicles of the same colour and quality. 

It isn't the only local route which has its own sub-fleet.  There are other "gold" bus routes out of Exeter and Plymouth.  But this is the route with the most regular service (every 15 minutes during the day).  In due time, I expect other local bus routes to have their own dedicated sub-fleet.  The same branding is being used in other parts of the UK.  The USB sockets are a new feature compared with buses that were rolled out in the Midlands.  For some time we have had "ordinary" buses branded with a particular route; however, those could have their branding removed or changed quite easily, should the need arise.  The point about this latest change is that the new vehicles are quite different in styling and facilities.

So, let us speculate and try (as O.R. people) to unravel the decision-process that has been followed.  A decision has been made to introduce this quality service; that means it has to be marketed in competition with the railway line and travel by car.  So the decision follows that all the buses on the service must be of the same appearance and standard.  Then this leads to the size of the sub-fleet, and here cost appears, balancing the need for facilities to keep these vehicles on the road with the extra revenue to be expected from the improved service.  Somewhere along the line, there is an advertising budget, which has been quite small in comparison with the cost of a double-decker bus.  (And decisions have to be made about how to advertise the service.)  Some of the costs are offset because the new transport has released a dozen or so older buses into the pool for the whole local fleet. 

Other commercial vehicle fleets have similar problems, whether they are trucks or trains.  But there are relatively few situations where a whole sub-fleet needs to be rolled out overnight.

And I like the new buses - because, in addition to the facilities mentioned - they have more legroom!

A multicriteria analysis of access to UK airports

How easy is it to get to an airport?  Recently, the UK newspaper, The Independent, attempted to measure access to a couple of dozen UK airports.  Without using the term, they performed a multiple criteria analysis using three surrogate measures that affect access to airports by public transport.  So, they used: the fare, the journey time, and the waiting time. For each of them, the smaller the better.  They were measuring from the city that was nominally served by each airport, although, in practice, that city will not provide all the passengers for the airport.  But, on the assumption that many people who use public transport to get to an airport will travel through the main city, it isn't too bad an assumption.  (When Tina and I travel from London Heathrow, we use rail and bus and do not go via London - there is generally little point in going into London from the west and then going out to the airport which is to the west of the city.  But we are in a minority.)

How do you develop a measure which combines these three?  The newspaper multiplied the three measures together to get a number whose dimensions were (minutes)^2 * pounds, and then took the cube root to bring the numbers down to a manageable size (and that did not affect the ordering at all) 

Exeter, our local airport, is 20 minutes away by bus, and the bus is every hour, with a fare of about £3 so the three measures combine to give 20 * 60 * 3 = (15.3)^3.  
From the newspaper's report:
This generated a league table (see below) where low scores show better transport links.
The clear winner, Southampton, should hardly be a surprise; it has frequent seven-minute train connections from Southampton Central to the Airport Parkway station, barely four miles from the city. More impressive, arguably, was the performance of Birmingham and Manchester – much bigger airports, twice as far from the cities they serve.
Airports rated: the lower the score, the better
1 Southampton 7
2 Birmingham 7.5
3 Manchester 8
4 London City 8.5
5 Heathrow 9
6 Aberdeen 9.5
7 Newcastle 10
8 Belfast City 10
9 Edinburgh 11
10 Glasgow 11
11 Leeds/Bradford 12 
12 Bristol 13 
13 Liverpool 14
14 Exeter 15
15 Inverness 15
16 East Midlands 17
17 Belfast International 17
18 Prestwick 17.5
19 Cardiff 18
20 Gatwick 21
21 Luton 21
22 Stansted 24
23 Southend 26

The analysis could be extended:  for us in Exeter, the local airport scores 15 on this measure.  Suppose we wanted to go to Bristol.  There is an hourly service, Rome2Rio says it would take 87 minutes at a cost of £55.  That airport, for us, would score 66.  And Heathrow: 257 minutes (via Woking), hourly service, fare £43, scoring: 87.  Southampton, top of the table for its home city, scores 71 for travel from Exeter.  But I have no cause to fly from there, because - when it comes to comparing airports for personal use - the choice of destinations affects me.  Southampton has fewer destinations than Bristol or Heathrow, so doesn't compare withthose two airports.

So, it is interesting to see how a newspaper attempts to compare items (airports) on the basis of these three criteria.  Would an O.R.  professional have used the same measures?  And made a similar comparison?  

As an aside, over the years, I have flown from from nine of the airports listed.

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.