Graphs & Trees

合集下载

1-2图的概念和术语

1-2图的概念和术语

7/21/2013 8:48 AM
19
Havel定理(证明,续)
证明: () 设d可简单图化为G=<V,E>, 其中V={v1,v2,…,vn}, d(v1)d(v2)…d(vn). (1) 若NG(v1)={v2,v3, …,vd1+1}, 则令 G’=<V’,E’>, V’=V-{v1}, E’=E-{ (v1,v2), (v1,v3), …, (v1,vd1+1) }, 于是d’可简单图化为G’. (2) 若ij( i<j viNG(v1) vjNG(v1) ),
3
2,2
1,2 (d+,d-)
9
握手定理



定理1:设G=<V,E>是无向图, V={v1,v2,…,vn}, |E|=m, 则 d(v1)+d(v2)+…+d(vn)=2m. # 定理2:设D=<V,E>是有向图, V={v1,v2,…,vn}, |E|=m, 则 d+(v1)+d+(v2)+…+d+(vn) = d-(v1)+d-(v2) +…+d-(vn) = m. # 推论:任何图中,奇数度顶点的个数是偶数. #
v2
vi
d = (d1,
d2,
d3,
……
vn vj dd1+1, dd1+2, …… dn) vd1+1 vk
21
7/21/2013 8:48 AM
Havel定理(证明,续)
证明: () (2)若ij(1i<jnviNG(v1)vjNG(v1)), 则由didj可得 k(1knvkNG(vj)vkNG(vi)), 令G1=<V,E{(v1,vi),(vk,vj)}{(v1,vj),(vk,vi)}>, 则G1与G的度数列都还是d,重复这个步骤, 直到化为(1)中情形为止. #

7.1 Graphs Basics

7.1 Graphs Basics
A graph where edges are directed
Directed vs. Undirected Graph
An undirected graph is one in which the pair of vertices in a edge is unordered, (v0, v1) = (v1,v0) A directed graph is one in which each edge is a directed pair of vertices, <v0, v1> != <v1,v0>
1 0 0 1 0 0 0 0
1 0 0 1 0 0 0 0
0 1 1 0 0 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0
0 0 0 0 0 1 0 1
0 0 0 0 0 0 1 0
G4
Merits of Adjacency Matrix
a c
d
b
V= {a,b,c,d,e}
E= {(a,b),(a,c),(a,d), (b,e),(c,d),(c,e), (d,e)}
e
Applications
electronic circuits
CS16
networks (roads, flights, communications)
JFK LAX HNL DFW FTL STL
0 1 3 0 1 2 3 0 1 2 1 0 0 0 1 0 G3 2
2
0 1 3 5
4 6
7
2 2 1 1
G1 2
3 3 3 2
0
1
2
0 1 2 3 4 5 6 7

DS-graph(英文)

DS-graph(英文)

2/7
2 Representation of Graphs
Adjacency Matrix adj_mat [ n ] [ n ] is defined for G(V, E) with n vertices, n 1 :
1 if (v i , v j ) or v i , v j E (G ) adj_mat [i ][ j ] 0 otherwise Note: If G is undirected, then adj_mat[ ][ ] is symmetric. Thus we can save space by storing only half of the matrix.
1 Definitions of Graphs
Graph:A set of vertices and edges. G( V, E ) where G ::= graph, V = V( G ) ::= finite nonempty set of vertices, and E = E( G ) ::= finite set of edges. Two types of graph: Undirected graph: ( vi , vj ) = ( vj , vi ) ::= the same edge. Directed graph (digraph): < vi , vj > :: < vj , vi > vi vi vj vi
a b
d c
vexs a b c d
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
Adjacenห้องสมุดไป่ตู้y matrix
if the graph has a lot of vertices but very few edges, using a matrix is still waste space.

Functions & Graphs

Functions & Graphs

Exponential Functions (with base e)
written in the form with base e as follows
f x e kx
All exponential functions can be
where e is the irrational number 2.7182818… and k is a constant.
Logarithmic Functions (with base e)
written in the form with base e as follows f x k ln x where ln x log e x and k is a constant.
All logarithmic functions can be
the range of f.
Vertical-Line Test A curve in the xy-plane is the graph of a function y f x
if and only if each vertical line intersects it in at most one point.
x, f x
of real number. This gives exactly one
ordered pair for each x in A. (The condition that there must be one and only one number f x in B corresponding to each number x in A translates into the requirement that no two ordered pairs have the same first member.)

How to write graphs

How to write graphs
How to Write Graphs and Charts?
General
Intoduction
Graphs,charts,pies and tables are ways to organize
and arrange data, and they are used to make facts clearer and more understandable. Charts are drawings that dispaly the relaitive sizes of numerical quantities.
pie chart
STYLE
It provides a clear summary record of a collection of data. It is a very common way of putting information across to people.
table
STYLE
Text Section
equal values.
The purchases of televisions went up on1996 and continued to rise steadily until 1998 when they dropped slightly.
Bar graph 1
If one axis gives a time scale, your report
Text Writing Guidelings
Grammar and vocabulary
use correct grammar include a variety of sentence structures include a range of contextually appropriate vocabulary

SPSS使用教程-手把手教你精通SPSS

SPSS使用教程-手把手教你精通SPSS
功率选入y轴,均值为其汇总函数,汽缸数 和产地分别选入x轴和style框。
线图:在点图的基础上点击dots and lines 选项卡,显示线,并选择一种连接方法。或者 用lines菜单,变量定义方式不变,从dots and lines选项卡上选择显示dots和连接方式。
垂线图:方法一在线图的基础上继续编辑,
项。
利用汽车数据分析功率的频数分布。
二维直方图:单击Graphs- Interactive- histogram菜单,选择功率 作为X轴变量,选择count作为Y轴变量, 选择normal curve复选框。
累计直方图:在上图的基础上,在
assign variables 中选择cumulative histogram选项。
“Direction”选择误差条的方向,在正负两个方向、 只在正向、只在负向和只在外侧四个选项中选择。
(4)单击“Titles”选项卡,打开的窗口主要是定 义图形的标题、脚注等。
“Chart Title”统计图的标题 “Chart Subtitle”统计图的描述,即副标题 “Caption”统计图的脚注 (5)单击“Options”选项卡,打开的窗口主要是 定义SPSS进行绘图运算的一些参数,比如改变 分类轴的排序、Y轴的范围、选择喜欢的图形 模板、坐标轴的长短等。
“Bars Represent”选项是定义Y轴变量的哪种 统计结果,如果Y轴用了定距变量则会出现下拉 列表用于指明所代表的指标类型。
“Display Key”选项指是否在结果中指明Y轴 所代表的汇总指标名称。
(2)单击“Bar Chart Options”选项卡打 开的窗口中,主要用于设置直条的形状
等指标。
“Bar Shape”子选项是定义图形的形 状;

chapter11 graphs

chapter11 graphs

Part 3: How to write different kinds of graphs
Line charts Pie charts Bar charts
线状图主体段写法
第一句:描述曲线的总体趋势 第二句:从起点开始描述 第三句以后:拐点(breaking point; knee point),最高点(peak),最低点(trough),终 点,变化趋势必须交代清楚,不必交代所有 数据
P2
The number of people using trains at first rose from just under 20% in 1960 to about 26% in 1980, but then fell back to about 23% in 2000.
P3
Use of the tube was relatively stable, falling from around 27% of commuters in 1960 to 22% in 1980, but climbing back to reach 25% by 2000.
3.结论部分
再次用一句话概括和总结图表,和引言部分 的第二句话很相似,但更加具体(不含数 据)。 In conclusion we can see there were more complaints about the products and services in 1997 than in 1994 with the only exception of clothing.
Part 2: How to describe a graph?
1. Study the instructions and the graphs carefully, including the title, legend, the bars or lines, find out what they represent respectively and the main figures.

第八章BusinessGraphsppt课件

第八章BusinessGraphsppt课件
AutoMod
圖型型態及圖型定義說明(8/9)
PieChart及DataWatch PieChart及DataWatch的部份:當使用者選擇這兩項統計圖種
類後就不再設定其它項目,系統就會自統產生此兩項統計 圖。
PieChart
DataWatch
AutoMod
圖型型態及圖型定義說明(9/9)
File
AutoMod
使用Business Graphs(2/3)
由模擬模式中啟動Business Graphs
AutoMod
使用Business Graphs(3/3)
由Run Control中設定以啟動Business Graphs
AutoMod
範例練習一(1/7)
此範例定義了所有的貨品都必須經過兩個處理步驟,分別為 P_checkers及P_processors最後再離開系統。詳細程式設計如下所示:
AutoMod
第一節 Businessห้องสมุดไป่ตู้Graphs基本功能介紹
統計圖種類 Business Graphs視窗 Business Graphs圖型型態及圖型定義說明 Business Graph統計項目說明 建構一個Business Graphs 使用Business Graphs
AutoMod
end begin P_processors arriving
move into Q_processors use R_processors for u 30,5 min send to die end
AutoMod
範例練習一(3/7)
模式建構完成後,我們將利用Business Graphs去 統計,模擬期間Q_checkers及Q_processors中Load數 的變化。 步驟一:開啟Business Graphs。 步驟二:新增一個Graph。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

3. Graphs and Trees3.1Introduction3.2 What is a graph3.3 Definitions3.3.1 The Definition of a Graph3.3.2 Connected and Disconnected Graphs3.3.3 Complete graph3.4 The Handshaking Lemma3.5 Matrix Representations of Graphs3.5.1 Matrices and Undirected Graphs3.5.2 Matrices and Directed Graphs3.6 Applications of Graphs3.6.1Social Sciences3.6.2Chemistry3.6.3Circulation Diagram3.7 Paths and Circuits3.7.1 Definitions3.7.2 Theorem 3.1 (Counting Walks of Length N)3.7.3 The Shortest Path Algorithm3.8 Eulerian Graphs3.8.1 Definition3.8.2 Theorem 3.23.8.4 Königsberg Bridges Problem3.8.5 Fleury’s Algorithm3.9 Hamiltonian Graphs3.9.1 Definition3.9.2 Theorem 3.3 (DIRAC’S THEOREM)3.9.3 Theorem 3.4 (ORE’S THEOREM)3.10 Trees3.10.1 Definition3.10.2 Properties of Tree3.10.3 Alternative Definitions of the Tree3.10.4 Spanning Trees3.11 Minimum Spanning Tree3.11.1 Definition3.11.2 Greedy Algorithm3.12 References3.12.1 Discrete Mathematics and Its Applications, Kenneth H. Rosen, McGraw-HillSince many situations and structures give rise to graphs, graph theory becomes an important mathematical tool in a wide variety of subjects, ranging from operations research, computing science and linguistics to chemistry and genetics.Recently, there has been considerable interest in tree structures arising in the computer science and artificial intelligence. We often organize data in a computer memory store or the flow of information through a system in tree structure form. Indeed, many computer operating systems are designed to be tree structures.3.2What is a GraphLet us consider Figures 3.1 and 3.2 which depict, respectively, part of an electrical network and part of a road map.It is clear that either of them can be represented diagrammatically by means of points and lines in Figure 3.3. The points P, Q, R, S and T are called verticesand the lines are called edges ; the whole diagram is called a graph .R Figure 3.1 Figure 3.2RS T R Figure 3.33.3.1 The Definition of a GraphAn undirected graph G consists of a non-empty set of elements, called vertices , and a set of edges , where each edge is associated with a list of unordered pairs of either one or two vertices called its endpoints . The correspondence from edges to end-points is called the edge-endpoint function . The set of vertices of the graph G is called-set of vertex-set of G, denoted by V(G), and the set of edges is called the edge-set of G, denoted by E(G).Example 3.1Figure 3.4 represents the simple undirected graph Gwhose vertex-set V(G) = {u, v, w, z}edge-set E(G) = {e 1, e 2, e 3, e 4} edge-endpoint functionandG = {V(G), E(G)}= {{u, v, w, z}, {e 1, e 2, e 3, e 4}}A directed graph G consists of vertices, and a set of edges, where each edge is associated with a list of ordered pair endpoints.Example 3.2Figure 3.5 represents the directed graph G whose vertex-set V(G) = {u, v, w, z} edge-set E(G) = {e 1, e 2, e 3, e 4}and edge-endpoint function;Figure 3.5Figure 3.4Two or more edges joining the same pair of vertices are called multiple edges and an edge joining a vertex to itself is called a loop . A graph with no loops or multiple edges is called a simple graph .The degree of a vertex v is the number of edges meeting at a given vertex, and is denoted by deg v. Each loop contributes 2 to the degree of the corresponding vertex. The total degree of G is the sum of the degrees of all the vertices of G.Example 3.3Figure 3.6 illustrates these definitions.V(G) = {u, v, w, z}E(G) = {e 1, e 2, e 3, e 4, e 5, e 6, e 7}deg u = 6, deg v = 5, deg w = 2, deg z = 1total degree = 6 + 5 + 2 + 1 = 14edge-endpoint function:Two vertices v and w of a graph G are said to be adjacent if there is an edge joining them; the vertices v andw are then said to be incident to such an edge. Similarly, two distinct edges of G are adjacent if they have at least one vertex in common.3.3.2 Connected and Disconnected GraphsA graph G isconnected if there is a path in G between any given pair of vertices, and disconnected otherwise.Every disconnected graph can be split up into a number of connected subgraphs, called components . Example 3.4Figure 3.6Connected GraphDisconnectedGraphFigure 3.73.3.3 Complete graphA complete graph on n vertices , denoted K n , is a simple graph with n vertices v 1, v 2, ……v n whose set of edges contains exactly one edge for each pair of distinct vertices.Example 3.5Furthermore, the graph K n is regular of degree n - 1, and has ()121-n n edges.3.4The Handshaking LemmaIn any graph, the sum of all the vertex-degrees is equal to twice the number of edges.As the consequences of the Handshaking Lemma, the sum of all the vertex-degrees is an even number and the number of vertices of odd degree is even .In Figure3.6,the number of edges = 7the sum of all the vertex-degrees = 6 + 5 + 2 + 1 = 14 (even) = 2 ⨯ 7= twice the number of edgesthe number of odd degree = 2 (even)K 2 K 3 K 4 K 5 V 1 V 2 V 1 V 3 V 2V 4 V 45 Figure 3.83.5Matrix Representations of GraphsA given graph can be specified and stored in matrix format. The adjacency matrix and the incidence matrix are often used in practice.3.5.1 Matrices and Undirected GraphsThe Adjacency Matrix A(G) is the n ⨯ n matrix in which the entry in row i and column j is the number of edges joining the vertices i and j.Example 3.6The Incidence Matrix I(G) is the n ⨯ m matrix in which the entry in row i and column j is 1 if vertex i is incident with edges j, and 0 otherwise.Example 3.73.5.2 Matrices and Directed GraphsExample 3.8⎪⎪⎪⎪⎪⎭⎫ ⎝⎛0122101021012010v 1 v 2 v 3 v 4 v 1v 2v 3 v 4A(G) = v 3 v 4 Figure 3.9 ⎪⎪⎪⎪⎪⎭⎫ ⎝⎛1111100000011011000110011001 e 1 e 2 e 3 e 4 e 5 e 6 e 7 I(G) = v 1v 2 v 3v4 v 34e 2 3e 4Figure 3.10 ⎪⎪⎪⎭⎫ ⎝⎛100201010v 1 v 2 v 3 v 1v 2 v 3 A(G) = ⎪⎪⎪⎭⎫ ⎝⎛--++-++-2110111100011e 1 e 2 e 3 e 4 e 5 I(G) =v 1v 2v3V 2e 15 Figure 3.113.6 Applications of Graphs3.6.1 Social SciencesGraphs have been used extensively to represent interpersonal (international) relationships. The vertices correspond to individuals in a group (nations), and the edges join pairs of individuals who are related in some way; such as likes, hates, agrees with, avoids, communicates, etc.(allied, maintain diplomatic relations, agree on a particular strategy, etc)Consider the following signed graph (Figure 3.12), which shows the working relationships with four employees. The graph with either + or - associated with each edge, indicating a positive relationship (likes) or a negative one (dislikes). There are no strong feelings about each other for no connection.Now consider the following diagrams, which illustrate some of the situations that can occur when three people work together.In the first case, all three get on well. In the second case, Jack and Jill get on well and both dislike John; the result is that John works on his own. In the third case, Mary would like to work with both John and Jill, but Jack and Jill do not wish to work together; in this case, no suitable working arrangement can be found and there is tension.Figure 3.12Peter Mary JillJill Jill Figure 3.133.6.2 ChemistryChemical molecule can be represented as a graph whose vertices correspond to the atoms and whose edges correspond to the chemical bonds connecting them.3.6.3 Circulation diagramGraphs are used to analyze the movements of people in large buildings. In particular, they have been used in the designing of airports, and in planning the layout of supermarkets.C C C C H H H H HH H H H Carbon-graph 2-methylpropne C C C C CC H H H H HBenzeneCarbon-graphFigure 3.15 Architectural Floor PlanFigure 3.16 Circulation diagramFigure 3.143.7 Paths and Circuits3.7.1 DefinitionsA walk of length 7 between v 1 and v 8 in agraph G is a succession of 7 edges of G of theform v 1e 1v 2, v 2e 2v 3, v 3e 3v 4, … ,v 7e 7v 8. We denote this walk by v 1e 1v 2e 2v 3e 3v 4e 4v 5e 5v 6e 6v 7e 7v 8.A closed walk is a walk that starts and ends at the same vertex. For example, in the following graphI f all the edges (but not necessarily all the vertices) of a walk are different, then the walk is called a path . If , in addition, all the vertices are different, then the trail is called simple path . A closed path is called a circuit . A simple circuit is a circuit that does not have any other repeated vertex except the first and last.Example 3.9 In Figure 3.19, v 1 v 2 v 4 v 1 v 3 v 5 is a path, v 1 v 2 v 4 v 3 v 5 is a simple path, v 1 v 2 v 4 v 3 v 5 v 4 v 1 is a circuit and v 1 v 2 v 4 v 5 v 3 v 1 is a simple circuit.v 1e 4v 4e 5v 2e 1v 1e 3v 3e 7v 5 is a walk of length 5 between v 1and v 5. v 1 v v 5 v 4 v2 path v 1 v v 5 v 4 v2 simple path v 5 4v 2circuitv v 54 v 2 Figure 3.18 e 5v v 5 4v 2simple circuitFigure 3.195Figure 3.17For ease of reference, these definitions are summarized in the following table:3.7.2 Counting Walks of Length NTheorem 3.1If G is a graph with vertices v 1, v 2, …… v m and A(G) is the adjacency matrix of G, then for each positive integer n, the ij th entry of A n = the number of walks of length n from v i to v j .Example 3.10 Consider the following graph G.The adjacency matrix A(G) is⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=02211010A Then⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=422261211A 2Therefore,one walk of length 2 connecting v 1 to v 1; (v 1e 1v 2e 1v 1)one walk of length 2 connecting v 1 to v 2; (v 1e 1v 2e 2v 2)two walks of length 2 connecting v 1 to v 3; (v 1e 1v 2e 3v 3, v 1e 1v 2e 4v 3)six walks of length 2 connecting v 2 to v 2;(v 2e 1v 1e 1v 2, v 2e 2v 2e 2v 2, v 2e 3v 3e 3v 2, v 2e 3v 3e 4v 2, v 2e 4v 3e 4v 2, v 2e 4v 3e 3v 2) two walks of length 2 connecting v 2 to v 3; (v 2e 2v 2e 3v 3, v 2e 2v 2e 4v 3)four walks of length 2 connecting v 3 to v 3. (v 3e 3v 2e 3v 3, v 3e 3v 2e 4v 3, v 3e 4v 2e 4v 3, v 3e 4v 2e 3v 3) v 2 3 4 Figure 3.203.7.3 The Shortest Path AlgorithmThe objective of this algorithm is to find the shortest path from vertex S to vertex T in a given network. We demonstrate the steps of the algorithm by finding theshortest distance from S to T in the following network:Figure 3.21Step 1 Initialization☐Assign to vertex S potential 0.☐Label each vertex V reached directly from S with distance from Sto V.☐Choose the smallest of these labels, and make it the potential of thecorresponding vertex or vertices.Step 2 General StepConsider the vertex or vertices just assigned a potential;☐for each vertex V, look at each vertex W reached directly from V and assign W the label(potential of V) + (distance from V to W).unless W already has a smaller label.☐Choose the smallest of these labels, and make it the potential of the corresponding vertex or vertices.☐Repeat the general step with the new potential.TFigure 3.23b11Figure 3.23cSTEP 3 Stop☐When vertex T has been assigned a potential; this is the shortest distance from S to T.STEP 4 Conclusion☐ Therefore, the shortest path from S to T is SBCT with pathlength 10.T 10T 10Figure 3.23dFigure 3.23e3.8 Eulerian Graphs3.8.1 DefinitionA connected graph G is Eulerian if there is a closed path which includes everyedge of G; such path is called an Eulerian path.3.8.2 Theorem 3.2Let G be a connected graph. Then G is Eulerian if and only if every vertex of G has even degree.For example, since K4graph has odd degree vertices (deg 3), K4graph is not Eulerian. However all the vertices of K5 are even (deg 4). Therefore by theorem3.2, it is Eulerian.Example 3.12Consider the following four graphsWhich graph(s) is/are Eulerian?Answer: Graph (a) and (b) are Eulerian.rFigure 3.24 Eulerian graphFigure 3.253.8.3 K önigsberg bridges problemThe four parts (A, B, C and D) of the city K önigsberg were interconnected by seven bridges (p, q, r, s, t, u and v) as shown in the following diagram. Is it possible to find a route crossing each bridge exactly once ?We can express the K önigsberg bridges problem in terms of a graph by taking the four land areas as vertices and the seven bridges as edges joining the corresponding pairs of vertices.By theorem 3.2, it is not a Eulerian graph. It follows that there is no route of the desired kind crossing the seven bridges of K önigsberg.Figure 3.26 K önigsberg mapB D r Figure 3.273.8.4 Fleury’s AlgorithmIf G is an Eulerian graph, then the following steps can always be carried out, and produce an Eulerian path in G:STEP 1 Choose a starting vertex u. STEP 2 At each stage, traverse any available edge, choosing a bridge onlyif there is no alternative.STEP 3 After traversing each edge, erase it ( erasing any vertices of degree0 which result), and then choose another available edge.STEP 4 STOP when there are no more edges.Example 3.13 Find the Eulerian path of the following graph.Starting at vertex u, we may choose the edge ua , followed by ab . Erasing theseedges and the vertex a give us graph (a).(a)We have to traverse the bridge bu . Traversing the cycle uefu completes the Eulerian path (see graph (c)). The path is therefore uabcdbuefu.(c) We cannot use the edge bu since it is a bridge, so we choose the edge bc , followed by cd and db . Erasing these edges and the vertices c and d give usgraph (b)(b)Figure 3.28 Figure 3.293.9 Hamiltonian Graphs3.9.1 DefinitionA connected graph G is Hamiltonian if there is a cycle which includes every vertex of G ; such a cycle is called a Hamiltonian cycle.3.9.2 Theorem 3.3 (DIRAC’S THEOREM)Let G be a simple graph with n vertices, where n ≥ 3. If deg v ≥ 21n for each vertex v , then G is Hamiltonian.Example 3.14For the above graph, n = 6 and deg v = 3 for each vertex v , so this graph is Hamitonian by Dirac’s theorem.Figure 3.30 Hamiltonian Graph Figure 3.31 HamiltonianCycle Figure 3.323.9.3 Theorem 3.4 (ORE’S THEOREM)Let G be a simple graph with n vertices, where n ≥ 3.deg v + deg w≥ n,for each pair of non-adjacent vertices v and w, then G is Hamiltonian.Example 3.15Figure 3.33For figure 3.33, n = 5 but deg u= 2, so Dirac’s theorem does not apply. However, deg v + deg w≥ 5 for all pairs of non-adjacent vertices v and w, so this graph is Hamiltonian by Ore’s theorem.3.10 Trees3.10.1 DefinitionA tree is a connected graph which contains no cycles.Example 3.163.10.2 Properties of Tree1Every tree with n vertices has exactly n 1 edges.2Any two vertices in a tree are connected by exactly one path.3Each edge of a tree is a bridge.Note that if an edge is removed in a connect graph, the graph is no longer connected, this edge is called a bridge.3.10.3 Alternative definitions of the tree☐ A tree is connected and has n - 1 edges.☐ A tree has n - 1 edges and contains no cycles.☐ A tree is connected and each edge is a bridge.☐ Any two vertices of a tree are connected by exactly one path.☐ A tree contains on cycles, but the addition of any new edges creates exactlyone cycle.3.10.4 Spanning TreesDefinition:Let G be a connected graph. A spanning tree in G is a subgraph of G that includes all the vertices of G and is also a tree. The edges of the tree are called branches .Example 3.17A graph GSpanning Treesxxxx Figure 3.343.11 Minimum Spanning Tree3.11.1 DefinitionLet T be a spanning tree of minimum total weight in a connected weighted graph G. Then T is a minimum spanning tree of G.3.11.2 Greedy AlgorithmExample 3.18Iteration 1 (Choose an edge of minimum weight)Iteration 2 (Select the vertex from unconnected set {A,B,C} that is closest toconnected set {D,E})A AAFigure 3.36Figure 3.37a Figure 3.37bIteration 3 (Select the vertex from unconnected set {A,C} that is closest to connected set {B,D,E,})Iteration 4 (Select the vertex from unconnected set {C} that is closest toconnected set {A,B,D,E})Therefore, the minimum spanning tree is with weight 18.3.12 References3.12.1 Discrete Mathematics and Its Applications, Kenneth H. Rosen, McGraw-HillAAA Figure 3.37c Figure 3.37d Figure 3.37e。

相关文档
最新文档