About The Author of this book
Magnus Lie Hetland, is an experienced Python programmer, having used the
language since the late 90s. He is also an associate professor of algorithms at the Norwegian University of Science and Technology and has taught algorithms for the better part of a decade. Hetland is the author of Beginning Python (originally Practical Python).
Introduction
Consider the following problem. You are to visit all the cities, towns, and villages of, say, Sweden and
then return to your starting point. This might take a while (there are 24 978 locations to visit, after all), so
you want to minimize your route. You plan on visiting each location exactly once, following the shortest route possible. As a programmer, you certainly don’t want to plot the route by hand. Rather, you try to
write some code that will plan your trip for you. For some reason, however, you can’t seem to get it right.
A straightforward program works well for a smaller number of towns and cities but seems to run forever
on the actual problem, and improving the program turns out to be surprisingly hard. How come?
Actually, in 2004, a team of five researchers1 found such a tour of Sweden, after a number of other
research teams had tried and failed. The five-man team used cutting-edge software with lots of clever
optimizations and tricks of the trade, running on a cluster of 96 Xeon 2.6 GHz workstations. Their
software ran from March 2003 until May 2004, before it finally printed out the optimal solution. Taking
various interruptions into account, the team estimated that the total CPU time spent was about 85 years! Consider a similar problem: You want to get from Kashgar, in the westernmost regions of China, to
Ningbo, on the east coast, following the shortest route possible. Now, China has 3 583 715 km of
roadways and 77 834 km of railways, with millions of intersections to consider and a virtually
unfathomable number of possible routes to follow. It might seem that this problem is related to the
previous one, yet this shortest path problem is one solved routinely, with no appreciable delay, by GPS software and online map services. If you give those two cities to your favorite map service, you should
get the shortest route in mere moments. What’s going on here?
You will learn more about both of these problems later in the book; the first one is called the
traveling salesman (or salesrep) problem and is covered in Chapter 11, while so-called shortest path
problems are primarily dealt with in Chapter 9. I also hope you will gain a rather deep insight into why
one problem seems like such a hard nut to crack while the other admits several well-known, efficient
solutions. More importantly, you will learn something about how to deal with algorithmic and
computational problems in general, either solving them efficiently, using one of the several techniques
and algorithms you encounter in this book, or showing that they are too hard and that approximate solutions may be all you can hope for.
Review of this book
It is just a wonderful book on algorithms. I was happy to read it because there is everything necessary about algorithms. The author put a lot of effort to describe everything in a very clear way, for those how think to learn pyhon Algorithms i really recomend this book, it was very clear explanation of a complex subjects, Each chapter builds upon the previous chapters so that this is more like a class than a refrence manual, More approachable.There are sections that make note of how to implement certain algorithms using Python specific features, and this is very helpful, but this is first and foremost a book on algorithmic theory that happens to use Python for code examples.
Download
You can download this E-Books from these links.
Google Drive - Click Me
Mediafire - Click Me
Comments
Post a Comment