(Ebook PDF) A Guide To Algorithm Design: Paradigms, Methods, and Complexity Analysis Instant Download
(Ebook PDF) A Guide To Algorithm Design: Paradigms, Methods, and Complexity Analysis Instant Download
https://ebooksecure.com/product/ebook-pdf-a-guide-to-algorithm-
design-paradigms-methods-and-complexity-analysis/
http://ebooksecure.com/product/ebook-pdf-research-methods-design-
and-analysis-13th-edition/
http://ebooksecure.com/product/ebook-pdf-algorithm-design-by-jon-
kleinberg/
http://ebooksecure.com/product/original-pdf-algorithm-design-and-
applications-by-michael-t-goodrich/
https://ebooksecure.com/download/modern-control-state-space-
analysis-and-design-methods-ebook-pdf/
(eBook PDF) Handbook of Research Methods in Complexity
Science: Theory and Applications
http://ebooksecure.com/product/ebook-pdf-handbook-of-research-
methods-in-complexity-science-theory-and-applications/
http://ebooksecure.com/product/ebook-pdf-data-structures-
algorithm-analysis-in-c-4th-edition/
http://ebooksecure.com/product/data-structures-algorithm-
analysis-in-c-4th-edition-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-qualitative-psychology-
a-practical-guide-to-research-methods-3rd-edition/
http://ebooksecure.com/product/ebook-pdf-research-design-and-
methods-a-process-approach-11th-edition/
Computer Science/Computer Engineering/Computing Chapman & Hall/CRC
Applied Algorithms and Data Structures Series
ALGORITHM DESIGN
“This book is a great technical arsenal for every graduate student and post-
graduate researcher. By providing a treasure trove of concrete algorithmic A GUIDE TO
ALGORITHM
examples, the book trains the reader to recognize clues that indicate the
complexity of a broad range of algorithmic problems, while supplying
A GUIDE TO
a battery of techniques for solving a particular problem in hand. …”
—Umit Catalyurek, Professor, Ohio State University
Benoit, Robert,
Analysis provides a roadmap for readers to determine the difficulty of an
and
algorithmic problem by finding an optimal solution or proving complexity
results. It gives a practical treatment of algorithmic complexity and guides Vivien
readers in solving algorithmic problems. The book offers a comprehensive
set of problems with solutions as well as in-depth case studies that
demonstrate how to assess the complexity of a new problem.
4 Dynamic programming 81
4.1 The coin changing problem . . . . . . . . . . . . . . . . . . . 81
4.2 The knapsack problem . . . . . . . . . . . . . . . . . . . . . 84
4.3 Designing dynamic-programming algorithms . . . . . . . . . 86
4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Exercise 4.1: Matrix chains . . . . . . . . . . . . . . . . . . . 87
Exercise 4.2: The library . . . . . . . . . . . . . . . . . . . . . 88
Exercise 4.3: Polygon triangulation . . . . . . . . . . . . . . . 88
Exercise 4.4: Square of ones . . . . . . . . . . . . . . . . . . . 89
Exercise 4.5: The wind band . . . . . . . . . . . . . . . . . . 89
Exercise 4.6: Ski rental . . . . . . . . . . . . . . . . . . . . . . 89
Exercise 4.7: Building set . . . . . . . . . . . . . . . . . . . . 90
4.5 Solutions to exercises . . . . . . . . . . . . . . . . . . . . . . 90
Solution to Exercise 4.1: Matrix chains . . . . . . . . . . . . . 90
Solution to Exercise 4.2: The library . . . . . . . . . . . . . . 91
Solution to Exercise 4.3: Polygon triangulation . . . . . . . . 93
Solution to Exercise 4.4: Square of ones . . . . . . . . . . . . 96
Solution to Exercise 4.5: The wind band . . . . . . . . . . . . 98
Solution to Exercise 4.6: Ski rental . . . . . . . . . . . . . . . 98
Solution to Exercise 4.7: Building set . . . . . . . . . . . . . . 102
4.6 Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . 103
References 349
Index 359
xiii
Objective
YABA? Yet Another Book on Algorithms?
No thanks. There are so many good books on the design of algorithms that
it is hard to choose and pick one. If asked to name our two favorite refer-
ences, we would recommend Introduction to Algorithms by Cormen, Leiserson,
Rivest, and Stein [27] and Algorithms by Dasgupta, Papadimitriou, and Vazi-
rani [30]. For sure, this book does not intend to compete with such established
monuments.
Instead, this book proposes a complementary perspective. It aims at guid-
ing students and researchers who need to solve problems, either by finding
optimal algorithms or by assessing new complexity results. In a nutshell, the
main objective of this book is to outline the roadmap to follow, and to prac-
tice all the corresponding steps, in order to determine the complexity of a
problem.
xv
extensive material so that the readers can assess their skills by solving the
many exercises in Part I.
Part II of this book can be used to teach an undergraduate or graduate class
on NP-completeness, with a focus on polynomial reductions, and a survey of
approaches that go beyond NP-completeness.
Part III of this book can be used to teach a graduate class on advanced
algorithms, either in the form of a series of classes presenting the case studies,
or in the form of projects assigned to students.
Part III constitutes the main originality of the book. It is devoted to case
studies whose goal is to provide the reader with tools and techniques to assess
problem complexity: which instances are polynomial, and which are NP-hard,
and what do to for the latter. Part III consists of an introduction summarizing
how to assess the complexity of a new problem, and it is illustrated with five
case studies:
1. Chains-on-chains partitioning
2. Replica placement in tree networks
3. Packet routing
4. Matrix product, or tiling the unit square
5. Online scheduling
Thanks
The content of this book, or at least preliminary versions of it, has been
used to teach courses at École Normale Supérieure de Lyon. We are grate-
ful to the students for their feedback and suggestions. We also thank all
our colleagues who helped gather the problems of Part I. The teaching assis-
tants when Yves Robert was teaching the Algorithms course were (ordering by
year) Odile Millet-Botta, Tanguy Risset, Alain Darte, Bruno Durand, Frédéric
Vivien, Jean-Christophe Dubacq, Olivier Bodini, Daniel Hirschkoff, Matthieu
Exbrayat, Natacha Portier, Emmanuel Hyon, Eric Thierry, Michel Morvan,
and Yves Caniou. The teaching assistants when Anne Benoit took over were
(ordering by year) Victor Poupet, Damien Regnault, Benjamin Depardon,
Jean-François Pineau, Clément Rezvoy, Christophe Mouilleron, Fanny Du-
fossé, and Anne-Cécile Orgerie.
We also wish to thank the following people who have contributed to some
of the content by their insightful suggestions, their own previously published
work, or their help reviewing draft chapters: Guillaume Aupy, Marin Bougeret,
Jean-Yves l’Excellent, Arnaud Legrand, Loris Marchal, Paul Renaud-Goud,
Veronika Sonigo, and Bora Uçar.
Finally, a word of caution on bibliographical notes: Some exercises have ap-
peared in many sources, and the references that we give may well not be the
original ones. Also, the absence of any reference is not a claim for originality!
However, all solutions are ours, and they have been tested and verified by the
students at ENS Lyon, the teaching assistants, and ourselves (but we keep the
sole responsibility for errors). We welcome comments and suggestions to our
e-mail addresses.
Polynomial-time
algorithms: Exercises
This chapter revisits basic notions on the cost of an algorithm and on the
complexity of a problem. To illustrate these notions, in Section 1.1, we study
the problem of computing xn , given x and n (where n is a positive integer).
Then, in Section 1.2, we recall the classical asymptotic notations O, o, Θ,
and Ω. Finally, exercises are proposed in Section 1.3, with their solutions in
Section 1.4.
9y0 = x, y1 , y2 , . . . , ym−1 , ym = xn ,
Opt(n) = min m .
8i 2 [1, m], 9j, k 2 [0, i 1], yi = yj yk
3 4
5 6 8
7 10 9 12 16
14 11 13 15 20 18 24 17 32
19 21 28 22 23 26 25 30 40 27 36 48 33 34 64
Building the tree. The root of the tree is 1. The tree is then built by
induction. The (k + 1)-th level of the tree is defined from the first k levels as
follows. Consider each node j of the k-th level from the left to the right, and
create nodes j + 1, j + a1 , j + a2 , . . . , j + ak−1 = 2j at level k + 1, as children of
node j, in this order from left to right, where 1, a1 , . . . , ak−1 = j is the path
from the root to j. We do not add a node in the tree if there is already a node
with the same value.
The algorithm. The algorithm simply consists of finding n in the tree (it
appears only once by construction) and extracting nodes on the path from the
root to n: 1, a1 , . . . , n. At each step of the algorithm, we compute yi = xai as
a product of two previous temporary results, which is possible by construction
of the tree. The number of products to be done, i.e., the cost of the algorithm,
is equal to the length of the path.
Statistics. Some interesting statistics are extracted from Knuth’s book [62].
The smallest numbers for which the tree method is not optimal are n = 77,
n = 154, and n = 233. The smallest number for which the tree method
is better both to the binary and the factorization methods is n = 23. The
smallest number for which the tree method is worse than the factorization
method is n = 19, 879 = 103 193, and such cases are rare; for n 6 100, 000,
the tree method is better than the factorization method 88, 803 times, it is
equivalent 11, 191 times, and it is worse than the factorization method only
6 times.
Opt(n)
16 6 2.
dlog(n)e
Opt(n)
THEOREM 1.2. lim = 1.
n→∞ log(n)