In Chapter 59, following a scene where Pi takes in the vastness and loneliness of his surroundings at sea, Pi notices the beauty of the ocean at night and compares it to a bustling cityscape:
With just one glance I discovered that the sea is a city. Just below me, all around, unsuspected by me, were highways, boulevards, streets and roundabouts bustling with submarine traffic. In water that was dense, glassy and flecked by millions of lit-up specks of plankton, fish like trucks and buses and cars and bicycles and pedestrians were madly racing about, no doubt honking and hollering at each other…They were like those time-exposure photographs you see of cities at night, with the long red streaks made by the tail lights of cars. Except that here the cars were driving above and under each other as if they were on interchanges that were stacked ten storeys high. And here the cars were of the craziest colours.
Through this metaphor, Pi brings a small amount of structure and humanity to his terrifying surroundings, since the relative familiarity of a city is much easier for him to grasp than the vast and threatening sea. Pi has recently realized that he is far from civilization, and this comparison allows Pi to cope with that fact by figuratively restructuring his surroundings to meet his psychological needs. In this chapter, Pi fulfills his physical needs (he manages to secure food, water, and shelter), so this final moment of comfort is the last step in showing Pi acclimating to a new sense of normalcy.