-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathStarGraph.html
230 lines (224 loc) · 11.3 KB
/
StarGraph.html
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html lang="en">
<head>
<title>StarGraph Enumeration Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/StarGraph" class="dashAnchor"></a>
<a title="StarGraph Enumeration Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftGraph 3.1 Docs</a> (73% documented)</p>
<p class="header-right"><a href="https://github.com/davecom/SwiftGraph"><img src="../img/gh.png"/>View on GitHub</a></p>
<p class="header-right">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftGraph Reference</a>
<img id="carat" src="../img/carat.png" />
StarGraph Enumeration Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/Queue.html">Queue</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Stack.html">Stack</a>
</li>
<li class="nav-group-task">
<a href="../Classes/UniqueElementsGraph.html">UniqueElementsGraph</a>
</li>
<li class="nav-group-task">
<a href="../Classes/UnweightedGraph.html">UnweightedGraph</a>
</li>
<li class="nav-group-task">
<a href="../Classes/WeightedGraph.html">WeightedGraph</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/CompleteGraph.html">CompleteGraph</a>
</li>
<li class="nav-group-task">
<a href="../Enums/StarGraph.html">StarGraph</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Functions.html#/s:10SwiftGraph25distanceArrayToVertexDict9distances5graphSDyxq_SgGSayAEG_AA08WeightedB0Cyxq_GtSeRzSERzSHRzSeR_SER_SQR_r0_lF">distanceArrayToVertexDict(distances:graph:)</a>
</li>
<li class="nav-group-task">
<a href="../Functions.html#/s:10SwiftGraph14pathDictToPath4from2to0cD0SayAA12WeightedEdgeVyxGGSi_SiSDySiAHGtSeRzSERzSQRzlF">pathDictToPath(from:to:pathDict:)</a>
</li>
<li class="nav-group-task">
<a href="../Functions.html#/s:10SwiftGraph14pathDictToPath4from2to0cD0SayAA4Edge_pGSi_SiSDySiAaF_pGtF">pathDictToPath(from:to:pathDict:)</a>
</li>
<li class="nav-group-task">
<a href="../Functions.html#/s:10SwiftGraph8printMST5edges5graphySayAA12WeightedEdgeVyq_GG_AA0gB0Cyxq_GtSeRzSERzSQRzSeR_SER_SjR_r0_lF">printMST(edges:graph:)</a>
</li>
<li class="nav-group-task">
<a href="../Functions.html#/s:10SwiftGraph11totalWeightyxSgSayAA12WeightedEdgeVyxGGSeRzSERzSjRzlF">totalWeight(_:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Edge.html">Edge</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/Graph.html">Graph</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/WeightedEdgeProtocol.html">WeightedEdgeProtocol</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/PriorityQueue.html">PriorityQueue</a>
</li>
<li class="nav-group-task">
<a href="../Structs/UnweightedEdge.html">UnweightedEdge</a>
</li>
<li class="nav-group-task">
<a href="../Structs/WeightedEdge.html">WeightedEdge</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Typealiases.html#/s:10SwiftGraph024UnweightedUniqueElementsB0a">UnweightedUniqueElementsGraph</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:10SwiftGraph022WeightedUniqueElementsB0a">WeightedUniqueElementsGraph</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>StarGraph</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">StarGraph</span><span class="o"><</span><span class="kt">V</span><span class="o">></span> <span class="k">where</span> <span class="kt">V</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">V</span> <span class="p">:</span> <span class="kt">Encodable</span><span class="p">,</span> <span class="kt">V</span> <span class="p">:</span> <span class="kt">Equatable</span></code></pre>
</div>
</div>
<p>A type used to construct an UnweightedGraph with vertices of type V that is isomorphic to a star graph.
<a href="https://en.wikipedia.org/wiki/Star_(graph_theory)">https://en.wikipedia.org/wiki/Star_(graph_theory)</a></p>
<div class="slightly-smaller">
<a href="https://github.com/davecom/SwiftGraph/tree/3.1/Sources/SwiftGraph/Constructors.swift#L21-L39">Show on GitHub</a>
</div>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:10SwiftGraph04StarB0O5build10withCenter8andLeafsAA010UnweightedB0CyxGx_SayxGtFZ"></a>
<a name="//apple_ref/swift/Method/build(withCenter:andLeafs:)" class="dashAnchor"></a>
<a class="token" href="#/s:10SwiftGraph04StarB0O5build10withCenter8andLeafsAA010UnweightedB0CyxGx_SayxGtFZ">build(withCenter:<wbr>andLeafs:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Constructs an undirected UnweightedGraph isomorphic to a star graph.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">build</span><span class="p">(</span><span class="n">withCenter</span> <span class="nv">center</span><span class="p">:</span> <span class="kt">V</span><span class="p">,</span> <span class="n">andLeafs</span> <span class="nv">leafs</span><span class="p">:</span> <span class="p">[</span><span class="kt">V</span><span class="p">])</span> <span class="o">-></span> <span class="kt"><a href="../Classes/UnweightedGraph.html">UnweightedGraph</a></span><span class="o"><</span><span class="kt">V</span><span class="o">></span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>center</em>
</code>
</td>
<td>
<div>
<p>The vertex that is connected to all vertices except itself.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>leafs</em>
</code>
</td>
<td>
<div>
<p>The set of vertices that are connected only to the center vertex.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An UnweightedGraph star graph with the center vertex connected to all the leafs. The leafs
are only connected to the center</p>
</div>
<div class="slightly-smaller">
<a href="https://github.com/davecom/SwiftGraph/tree/3.1/Sources/SwiftGraph/Constructors.swift#L30-L38">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2021 <a class="link" href="https://twitter.com/davekopec" target="_blank" rel="external">David</a>. All rights reserved. (Last updated: 2021-02-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>