📄 page575.html
字号:
<HTML><HEAD><TITLE>Minimum-Cost Spanning Trees</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="tex2html7765" HREF="page576.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7763" HREF="page573.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7759" HREF="page574.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html7767" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION0016502000000000000000">Minimum-Cost Spanning Trees</A></H3><P>The total <em>cost</em> of an edge-weighted undirected graph issimply the sum of the weights on all the edges in that graph.A minimum-cost spanning tree of a graph isa spanning tree of that graph that has the least total cost:<P><BLOCKQUOTE> <b>Definition (Minimal Spanning Tree)</b><A NAME="defngraphsminspantree"> </A>Consider an <em>edge-weighted</em>,undirected, connected graph <IMG WIDTH=73 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70549" SRC="img2166.gif" >,where <I>C</I>(<I>v</I>,<I>w</I>) represents the weight on edge <IMG WIDTH=70 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline70807" SRC="img2222.gif" >.The <em>minimum spanning tree</em><A NAME=52511> </A><A NAME=52512> </A> of <I>G</I>is the spanning tree <IMG WIDTH=77 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline72035" SRC="img2411.gif" >that has the smallest total cost,<P> <IMG WIDTH=305 HEIGHT=38 ALIGN=BOTTOM ALT="displaymath72135" SRC="img2422.gif" ><P></BLOCKQUOTE><P>Figure <A HREF="page575.html#figgraph16"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> shows edge-weighted graph <IMG WIDTH=25 HEIGHT=23 ALIGN=MIDDLE ALT="tex2html_wrap_inline72147" SRC="img2423.gif" >together with its minimum-cost spanning tree <IMG WIDTH=22 HEIGHT=22 ALIGN=MIDDLE ALT="tex2html_wrap_inline72149" SRC="img2424.gif" >.In general, it is possible for a graph to have several differentminimum-cost spanning trees.However, in this case there is only one.<P><P><A NAME="52869"> </A><A NAME="figgraph16"> </A> <IMG WIDTH=575 HEIGHT=181 ALIGN=BOTTOM ALT="figure52518" SRC="img2425.gif" ><BR><STRONG>Figure:</STRONG> An edge-weighted, undirected graph and a minimum-cost spanning tree.<BR><P><P>The two sections that followpresent two different algorithmsfor finding the minimum-cost spanning tree.Both algorithms are similar in that they build the tree one edge at a time.<P><HR><A NAME="tex2html7765" HREF="page576.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html7763" HREF="page573.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html7759" HREF="page574.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html7767" 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 © 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -