(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://ebookluna.com/product/ebook-pdf-a-guide-to-algorithm-
design-paradigms-methods-and-complexity-analysis/
https://ebookluna.com/product/ebook-pdf-research-methods-design-and-
analysis-13th-edition/
https://ebookluna.com/product/ebook-pdf-algorithm-design-by-jon-kleinberg/
https://ebookluna.com/product/original-pdf-algorithm-design-and-
applications-by-michael-t-goodrich/
Modern Control: State-Space Analysis and Design Methods 1st Edition - eBook
PDF
https://ebookluna.com/download/modern-control-state-space-analysis-and-
design-methods-ebook-pdf/
(eBook PDF) Handbook of Research Methods in Complexity Science: Theory and
Applications
https://ebookluna.com/product/ebook-pdf-handbook-of-research-methods-in-
complexity-science-theory-and-applications/
(eBook PDF) Data Structures & Algorithm Analysis in C++ 4th Edition
https://ebookluna.com/product/ebook-pdf-data-structures-algorithm-analysis-
in-c-4th-edition/
Data Structures & Algorithm Analysis in C++ 4th Edition (eBook PDF)
https://ebookluna.com/product/data-structures-algorithm-analysis-in-c-4th-
edition-ebook-pdf/
https://ebookluna.com/product/ebook-pdf-qualitative-psychology-a-practical-
guide-to-research-methods-3rd-edition/
(eBook PDF) Research Design and Methods: A Process Approach 11th Edition
https://ebookluna.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
“He did,” said Drew, “and we are going to get him, you [67]
and I. But after we get him, I guess we’d better let the
courts deal with him. Justice, Johnny, is an arrow, a
keen pointed arrow that goes straight and fair.
Sometimes I think it is an arrow of fire that burns as it
strikes.”
“The probabilities?”
“Sure. You’ve read detective stories?”
“Sometimes.”
[70]
CHAPTER VII
IN COURT
Drew called her Rosy, and patted her on the arm. Rosy’s
dimples deepened.
Who was Rosy? Why did she live in that other shack
among the walls of brick and mortar? Why did Drew
room in this odd place? Johnny wanted to ask all these
questions. Realizing that their answers did not greatly
concern him, he asked none of them.
The whole scene was packed with interest for Johnny. [71]
The judge in his box-like coop, the young prosecutor
and the deputies standing below, the motley throng that
filled the seats at his back, each waiting his turn to
appear as complainant, defendant or witness, made a
picture he would not soon forget.
“See! I told you. The judge is letting them go. It’s not
what you know that counts in court. It’s what you can
prove.”
“It is my duty,” the judge leaned forward in his chair, “to [73]
warn you that if you plead guilty I may fine you from
one dollar to one hundred dollars, or send you to jail for
from one day to one year. Knowing this, do you still
wish to plead guilty?” His tone was impressive.
“I—I don’t know, Judge. I—I just saw it there. I—I liked
it. So, the first thing I knew I was taking it away.”
[74]
The judge pointed to a row of chairs at the right of his
box; the defendant burst into tears, dabbled her eyes
with an embroidered handkerchief; her young husband
led her to a seat and, for the time, the affair was ended.
“But they do it, over and over and over. Hats, belts,
coats, dresses, artificial flowers. What don’t they steal?
And they come to court, sometimes three or four a day,
to stand before the judge and weep. You’d think they’d
learn, that everyone in the world would learn after
awhile, everyone, except the professional shoplifter. But
they don’t.”
And now a score of young black men stood before the [75]
bench. They were accused of gambling with dice. The
dice, a hook for raking them in, and a few coins were
offered in evidence.
“Ya-as, sir.”
“Got good jobs?”
“Ya-as, sir.”
“Ya-as, SIR!”
“All right, you can go, but we have a police benefit fund
here. If you’ve all got real good jobs you might
contribute a dollar each to that fund.”
[77]
CHAPTER VIII
PRISONERS AT THE BAR
Johnny will never know what that next brief trial was
about. It had struck him all of a sudden that he was to
play a part in the trial that was to follow. This thought
set his blood racing. He was glad not to be the
defendant. But as a witness his responsibility was great.
For the first time in his life he was to utter words that
would without doubt send a fellow human being to jail.
The thought was not pleasing.
A fresh turn of his mind for the moment crowded out all [78]
other thought. Who had beaten him up the night
before? Was it some pal of these pickpockets? Would he
be able to tell from the expressions on their faces when
they saw him? His head was heavily bandaged. “They
could not help but notice that. Perhaps they believe that
their confederate made a thorough job of it,” he told
himself. “They may not expect to see me here at all.”
“Yes, your Honor. But, your Honor, it’s the police. They
—”
Drew nodded.
“It must be,” agreed the judge. “They don’t even deny
it.
“That was it, Judge. You see, Judge,” the man went on,
encouraged by the judge’s disarming smile, “I knew this
boy was a detective. I—I’d see him before, and I says to
Jimmy, me pal here, I says, just whispers, y’
understand, ‘Jimmy,’ I says, ‘it would be great sport to
grab that country boy’s wad right before this college boy
detective’s eyes.’ We done it for sport, Judge, honest we
did.” The prisoner essayed a laugh, which turned out
number one common, and scarcely that.
“I see,” said the judge, leaning back in his chair and [83]
appearing to think deeply. “You stole a hundred dollars
from an innocent boy as a joke on a boy detective? You
were getting off the car, weren’t you?”
[86]
CHAPTER IX
CLUES
“It’s not just that,” said Drew. “You know yourself that [88]
pickpockets are sneaks; coyotes, not wolves. They may
be well organized in some cities. They’re not in this
one.”
“But what about the squad call that was going through
when the raid on the radio station was made?” Drew
broke in.
“I’m coming to that. That’s the queer part,” the sergeant
went on. “You see I have four sheets left. That means
four possibilities.
“Since you insist, we’ll take the call that was going
through when the station was raided. You’ll be
surprised. That squad call was a notice that someone
was breaking in over on Lake Shore Drive. Swell
apartment. People all gone. When the radio failed to
give the alarm, a squad was sent out from the local
police station, and the burglars were caught.”
“But let me tell you one thing. You may lay a bet those
boys never saw the inside of any college. I’ve been
watching. We don’t get many real college boys. When
they’re smart enough and good enough workers to get
up to college, they’re too smart to think they can beat
the game by turning crooks.”
“Sure.”
“Rather blind one, at that,” said the sergeant. “No one [91]
saw them. A straggler heard the blast and turned in the
alarm. Squad came. Safe was looted. Birds flown. Might
have gone a dozen ways, rowboat, on foot, in a car.
Gone, that’s all. Got something over a thousand dollars.
Left nothing, not even a fingerprint.”
“It’s too bad,” sighed Drew. “I’d say that was the likely
case. Going to blow up a safe. Mighty few cases these
days. Since the radio gave us a lift, electric drills are
cheap. Radio’s too quick for them. Whang! goes the
blast; r-ring-ring! the telephone; gong-gong! the radio;
and the police squad is on the way; all too soon for the
safe-cracker.
“Easy enough to see why they’d send an accomplice
over to break up the radio!”
“The other case that came off in that fateful quarter of [92]
an hour was a theatre holdup on State Street, just over
the river; one of those quiet little affairs. Two men say,
‘Stick ’em up! Give us the swag. Don’t yell! Don’t move
for a full minute, or you’ll be dead!’ A car. Quick
getaway. And there you are!
[94]
CHAPTER X
A ROYAL FEAST
“No luck at all. But that’s what one must expect. You [95]
can’t get ’em every day. If you did you’d soon be out of
a job. All the crooks would be behind the bars.
“Not that I’d care,” he hastened to add. “There are a lot
of occupations more congenial. If I didn’t have a
conscience that keeps me hunting men, I’d take up
commercial aviation. There’s a job for you! I can fly.
Have a hundred and ten hours to my credit, and never a
crack-up.”
“You’ll see. Just get on your collar and tie. We’ll want
plenty of time for a feast before you go back there to
get beaten up again. Or are you going?”
For a full half hour the time was spent between small
talk, and much eating.
“No. I did not know you then. You did not work on the [100]
case. The man, he was never found.”
[101]
CHAPTER XI
SWORN TO STAND BY
“It does. I’ve seen it. Very same tree. Going to strike
twice here, too. Something tells me that. You’ll see.
They’ll bomb this place. When those Sicilians start a
thing they never quit ’til they get what they want. That’s
what my dad says. And he knows. I’m quitting; to-
morrow night’s my last. Dad says, ‘Let the police do
their own work.’ And that’s what I say, too.”
“If the officers of the law were not backed up by the [102]
honest people of a great city like this,” Johnny replied
thoughtfully, “nobody’s life would be safe for a moment.
In such times as these every man must do his duty.”
“Not for me, sonny, not for me! I know where there’s a
safe place to work, and me for it!”
“With all my heart, son. With all my heart. And you’ll [104]
stick?”
* * * * * * * *
There are few more interesting places than the studio of [105]
a great radio station. Besides the never ending stream
of famous ones, great authors, moving-picture actors,
statesmen, musicians of high rank, opera singers, and
many more, there are the regulars, those who come
night after night with their carefully prepared programs
planned to entertain and amuse a tired world.
“But where is the society that cares for the women and
children made widows and orphans by the bullets of
gangsters, burglars, and robbers? Never heard of one,
did you?
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookluna.com