page523.html

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

HTML
53
字号
<HTML><HEAD><TITLE>More Terminology</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="tex2html7184" HREF="page524.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7182" HREF="page520.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7176" HREF="page522.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html7186" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION0016103000000000000000">More Terminology</A></H3><P>Consider the path  <IMG WIDTH=137 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70709" SRC="img2199.gif"  >in a directed graph  <IMG WIDTH=73 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70549" SRC="img2166.gif"  >.<P><UL><LI>	Vertex  <IMG WIDTH=27 HEIGHT=15 ALIGN=MIDDLE ALT="tex2html_wrap_inline70713" SRC="img2200.gif"  > is the <em>successor</em><A NAME=48610>&#160;</A>	of vertex  <IMG WIDTH=12 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70715" SRC="img2201.gif"  > for  <IMG WIDTH=63 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline69881" SRC="img2128.gif"  >.	Each element  <IMG WIDTH=12 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70715" SRC="img2201.gif"  > of path <I>P</I> (except the last)	has a <em>successor</em>.<LI>	Vertex  <IMG WIDTH=27 HEIGHT=12 ALIGN=MIDDLE ALT="tex2html_wrap_inline70723" SRC="img2202.gif"  > is the <em>predecessor</em><A NAME=48614>&#160;</A>	of vertex  <IMG WIDTH=12 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70715" SRC="img2201.gif"  > for  <IMG WIDTH=63 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70727" SRC="img2203.gif"  >.	Each element  <IMG WIDTH=12 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70715" SRC="img2201.gif"  > of path <I>P</I> (except the first)	has a <em>predecessor</em>.<LI>	A path <I>P</I> is called a <em>simple</em> path if and only if	 <IMG WIDTH=47 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline70735" SRC="img2204.gif"  > for all <I>i</I> and <I>j</I> such that  <IMG WIDTH=92 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70741" SRC="img2205.gif"  >.	However, it <em>is</em> permissible for  <IMG WIDTH=13 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70743" SRC="img2206.gif"  > to be the same as  <IMG WIDTH=14 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70745" SRC="img2207.gif"  >	in a simple path.<LI>	A <em>cycle</em><A NAME=48619>&#160;</A> is a path <I>P</I>	of non-zero length in which  <IMG WIDTH=50 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline70749" SRC="img2208.gif"  >.	The <em>length of a cycle</em> is just the length of the path <I>P</I>.<LI>	A <em>loop</em><A NAME=48622>&#160;</A> is a cycle of length one.	That is, it is a path of the form  <IMG WIDTH=38 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70753" SRC="img2209.gif"  >.<LI>	A <em>simple cycle</em><A NAME=48624>&#160;</A><A NAME=48625>&#160;</A>	is a path that is both a <em>cycle</em> and <em>simple</em>.</UL><P>Referring again to graph  <IMG WIDTH=17 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline70643" SRC="img2182.gif"  > in Figure&nbsp;<A HREF="page521.html#figgraph1"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> we find that the path <IMG WIDTH=66 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline66495" SRC="img1536.gif"  > is a simple path of length three.Conversely, the path  <IMG WIDTH=66 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70759" SRC="img2210.gif"  > also has length threebut is not simple because vertex&nbsp;<I>c</I> occurs twice in the sequence(but not at the ends).The graph contains the path  <IMG WIDTH=66 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70763" SRC="img2211.gif"  > which is a cycle of length three,as well as  <IMG WIDTH=82 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70765" SRC="img2212.gif"  >, a cycle of length four.The former is a simple cycle but the latter is not.<P><HR><A NAME="tex2html7184" HREF="page524.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7182" HREF="page520.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7176" HREF="page522.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html7186" 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 + -
显示快捷键?