前言

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. .

Algorithms

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. Nearly 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 has become indispensable in 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, particularly the fundamental graph algorithms covered in this volume. 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.

Scope

This book, Algorithms in C, 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 C, Java, or C++. Algorithms in C, Third Edition, Parts 1-4 is certainly adequate preparation. This volume assumes basic knowledge about arrays, linked lists, and ADT design, and makes uses 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 of the properties of the algorithms 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. The algorithms described have found widespread use for years, and represent an essential body of knowledge for both the practicing programmer and the computer science student. There is sufficient coverage of basic material for the book to be used in a course on data structures and algorithms, and there is sufficient detail and coverage of advanced material for the book to be used for a course on graph algorithms. 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. A complete set of slide masters for use in lectures, sample programming assignments, interactive exercises for students, and other course materials may be found by accessing the book's home page. ..

The exercises--nearly all of which are new to this 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 other exercises 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 forreference 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 to work algorithms 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, the programs can be put to practical use quickly. Program listings are available from the book's home page.

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. Although not emphasized, 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 C (versions of the book in C++ and Java are under development). Any particular language has advantages and disadvantages; we use C in this book because it is widely available and provides the features needed for the implementations here. The programs can be translated easily to other modern programming languages because relatively few constructs are unique to C. We use standard C idioms when appropriate, but this book is not intended to be a reference work on C programming.

We strive for elegant, compact, and portable implementations, but we take the point of view that efficiency matters, so we try to be aware of the code's performance characteristics at all stages of development. There are many new programs in this edition, and many of the old ones have been reworked, primarily to make them more readily useful as abstract-data-type implementations. Extensive comparative empirical tests on the programs are discussed throughout the book.

A goal of this book is to present the algorithms in as simple and direct a form as possible. The style is consistent whenever possible so that similar programs look similar. 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, or any of the countless other programming languages and environments in which it has proved to be an effective graph-processing method.

Acknowledgments

Many people gave me helpful feedback on earlier versions of this book. In particular, hundreds of students at Princeton and Brown have suffered through preliminary drafts over the years. Special thanks are due to Trina Avery and Tom Freeman for their help in producing the first edition; to Janet Incerpi for her creativity and ingenuity in persuading our early and primitive digital computerized typesetting hardware and software to produce the first edition; to Marc Brown for his part in the algorithm visualization research that was the genesis of so many of the figures in the book; to Dave Hanson for his willingness to answer all of my questions about C; and to Kevin Wayne, for patiently answering my basic questions about networks. I would also like to thank the many readers who have provided me with detailed comments about various editions, including Guy Almes, Jon Bentley, Marc Brown, Jay Gischer, Allan Heydon, Kennedy Lemke, Udi Manber, Dana Richards, John Reif, M. Rosenfeld, Stephen Seidman, Michael Quinn, and William Ward.

To produce this new edition, I have had the pleasure of working with Peter Gordon and Helen Goldstein at Addison-Wesley, who have patiently shepherded this project as it has evolved from a standard update to a massive rewrite. It has also been my pleasure to work with several other members of the professional staff at Addison-Wesley. The nature of this project made the book a somewhat unusual challenge for many of them, and I much appreciate their forbearance.

I have gained two new mentors in writing this book, and particularly want to express my appreciation to them. First, Steve Summit carefully checked early versions of the manuscript on a technical level, and provided me with literally thousands of detailed comments, particularly on the programs. Steve clearly understood my goal of providing elegant, efficient, and effective implementations, and his comments not only helped me to provide a measure of consistency across the implementations, but also helped me to improve many of them substantially. Second, Lyn Dupre also provided me with thousands of detailed comments on the manuscript, which were invaluable in helping me not only to correct and avoid grammatical errors, but also--more important—to find a consistent and coherent writing style that helps bind together the daunting mass of technical material here. I am extremely grateful for the opportunity to learn from Steve and Lyn—their input was vital in the development of this book.

Much of what I have written here I have learned from the teaching and writings of Don Knuth, my advisor at Stanford. Although Don had no direct influence on this work, his presence may be felt in the book, for it was he who put the study of algorithms on the scientific footing that makes a work such as this possible. My friend and colleague Philippe Flajolet, who has been a major force in the development of the analysis of algorithms as a mature research area, has had a similar influence on this work.

I am deeply thankful for the support of Princeton University, Brown University, and the Institut National de Recherce en Informatique et Automatique (INRIA), where I did most of the work on the books; and of the Institute for Defense Analyses and the Xerox Palo Alto Research Center, where I did some work on the books while visiting. Many parts of these books are dependent on research that has been generously supported by the National Science Foundation and the Office of Naval Research. Finally, I thank Bill Bowen, Aaron Lemonick, and Neil Rudenstine for their support in building an academic environment at Princeton in which I was able to prepare this book, despite my numerous other responsibilities. ...

Robert Sedgewick

Marly-le-Roi, France, February, 1983

Princeton, New Jersey, January, 1990

Jamestown, Rhode Island, May, 2001

算法:c语言实现(第5部分)图算法 源代码,(赠品)算法:C语言实现(第5部分):图算法(英文影印版·第3版)...相关推荐

  1. 数据结构源码笔记(C语言):B树的相关运算算法

    //B树的相关运算算法#include<stdio.h> #include<malloc.h>#define MAXM 10//定义B树最大的阶数 typedef int Ke ...

  2. Interview:算法岗位面试—10.11下午—上海某公司算法岗位(偏数据分析,证券金融行业)技术面试考点之sqlserver语言相关考察点复习

    Interview:算法岗位面试-10.11下午-上海某公司算法岗位(偏数据分析,证券金融行业)技术面试考点之sqlserver语言相关考察点复习 导读:其实,考察的知识点,博主都做过, 还包括sql ...

  3. C语言通过链表指针删除链表节点的算法(附完整源码)

    C语言通过链表指针删除链表节点的算法 C语言通过链表指针删除链表节点的算法完整源码(定义,实现,main函数测试) C语言通过链表指针删除链表节点的算法完整源码(定义,实现,main函数测试) #in ...

  4. C语言Huffman Encode霍夫曼编码的算法(附完整源码)

    C语言Huffman Encode霍夫曼编码的算法 C语言Huffman Encode霍夫曼编码的算法完整源码(定义,实现,main函数测试) C语言Huffman Encode霍夫曼编码的算法完整源 ...

  5. C语言检查列表是否是回文的算法(附完整源码)

    C语言检查列表是否是回文的算法 C语言检查列表是否是回文的算法完整源码(定义,实现,main函数测试) C语言检查列表是否是回文的算法完整源码(定义,实现,main函数测试) #include < ...

  6. C语言删除单链列表中间的节点的算法(附完整源码)

    C语言删除单链列表中间的节点的算法 C语言删除单链列表中间的节点的算法完整源码(定义,实现,main函数测试) C语言删除单链列表中间的节点的算法完整源码(定义,实现,main函数测试) #inclu ...

  7. C语言字符串中删除重复的字符的算法(附完整源码)

    C语言字符串中删除重复的字符的算法 C语言字符串中删除重复的字符的算法完整源码(定义,实现,main函数测试) C语言字符串中删除重复的字符的算法完整源码(定义,实现,main函数测试) #inclu ...

  8. C语言二个多项式的加法poly add算法(附完整源码)

    多项式的加法poly add算法 C语言二个多项式的加法poly add算法完整源码(定义,实现,main函数测试) C语言二个多项式的加法poly add算法完整源码(定义,实现,main函数测试) ...

  9. 语言的学习基础,100个经典的算法

    POJ上做做ACM的题 语言的学习基础,100个经典的算法 C语言的学习要从基础开始,这里是100个经典的算法-1C语言的学习要从基础开始,这里是100个经典的算法 题目:古典问题:有一对兔子,从出生 ...

最新文章

  1. 商贸通服装鞋帽版客户端无法连接服务器的问题(自己遇到的,已解决)
  2. 胡说八道之贝尔曼最优解
  3. 在ie7中overflow: hidden失效问题哦及解决方案
  4. SSL应用系列之二:为Web站点实现SSL加密访问
  5. android int与String的转换
  6. 微软出手,蚕食JetBrains系市场?
  7. FAT和EXFAT文件系统
  8. C# 网络爬虫 抓取“北京标准时间“ 网页请求
  9. yeta机器人_Yeta智能语音电话机器人开放平台接入指南(2)
  10. Netty实现群聊系统
  11. 中心极限定理 - 正态分布
  12. 教你使用反格式化工具恢复格式化数据!
  13. 最小的 中文 linux,麻雀虽小五脏俱全 最小Linux系统试用
  14. android拦截所有短信源码,拦截垃圾短信咱可别手软 安卓和苹果系统手机处理方法不同...
  15. 信息安全体系建设☞开源入侵检测系统HIDS
  16. APP STORE又崩了?可以通过DNS解决!
  17. JAVA学习第21天; 聚合 aggregation
  18. c语言read有什么作用,c语言read函数读到什么结束
  19. c++数独游戏3.1
  20. Android 屏幕保护程序制作及源码

热门文章

  1. VS搭建python开发环境
  2. oppoA92s刷机教程_强制卡刷官方系统方法
  3. 吉里吉里2相关的一些引用资料
  4. iwatch怎么用计算机,iWatch爱看评测 操作与功能
  5. Zotero使用:2023届重庆邮电大学硕士论文参考文献格式。
  6. 通信工程专业综合课程设计matlab,【(软件类)综合课程设计模版】 课程设计模板...
  7. A.Orac and Factors
  8. python 垂直搜索引擎_最火的 Python 到底牛在哪?就业薪资高吗?
  9. python 百度识图_python截图+百度ocr(图片识别)+ 百度翻译
  10. c语言用单链表实现lru算法,手写单链表实现和LRU算法模拟