Sunday 30 May 2010

The Travelling Librarian

I was thinking thinking about how libraries in the same council get books to each other. For instance, I can go into the City Library, and borrow books straight off the shelf. If I that particular library doesn't have the book I want, I can search through the catalogue of all the other connected libraries, and if one of them has it, I can put it on reserve, and through library magic, it'll be at the City Library for me to pick up next time (you get an email to tell you that it has arrived, so you don't have to keep going in to check whether it's there or not). Not just that, but if I borrowed a book that belonged to a connected library, I could still return it at the City Library, and it'd find its way back to its home library. I was wondering what method the library uses to pass books around. I'll probably end up asking ex-librarian extrodinaire Darren later, but I thought I'd try to solve the problem myself first.

So first we have to make some assumptions:
-lacking any data about user borrowing habits, let's just assume the worst case scenario: every library has books that it needs to give to each other library, and every library has books it requires from each other library.
-the truck(/van/car/rickshaw) has unlimited space, and so return trips to pick up an overflow of books are unneccesary.
-readers are impatient and they expect their books to arrive by at least the next working day(this may be the most unlikely assumption, but I'm making it because I think it makes sense. For instance, you could have a solution like "all books are shipped to Library A on Mondays, B on Tuesdays, C on Wednesdays, etc with a 'take yours pass the rest along' agreement" but that seems like a strange solution - though it might be efficient in terms of saving petrol and driver costs).
-the truck must return to its starting location at the end of each day (because that's where the driver has parked their car so that they can go home).
-the books are already sorted into their destinations, so sorting time doesn't need to be taken into account
-delivery is instantaneous (drop it down a chute or something), so that doesn't need to be taken into account.
-all the transportation is done after closing time, so you don't have to take into account a worse-worst case in which people are constantly queuing up reservations from the library furthest away to the library you're currently at (if any reservations are made after closing time, they are queued for the next day).



=Simple solution



The obvious solution would be for each library to have a truck, and make deliveries at the end of the night to each of the other libraries. This is really inefficient though, as you need n trucks for n libraries and they each make n trips, so you end up with n^2 trips. Plus having to pay for n trucks and pay n drivers.

n trucks
n^2 arrows


Two trucks




The next solution I could think of involved one truck that made a circular trip picking up books along the way, dropping the books off at the last destination, and then circling back and dropping off all the other books along the way. This solution can partially take into account load limits, as you can drop off books at intermediate libraries while you're picking them up, so you can release some of your load. It's a bit like an elevator algorithm.'

1 truck
2(n - 1) arrows



One truck



The last solution I came up with featured two trucks, starting at opposite ends. They would travel towards each other, only picking up books for libraries they hadn't yet passed.

Truck 1 would pick up all books at Library A. At Library B, it would drop off any books from A destined for B, and only pick up books for library C, D or E.

Truck 2 would pick up all books at Library E. At Library D, it would drop off books from E destined for D, and only pick up books for library C, B or A.

At Library C, they would both drop off books destined for C, and Truck 1 would only pick up books for D or E, and Truck 2 would only pick up books for A or B. Timewise, this is faster than the second solution, but it requires 2 trucks, rather than one.

2 trucks
2n arrows


I'll ask Darren later and update this with what he says libraries actually do.

Friday 28 May 2010

Fat Boy or Slim?

Lately I've noticed that I don't seem to notice what anybody's body shape is. I was meeting up with two friends who hadn't met each other before at the new DFO in South Wharf where they have no phone reception downstairs. I had gone down with Lucy and the Sharon had no way of contacting us to tell us where she was. We figured Sharon must have been downstairs since we couldn't call her. In the end, Lucy and I decided to split up, and she was going to sit outside Smiggle in case Sharon came up, while I went downstairs to look for her. Lucy asked for a description of Sharon, and all I could come up with was, "Asian with long, black hair". Lucy asked if she was fat/skinny/etc. and I struggled to come up with an answer.

I guess the first big problem is that the labels "fat" and "skinny" are subjective. When asked whether someone is either, I usually compare them to people that I know are fat or skinny. When asked to think of a fat person, the only person that usually pops up in my head is John Candy (which most people don't even know, so that doesn't really help!) and skinny makes me think of Kate Moss. Everything is mostly a grey area in between. That's just for me though, and I know that other people will have different points of reference. It seems weird to say, "Well, I guess she's one and a half Kate Mosses." Not just that, but I may describe someone as what I think is fat, and the other person will have a differing opinion. When people have commented to me that they are fat and need to lose weight, I am always so surprised, because I had never considered them to be fat. I spent the last 10 minutes trying to think of somebody I know in real life who is fat, and other than a supervisor at Safeway, I couldn't think of anybody. Yet obesity is a huge problem in Australia, so it seems unlikely that of all the people I know, only one person is fat. Clearly something must be wrong with my perception of people!

I have overheard people calling me fat before, but according to my WiiFit (clearly the most reliable source of information that I have!) I'm in the healthy BMI range. Now if only people could wear wrist bands or something signifying which range they are in so that it would make it easier for me to describe them! Then again, QC says Asians are meant to have lower than normal BMI (or was it higher? It was different to the standard, anyway) so that doesn't really help.

Still, it made me wonder if I have some sort of prosopagnosia. In most cases, I can really only give a vague physical description of somebody, and even then, it's generally unhelpful. It's unfortunate, because a lot of the time, we are required to give a description of somebody in order to resolve a problem. I don't think I do have prosopagnosia though, probably just "psychohypochrondria" - the condition suffered by psychology students who feel they have every psychological disorder in the DSM IV. I just think that I find other facts about people more important. I could tell you a whole list of things about Sharon (which would make sense given that I've known her for about 12 years now), with a very small portion of that list being a physical description.

A part of this may be due to maturity. When young children are asked to describe themselves, they will usually list physical attributes or things about possessions, "I am a girl," or "I have a blue train." Then they later develop thoughts about feelings and their position in society, "I love my parents, " or "At school, my job is to look after the roses." Teens tend to describe themselves in terms of personality traits or beliefs, "I'm talkative," or "I think people who talk loudly on the train are rude." Following that, it would make sense for me to store facts about people's personalities, beliefs and preferences rather than just a basic physical description.

If you get right down to it, what use is it to categorise people into "fat" and "skinny"? Other than ice-hockey, I really don't do any other physical sports at the moment (I can't even say I do ice hockey yet, since I'm still learning to skate), and so I don't really need to filter people out based on assumed physical capability (though a friend of mine who considers himself fat still outruns me). What I tend to try to remember are likes and dislikes, which makes it easier to work out who would be interested in doing certain things with me.