Programming Books C Java PHP Python Learn more Browse Programming Books
  • List Price: $54.99
  • Save: $11.80 (21%)
Only 5 left in stock (more on the way).
Ships from and sold by
Gift-wrap available.
FREE Shipping on orders over $35.
Used: Good | Details
Sold by RentU
Condition: Used: Good
Comment: Fast shipping from Amazon! Qualifies for Prime Shipping and FREE standard shipping for orders over $35. Overnight, 2 day and International shipping available! Excellent Customer Service.. May not include supplements such as CD, access code or DVD.
Access codes and supplements are not guaranteed with used items.
Sell yours for a Gift Card
We'll buy it for $2.00
Learn More
Trade in now
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Algorithms in Java, Part 5: Graph Algorithms (3rd Edition) (Pt.5) Paperback – July 25, 2003

ISBN-13: 078-5342361216 ISBN-10: 0201361213 Edition: 3rd

Buy New
Price: $43.19
25 New from $25.67 25 Used from $9.51
Amazon Price New from Used from
"Please retry"
$25.67 $9.51

There is a newer edition of this item:


Frequently Bought Together

Algorithms in Java, Part 5: Graph Algorithms (3rd Edition) (Pt.5) + Algorithms in Java, Parts 1-4 (3rd Edition) (Pts.1-4) + Elements of Programming Interviews: The Insiders' Guide
Price for all three: $137.94

Buy the selected items together

Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Paperback: 528 pages
  • Publisher: Addison-Wesley Professional; 3 edition (July 25, 2003)
  • Language: English
  • ISBN-10: 0201361213
  • ISBN-13: 978-0201361216
  • Product Dimensions: 7.8 x 0.8 x 9.2 inches
  • Shipping Weight: 1.8 pounds (View shipping rates and policies)
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (5 customer reviews)
  • Amazon Best Sellers Rank: #903,938 in Books (See Top 100 in Books)

Editorial Reviews

From the Back Cover

Once again, Robert Sedgewick provides a current and comprehensive introduction to important algorithms. The focus this time is on graph algorithms, which are increasingly critical for a wide range of applications, such as network connectivity, circuit design, scheduling, transaction processing, and resource allocation. In this book, Sedgewick offers the same successful blend of theory and practice that has made his work popular with programmers for many years. Michael Schidlowsky and Sedgewick have developed concise new Java implementations that both express the methods in a natural and direct manner and also can be used in real applications.

Algorithms in Java, Third Edition, Part 5: Graph Algorithms is the second book in Sedgewick's thoroughly revised and rewritten series. The first book, Parts 1-4, addresses fundamental algorithms, data structures, sorting, and searching. A forthcoming third book will focus on strings, geometry, and a range of advanced algorithms. Each book's expanded coverage features new algorithms and implementations, enhanced descriptions and diagrams, and a wealth of new exercises for polishing skills. The natural match between Java classes and abstract data type (ADT) implementations makes the code more broadly useful and relevant for the modern object-oriented programming environment.

The Web site for this book ( provides additional source code for programmers along with a variety of academic support materials for educators.

Coverage includes:

  • A complete overview of graph properties and types
  • Diagraphs and DAGs
  • Minimum spanning trees
  • Shortest paths
  • Network flows
  • Diagrams, sample Java code, and detailed algorithm descriptions
  • A landmark revision, Algorithms in Java, Third Edition, Part 5 provides a complete tool set for programmers to implement, debug, and use graph algorithms across a wide range of computer applications.


    Excerpt. © Reprinted by permission. All rights reserved.

    GRAPHS AND GRAPH algorithms are pervasive in modern computing applications. This book describes the most important known methods for solving the graph-processing problems that arise in practice. Its primary aim is to make these methods and the basic principles behind them accessible to the growing number of people in need of knowing them. The material is developed from first principles, starting with basic information and working through classical methods up through modern techniques that are still under development. Carefully chosen examples, detailed figures, and complete implementations supplement thorough descriptions of algorithms and applications.


    This book is the second of three volumes that are intended to survey the most important computer algorithms in use today. The first volume (Parts 1-4) covers fundamental concepts (Part 1), data structures (Part 2), sorting algorithms (Part 3), and searching algorithms (Part 4); this volume (Part 5) covers graphs and graph algorithms; and the (yet to be published) third volume (Parts 6-8) covers strings (Part 6), computational geometry (Part 7), and advanced algorithms and applications (Part 8).

    The books are useful as texts early in the computer science curriculum, after students have acquired basic programming skills and familiarity with computer systems, but before they have taken specialized courses in advanced areas of computer science or computer applications. The books also are useful for self-study or as a reference for people engaged in the development of computer systems or applications programs because they contain implementations of useful algorithms and detailed information on these algorithms' performance characteristics. The broad perspective taken makes the series an appropriate introduction to the field.

    Together the three volumes comprise the Third Edition of a book that has been widely used by students and programmers around the world for many years. I have completely rewritten the text for this edition, and I have added thousands of new exercises, hundreds of new figures, dozens of new programs, and detailed commentary on all the figures and programs. This new material provides both coverage of new topics and fuller explanations of many of the classic algorithms. A new emphasis on abstract data types throughout the books makes the programs more broadly useful and relevant in modern object-oriented programming environments. People who have read previous editions will find a wealth of new information throughout; all readers will find a wealth of pedagogical material that provides effective access to essential concepts.

    These books are not just for programmers and computer science students. Everyone who uses a computer wants it to run faster or to solve larger problems. The algorithms that we consider represent a body of knowledge developed during the last 50 years that is the basis for the efficient use of the computer for a broad variety of applications. From N-body simulation problems in physics to genetic-sequencing problems in molecular biology, the basic methods described here have become essential in scientific research; and from database systems to Internet search engines, they have become essential parts of modern software systems. As the scope of computer applications becomes more widespread, so grows the impact of basic algorithms. The goal of this book is to serve as a resource so that students and professionals can know and make intelligent use of graph algorithms as the need arises in whatever computer application they might undertake.


    This book, Algorithms in Java, Third Edition, Part 5: Graph Algorithms, contains six chapters that cover graph properties and types, graph search, directed graphs, minimal spanning trees, shortest paths, and networks. The descriptions here are intended to give readers an understanding of the basic properties of as broad a range of fundamental graph algorithms as possible.

    You will most appreciate the material here if you have had a course covering basic principles of algorithm design and analysis and programming experience in a high-level language such as Java, C++, or C. Algorithms in Java, Third Edition, Parts 1-4, is certainly adequate preparation. This volume assumes basic knowledge about arrays, linked lists, and abstract data types (ADTs) and makes use of priority-queue, symbol-table, and union-find ADTs--all of which are described in detail in Parts 1-4 (and in many other introductory texts on algorithms and data structures).

    Basic properties of graphs and graph algorithms are developed from first principles, but full understanding often can lead to deep and difficult mathematics. Although the discussion of advanced mathematical concepts is brief, general, and descriptive, you certainly need a higher level of mathematical maturity to appreciate graph algorithms than you do for the topics in Parts 1-4. Still, readers at various levels of mathematical maturity will be able to profit from this book. The topic dictates this approach: Some elementary graph algorithms that should be understood and used by everyone differ only slightly from some advanced algorithms that are not understood by anyone. The primary intent here is to place important algorithms in context with other methods throughout the book, not to teach all of the mathematical material. But the rigorous treatment demanded by good mathematics often leads us to good programs, so I have tried to provide a balance between the formal treatment favored by theoreticians and the coverage needed by practitioners, without sacrificing rigor.

    Use in the Curriculum

    There is a great deal of flexibility in how the material here can be taught, depending on the taste of the instructor and the preparation of the students. There is sufficient coverage of basic material for the book to be used to teach data structures to beginners, and there is sufficient detail and coverage of advanced material for the book to be used to teach the design and analysis of algorithms to upper-level students. Some instructors may wish to emphasize implementations and practical concerns; others may wish to emphasize analysis and theoretical concepts.

    For a more comprehensive course, this book is also available in a special bundle with Parts 1-4; thereby instructors can cover fundamentals, data structures, sorting, searching, and graph algorithms in one consistent style.

    The exercises--nearly all of which are new to this third edition--fall into several types. Some are intended to test understanding of material in the text, and simply ask readers to work through an example or to apply concepts described in the text. Others involve implementing and putting together the algorithms, or running empirical studies to compare variants of the algorithms and to learn their properties. Still others are a repository for important information at a level of detail that is not appropriate for the text. Reading and thinking about the exercises will pay dividends for every reader.

    Algorithms of Practical Use

    Anyone wanting to use a computer more effectively can use this book for reference or for self-study. People with programming experience can find information on specific topics throughout the book. To a large extent, you can read the individual chapters in the book independently of the others, although, in some cases, algorithms in one chapter make use of methods from a previous chapter.

    The orientation of the book is to study algorithms likely to be of practical use. The book provides information about the tools of the trade to the point that readers can confidently implement, debug, and put algorithms to work to solve a problem or to provide functionality in an application. Full implementations of the methods discussed are included, as are descriptions of the operations of these programs on a consistent set of examples.

    Because we work with real code, rather than write pseudo-code, you can put the programs to practical use quickly. Program listings are available from the book's home page. You can use these working programs in many ways to help you study algorithms. Read them to check your understanding of the details of an algorithm, or to see one way to handle initializations, boundary conditions, and other situations that pose programming challenges. Run them to see the algorithms in action, to study performance empirically and check your results against the tables in the book, or to try your own modifications.

    Indeed, one practical application of the algorithms has been to produce the hundreds of figures throughout the book. Many algorithms are brought to light on an intuitive level through the visual dimension provided by these figures.

    Characteristics of the algorithms and of the situations in which they might be useful are discussed in detail. Connections to the analysis of algorithms and theoretical computer science are developed in context. When appropriate, empirical and analytic results are presented to illustrate why certain algorithms are preferred. When interesting, the relationship of the practical algorithms being discussed to purely theoretical results is described. Specific information on performance characteristics of algorithms and implementations is synthesized, encapsulated, and discussed throughout the book.

    Programming Language

    The programming language used for all of the implementations is Java. The programs use a wide range of standard Java idioms, and the text includes concise descriptions of each construct.

    Mike Schidlowsky and I developed a style of Java programming based on ADTs that we feel is an effective way to present the algorithms and data structures as real programs. We have striven for elegant, compact, efficient, and portable implementations. The style is consistent whenever possible, so programs that are similar look similar.

    A goal of this book is to present the algorithms in as simple and direct a form as possible. For many of the algorithms, the similarities remain regardless of which language is used: Dijkstra's algorithm (to pick one prominent example) is Dijkstra's algorithm, whether expressed in Algol-60, Basic, Fortran, Smalltalk, Ada, Pascal, C, C++, Modula-3, PostScript, Java, Python, or any of the countless other programming languages and environments in which it has proved to be an effective graph-processing method. On the one hand, our code is informed by experience with implementing algorithms in these and numerous other languages (C and C++ versions of this book are also available); on the other hand, some of the properties of some of these languages are informed by their designers' experience with some of the algorithms and data structures that we consider in this book. In the end, we feel that the code presented in the book both precisely defines the algorithms and is useful in practice.


    More About the Author

    Discover books, learn about writers, read author blogs, and more.

    Customer Reviews

    4.4 out of 5 stars
    Share your thoughts with other customers

    Most Helpful Customer Reviews

    22 of 23 people found the following review helpful By W Boudville HALL OF FAMETOP 1000 REVIEWERVINE VOICE on July 31, 2003
    Format: Paperback
    In my work, I have a bunch of interlinked objects. I can use tables to display these, but showing linkages is awkward. It is far more natural to graph them. This lets me use evolution, for the human eye and brain are excellent at processing images and discerning patterns in them. But I also want to algorithmically find groupings and invariant properties of the graphs. There is a danger here. In graph theory, it is very easy to inadvertantly pose a simple question that is computationally hard to solve (NP-hard). Conversely, I don't want to reinvent the wheel. From graph theory, there may well be properties of my graph that I can easily extract. Certainly, the amount of research on graphs is voluminous.
    But how does one take advantage of that? Consulting research journals in maths for papers on graph theory is really feasible only for the career mathematician. But for me, graphs are just a tool; not an ends per se. So I need a book that has the right amount of complexity. It needs to get enough into the subject, beyond the trivial exposition of definitions. Yet it should not bury me in lemmas and theorems.
    I found such a book! This one. A well deserved third iteration. The explanations are extremely clear. Before I encountered this text, I used Donald Knuth's "Art of Computer Programming" (which is also put out by Addison-Wesley) and his treatment of graphs. But Sedgewick's discourse is far more extensive and, to me, just as well written.
    A bonus is the extensive problem sets at the ends of each chapter. Even if I have no inclination to do them, the results they give are a valuable extension of the text, by providing an extra summary of the research. I only wish that Sedgewick would provide answers, like Knuth. But this is a just a quibble.
    Read more ›
    Comment Was this review helpful to you? Yes No Sending feedback...
    Thank you for your feedback. If this review is inappropriate, please let us know.
    Sorry, we failed to record your vote. Please try again
    3 of 4 people found the following review helpful By R. Lee on February 25, 2006
    Format: Paperback
    Another reviewer gave this book a one star rating citing that the book falls short on practical examples.

    In light of that, I'm concerned that other readers might overlook what, in my opinion, may be one of the most comprehensive and well written introductions to graph theory and graph algorithms that there is, and certainly one of the best that I have personally come across thus far.

    Recently I took on a project wherein I needed to solve a shortest path problem for a particular kind of graph. I am not a specialist in graph theory and needed practical information that I could utilize immediately. For me, this book fit the bill and was a godsend.

    It is true that I already had a practical real world application in mind before I even knew of this book but this book has exceeded both my needs and expectations.

    It is easy for me to understand how you may not initially see the practical value of the information being presented, if the sole reason you're studying this book is simply because it is a part of your college curriculum. I think, however, that that does not lessen the value of the book, especially for those of us who do have practical applications for the material.

    If you are looking for an informational resource for a real-world problem related to graph theory, you would do well to consider this book.

    The book does actually open by citing several practical examples of areas where these algorithms can be applied, although, perhaps the reader who assigned the one star rating may have appreciated and benefited from a case study.
    Comment Was this review helpful to you? Yes No Sending feedback...
    Thank you for your feedback. If this review is inappropriate, please let us know.
    Sorry, we failed to record your vote. Please try again
    1 of 1 people found the following review helpful By Dopey Reader on July 7, 2011
    Format: Paperback
    As a self-study effort, I read this book cover-to-cover -- worked through most proofs and produced working code for every algorithm discussed in this text. I've also done most exercise questions at the back of each section. This is by far the most comprehensive source on graph algorithms that I could find. Its sections on directed graph algorithms and network flow are presented in rigorous details.

    As much as I admired the work presented in this text, every masterpiece has its flaws, and this one is no different. Many sections of the text had cryptic descriptions, ambiguous explanations, and fragmented code samples that required time to "reverse-engineer". It is as if the author wants the reader to prove his/her worth before presenting all the hidden gems in this book.

    For example, the entire Network Flow chapter is filled with partial code fragments that the reader has to piece together manually. Key details like the Network class and the interface that it exposes, were missing and renders the code samples difficult to dig through. The modified Bellman-Ford algorithm that's used to discover negative cost cycles in residual networks -- the central piece of the puzzle -- was assigned as exercise without solutions. On one hand it served high pedagogical values, on the other it was tedious to work through by yourself without help from an instructor.
    Comment Was this review helpful to you? Yes No Sending feedback...
    Thank you for your feedback. If this review is inappropriate, please let us know.
    Sorry, we failed to record your vote. Please try again
    By M.T. Cabeza on June 20, 2013
    Format: Paperback Verified Purchase
    In spite of the reference to Java in the title of the book, this is not a good resource for anyone who does not already know Java.
    For anyone who does know the language, the idiosyncratic style will merely be mystifying.

    Among other things, I don't understand why the authors would introduce the concept of an "interface" using syntax that is not legal Java when
    the language has already has a perfectly usable interface construct.
    Comment Was this review helpful to you? Yes No Sending feedback...
    Thank you for your feedback. If this review is inappropriate, please let us know.
    Sorry, we failed to record your vote. Please try again

    What Other Items Do Customers Buy After Viewing This Item?