page524.html

来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 38 行

HTML
38
字号
<HTML><HEAD><TITLE>Directed Acyclic Graphs</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html7195" HREF="page525.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7193" HREF="page520.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7187" HREF="page523.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html7197" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION0016104000000000000000">Directed Acyclic Graphs</A></H3><P>For certain applications it is convenient to deal withgraphs that contain no cycles.For example, a tree (see Chapter&nbsp;<A HREF="page251.html#chaptrees"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>)is a special kind of graph that contains no cycles.<P><BLOCKQUOTE> <b>Definition (Directed Acyclic Graph (DAG))</b><A NAME="defnDAG">&#160;</A><P>A <em>directed, acyclic graph</em><A NAME=48636>&#160;</A><A NAME=48637>&#160;</A><A NAME=48638>&#160;</A>is a directed graph that contains no cycles.</BLOCKQUOTE><P>Obviously, all trees are DAGs.However, not all DAGs are trees.For example consider the two directed, acyclic graphs, <IMG WIDTH=19 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline70767" SRC="img2213.gif"  > and  <IMG WIDTH=18 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline70769" SRC="img2214.gif"  >, shown in Figure&nbsp;<A HREF="page524.html#figgraph2"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.Clearly  <IMG WIDTH=19 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline70767" SRC="img2213.gif"  > is a tree but  <IMG WIDTH=18 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline70769" SRC="img2214.gif"  > is not.<P><P><A NAME="48774">&#160;</A><A NAME="figgraph2">&#160;</A> <IMG WIDTH=575 HEIGHT=181 ALIGN=BOTTOM ALT="figure48641" SRC="img2215.gif"  ><BR><STRONG>Figure:</STRONG> Two directed, acyclic graphs.<BR><P><HR><A NAME="tex2html7195" HREF="page525.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7193" HREF="page520.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7187" HREF="page523.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html7197" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright &#169; 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?