forked from klevasseur/ads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-to-9.3.xml
89 lines (88 loc) · 5.8 KB
/
add-to-9.3.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="UTF-8" ?>
<subsection xml:id="ss-ecc-rad-diameter"><title>Graph Measurements</title>
<p>If we were to perform a breadth first search from each vertex in a graph, we could proceed to determine several key measurements relating to the general connectivity of that graph. From each vertex <m>v</m>, the distance from <m>v</m> to any other vertex <m>w</m>, <m>d(v,w)</m>, is number of edges in the shortest path from <m>v</m> to <m>w</m>. This number is also the index of the depth set to which <m>w</m> belongs in a breath-first search starting at <m>v</m>.
<me>d(v,w) = i \LeftRightarrow w \in D_v(i)</me>
where <m>D_v</m> is the family of depth sets starting at <m>v</m>.</p>
<p>If the vector of <q>from-values</q> is known from the breath-first search, then the distance can be determined recursively as follows:
<me>d(v,v) =0</me>
<me>d(v,w) = 1 + d(v,w.from) \textrm{ if }w\neq v</me>
</p>
<example xml:id="e-computing-distances"><title>Computing Distances</title>
<figure xml:id="fig-compute-distance-graph">
<image width="100%" source="images/fig-compute-distance-graph.png">
<description>An undirected graph with 12 vertices having dictionary representation {1:[6,7,10],2:[7,9,12],3:[10],4:[6,8,10],5:[9,11],6:[7,11],7:[10,12],9:[11]}</description>
</image>
</figure>
<p>Consider <xref ref="fig-compute-distance-graph"/>. If we perform a breadth first search of this graph starting at vertex 2, for example, we get the following <q>from data</q> telling us from what vertex each vertex is reached.
<me>\begin{array}{ccccccccccccc}
\text{vertex} & 1 & 2 & 3 & 4 & 5 & 6
& 7 & 8 & 9 & 10 & 11 & 12 \\
\text{vertex.from} & 7 & 2 & 10 & 6 &
9 & 7 & 2 & 4 & 2 & 7 & 9 & 2 \\
\end{array}</me>
For example, <c>4.from</c> has a value of 6. We can compute <m>d(2,4)</m>:
<me>\begin{split}
d(2,4) &= 1+d(2,4.from) &= 1+d(2,6)\\
&=2+d(2,6.from)&=2+d(2,7)\\
&=3+d(2,7.from)&=3+d(2,2)\\
&=3
\end{split}</me>
</p>
</example>
<p>Once we know distances between any two vertices, we can determine the eccentricity of each vertex; and the graph's diameter, radius and center. First, we define these terms precisely.</p>
<dl xml:id="description-graph-measures" width="narrow">
<li>
<title>Eccentricity of a Vertex</title><idx>Eccentricity of a vertex</idx>
<notation><usage>e(v)</usage><description>The eccentricity of a vertex</description></notation>
<p>The the maximum distance from a vertex to all other vertices, <m>e(v)=max_{w}d(v,w)</m>.</p>
</li>
<li>
<title>Diameter of a Graph</title><idx>Diameter of a Graph</idx>
<notation><usage>d(G)</usage><description>The diameter of graph <m>G</m></description></notation>
<p>The maximum eccentricity of vertices in a graph</p>
</li>
<li>
<title>Diameter of a Graph</title><idx>Radius of a graph</idx>
<notation><usage>r(G)</usage><description>The radius of graph <m>G</m></description></notation>
<p>The color of shallow tropical waters.</p>
</li>
<li>
<title><m>Center of a Graph</m></title><idx>Center of a graph</idx>
<notation><usage>C(G)</usage><description>The center of graph <m>G</m></description></notation>
<p>The set of vertices with minimal eccentricity, <m>\{v\in V \mid e(v)=r(v)\}</m></p>
</li>
</dl>
<example xml:id="e-distance-matrix"><title>Measurements from distance matrices</title>
<p>If we compute all distances between vertices, we can summarize the results in a distance matrix, where the entry in row <m>i</m>, column <m>j</m> is the distance from vertex <m>i</m> to vertex <m>j</m>. For the graph in <xref ref="e-computing-distances"/>, that matrix is
<me>\left(
\begin{array}{cccccccccccc}
0 & 2 & 2 & 2 & 3 & 1 & 1 & 3 & 3 & 1
& 2 & 2 \\
2 & 0 & 3 & 3 & 2 & 2 & 1 & 4 & 1 & 2
& 2 & 1 \\
2 & 3 & 0 & 2 & 5 & 3 & 2 & 3 & 4 & 1
& 4 & 3 \\
2 & 3 & 2 & 0 & 3 & 1 & 2 & 1 & 3 & 1
& 2 & 3 \\
3 & 2 & 5 & 3 & 0 & 2 & 3 & 4 & 1 & 4
& 1 & 3 \\
1 & 2 & 3 & 1 & 2 & 0 & 1 & 2 & 2 & 2
& 1 & 2 \\
1 & 1 & 2 & 2 & 3 & 1 & 0 & 3 & 2 & 1
& 2 & 1 \\
3 & 4 & 3 & 1 & 4 & 2 & 3 & 0 & 4 & 2
& 3 & 4 \\
3 & 1 & 4 & 3 & 1 & 2 & 2 & 4 & 0 & 3
& 1 & 2 \\
1 & 2 & 1 & 1 & 4 & 2 & 1 & 2 & 3 & 0
& 3 & 2 \\
2 & 2 & 4 & 2 & 1 & 1 & 2 & 3 & 1 & 3
& 0 & 3 \\
2 & 1 & 3 & 3 & 3 & 2 & 1 & 4 & 2 & 2
& 3 & 0 \\
\end{array}
\right)
</me>
If we scan the matrix, we can see that the maximum distance is the distance between vertices 3 and 5, which is 5 and is the diameter of the graph. If focus on individual rows and identify the maximum values, which are the eccentricities, their minimum is 3, which the graph's radius. This eccentricity value is attained by vertices in the set <m>\{1, 4, 6, 7\}</m>, which is the center of the graph.</p>
</example>
</subsection>