comparison mayachemtools/docs/modules/html/PathsTraversal.html @ 0:73ae111cf86f draft

Uploaded
author deepakjadmin
date Wed, 20 Jan 2016 11:55:01 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:73ae111cf86f
1 <html>
2 <head>
3 <title>MayaChemTools:Documentation:Graph::PathsTraversal.pm</title>
4 <meta http-equiv="content-type" content="text/html;charset=utf-8">
5 <link rel="stylesheet" type="text/css" href="../../css/MayaChemTools.css">
6 </head>
7 <body leftmargin="20" rightmargin="20" topmargin="10" bottommargin="10">
8 <br/>
9 <center>
10 <a href="http://www.mayachemtools.org" title="MayaChemTools Home"><img src="../../images/MayaChemToolsLogo.gif" border="0" alt="MayaChemTools"></a>
11 </center>
12 <br/>
13 <div class="DocNav">
14 <table width="100%" border=0 cellpadding=0 cellspacing=2>
15 <tr align="left" valign="top"><td width="33%" align="left"><a href="./PathGraph.html" title="PathGraph.html">Previous</a>&nbsp;&nbsp;<a href="./index.html" title="Table of Contents">TOC</a>&nbsp;&nbsp;<a href="./Graph.html" title="Graph.html">Next</a></td><td width="34%" align="middle"><strong>Graph::PathsTraversal.pm</strong></td><td width="33%" align="right"><a href="././code/PathsTraversal.html" title="View source code">Code</a>&nbsp;|&nbsp;<a href="./../pdf/PathsTraversal.pdf" title="PDF US Letter Size">PDF</a>&nbsp;|&nbsp;<a href="./../pdfgreen/PathsTraversal.pdf" title="PDF US Letter Size with narrow margins: www.changethemargins.com">PDFGreen</a>&nbsp;|&nbsp;<a href="./../pdfa4/PathsTraversal.pdf" title="PDF A4 Size">PDFA4</a>&nbsp;|&nbsp;<a href="./../pdfa4green/PathsTraversal.pdf" title="PDF A4 Size with narrow margins: www.changethemargins.com">PDFA4Green</a></td></tr>
16 </table>
17 </div>
18 <p>
19 </p>
20 <h2>NAME</h2>
21 <p>PathsTraversal</p>
22 <p>
23 </p>
24 <h2>SYNOPSIS</h2>
25 <p>use Graph::PathsTraversal;</p>
26 <p>use Graph::PathsTraversal qw(:all);</p>
27 <p>
28 </p>
29 <h2>DESCRIPTION</h2>
30 <p><strong>PathsTraversal</strong> class provides the following methods:</p>
31 <p> <a href="#new">new</a>, <a href="#copy">Copy</a>, <a href="#getconnectedcomponentsvertices">GetConnectedComponentsVertices</a>, <a href="#getpaths">GetPaths</a>, <a href="#getvertices">GetVertices</a>
32 , <a href="#getverticesdepth">GetVerticesDepth</a>, <a href="#getverticesneighborhoods">GetVerticesNeighborhoods</a>
33 , <a href="#getverticesneighborhoodswithsuccessors">GetVerticesNeighborhoodsWithSuccessors</a>, <a href="#getverticespredecessors">GetVerticesPredecessors</a>, <a href="#getverticesroots">GetVerticesRoots</a>
34 , <a href="#performallpathssearch">PerformAllPathsSearch</a>, <a href="#performallpathssearchwithlength">PerformAllPathsSearchWithLength</a>
35 , <a href="#performallpathssearchwithlengthupto">PerformAllPathsSearchWithLengthUpto</a>, <a href="#performbreadthfirstsearch">PerformBreadthFirstSearch</a>
36 , <a href="#performbreadthfirstsearchwithlimit">PerformBreadthFirstSearchWithLimit</a>, <a href="#performdepthfirstsearch">PerformDepthFirstSearch</a>
37 , <a href="#performdepthfirstsearchwithlimit">PerformDepthFirstSearchWithLimit</a>, <a href="#performneighborhoodverticessearch">PerformNeighborhoodVerticesSearch</a>
38 , <a href="#performneighborhoodverticessearchwithradiusupto">PerformNeighborhoodVerticesSearchWithRadiusUpto</a>
39 , <a href="#performneighborhoodverticessearchwithsuccessors">PerformNeighborhoodVerticesSearchWithSuccessors</a>
40 , <a href="#performneighborhoodverticessearchwithsuccessorsandradiusupto">PerformNeighborhoodVerticesSearchWithSuccessorsAndRadiusUpto</a>, <a href="#performpathssearch">PerformPathsSearch</a>
41 , <a href="#performpathssearchbetween">PerformPathsSearchBetween</a>, <a href="#performpathssearchwithlength">PerformPathsSearchWithLength</a>
42 , <a href="#performpathssearchwithlengthupto">PerformPathsSearchWithLengthUpto</a>, <a href="#stringifypaths">StringifyPaths</a>, <a href="#stringifypathstraversal">StringifyPathsTraversal</a>
43 , <a href="#stringifyverticesdepth">StringifyVerticesDepth</a>, <a href="#stringifyverticesneighborhoods">StringifyVerticesNeighborhoods</a>
44 , <a href="#stringifyverticesneighborhoodswithsuccessors">StringifyVerticesNeighborhoodsWithSuccessors</a>, <a href="#stringifyverticespredecessors">StringifyVerticesPredecessors</a>
45 , <a href="#stringifyverticesroots">StringifyVerticesRoots</a>, <a href="#stringifyverticessuccessors">StringifyVerticesSuccessors</a>
46 </p><p>
47 </p>
48 <h2>METHODS</h2>
49 <dl>
50 <dt><strong><a name="new" class="item"><strong>new</strong></a></strong></dt>
51 <dd>
52 <div class="OptionsBox">
53 $PathsTraversal = new Graph::PathsTraversal($Graph);</div>
54 <p>Using specified <em>Graph</em>, <strong>new</strong> method creates a new <strong>PathsTraversal</strong> object and returns
55 newly created <strong>PathsTraversal</strong> object.</p>
56 </dd>
57 <dt><strong><a name="copy" class="item"><strong>Copy</strong></a></strong></dt>
58 <dd>
59 <div class="OptionsBox">
60 $PathsTraversal = $PathsTraversal-&gt;Copy();</div>
61 <p>Copies <em>PathsTraversal</em> and its associated data using <strong>Storable::dclone</strong> and returns a new
62 <strong>PathsTraversal</strong> object.</p>
63 </dd>
64 <dt><strong><a name="getconnectedcomponentsvertices" class="item"><strong>GetConnectedComponentsVertices</strong></a></strong></dt>
65 <dd>
66 <div class="OptionsBox">
67 @Components = $PathsTraversal-&gt;GetConnectedComponentsVertices();
68 <br/> $NumOfComponents = $PathsTraversal-&gt;GetConnectedComponentsVertices();</div>
69 <p>Returns an array of <strong>Components</strong> containing references to arrays of vertex IDs corresponding
70 to connected components of graph after a search. In scalar context, the number of connected
71 components is returned.</p>
72 <p>Connected <strong>Components</strong> is sorted in descending order of number of vertices in each
73 connected component.</p>
74 </dd>
75 <dt><strong><a name="getpaths" class="item"><strong>GetPaths</strong></a></strong></dt>
76 <dd>
77 <div class="OptionsBox">
78 @Paths = $PathsTraversal-&gt;GetPaths();
79 <br/> $NumOfPaths = $PathsTraversal-&gt;GetPaths();</div>
80 <p>Returns an array of <strong>Paths</strong> containing references to arrays of vertex IDs corresponding to
81 to paths traversed in a graph after a search. In scalar context, number of paths is returned.</p>
82 <p><strong>Paths</strong> array is sorted in ascending order of path lengths.</p>
83 </dd>
84 <dt><strong><a name="getvertices" class="item"><strong>GetVertices</strong></a></strong></dt>
85 <dd>
86 <div class="OptionsBox">
87 @Vertices = $PathsTraversal-&gt;GetVertices();
88 <br/> $NumOfVertices = $PathsTraversal-&gt;GetVertices();</div>
89 <p>Returns an array containing an ordered list of vertex IDs traversed during a search. In
90 scalar context, the number of vertices is returned.</p>
91 </dd>
92 <dt><strong><a name="getverticesdepth" class="item"><strong>GetVerticesDepth</strong></a></strong></dt>
93 <dd>
94 <div class="OptionsBox">
95 %VerticesDepth = $PathsTraversal-&gt;GetVerticesDepth();</div>
96 <p>Returns a hash <em>VerticesDepth</em> containing vertex ID and depth from root vertex as a key and
97 value pair for all vertices traversed during a search.</p>
98 </dd>
99 <dt><strong><a name="getverticesneighborhoods" class="item"><strong>GetVerticesNeighborhoods</strong></a></strong></dt>
100 <dd>
101 <div class="OptionsBox">
102 @VerticesNeighborhoods =
103 $PathsTraversal-&gt;GetVerticesNeighborhoods();
104 <br/> $NumOfVerticesNeighborhoods =
105 $PathsTraversal-&gt;GetVerticesNeighborhoods();</div>
106 <p>Returns an array <em>VerticesNeighborhoods</em> containing references to arrays corresponding
107 to vertices collected at various neighborhood radii around a specified vertex during a vertex
108 neighborhood search. In scalar context, the number of neighborhoods is returned.</p>
109 </dd>
110 <dt><strong><a name="getverticesneighborhoodswithsuccessors" class="item"><strong>GetVerticesNeighborhoodsWithSuccessors</strong></a></strong></dt>
111 <dd>
112 <div class="OptionsBox">
113 @VerticesNeighborhoodsWithSucceessors =
114 $PathsTraversal-&gt;GetVerticesNeighborhoodsWithSuccessors();
115 <br/> $NumOfVerticesNeighborhoodsWithSucceessors =
116 $PathsTraversal-&gt;GetVerticesNeighborhoodsWithSuccessors();</div>
117 <p>Returns an array <em>VerticesNeighborhoodsWithSucceessors</em> containing references to arrays
118 with first value corresponding to vertex IDs corresponding to a vertex at a specific neighborhood
119 radius level and second value a reference to an arraty containing its successors.</p>
120 </dd>
121 <dt><strong><a name="getverticespredecessors" class="item"><strong>GetVerticesPredecessors</strong></a></strong></dt>
122 <dd>
123 <div class="OptionsBox">
124 %VerticesPredecessors = $PathsTraversal-&gt;GetVerticesPredecessors();</div>
125 <p>Returns a hash <em>VerticesPredecessors</em> containing vertex ID and predecessor vertex ID as key
126 and value pair for all vertices traversed during a search.</p>
127 </dd>
128 <dt><strong><a name="getverticesroots" class="item"><strong>GetVerticesRoots</strong></a></strong></dt>
129 <dd>
130 <div class="OptionsBox">
131 %VerticesRoots = $PathsTraversal-&gt;GetVerticesRoots();</div>
132 <p>Returns a hash <em>VerticesPredecessors</em> containing vertex ID and root vertex ID as a key
133 and value pair for all vertices traversed during a search.</p>
134 </dd>
135 <dt><strong><a name="performallpathssearch" class="item"><strong>PerformAllPathsSearch</strong></a></strong></dt>
136 <dd>
137 <div class="OptionsBox">
138 $PathsTraversal-&gt;PerformAllPathsSearch($StartVertexID, [$AllowCycles]);</div>
139 <p>Searches all paths starting from a <em>StartVertexID</em> with sharing of edges in paths traversed and
140 returns <em>PathsTraversal</em>.</p>
141 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
142 completing the cycle.</p>
143 </dd>
144 <dt><strong><a name="performallpathssearchwithlength" class="item"><strong>PerformAllPathsSearchWithLength</strong></a></strong></dt>
145 <dd>
146 <div class="OptionsBox">
147 $PathsTraversal-&gt;PerformAllPathsSearchWithLength($StartVertexID,
148 $Length, [$AllowCycles]);</div>
149 <p>Searches all paths starting from <em>StartVertexID</em> of specific <em>Length</em> with sharing of
150 edges in paths traversed and returns <em>PathsTraversal</em>.</p>
151 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
152 completing the cycle.</p>
153 </dd>
154 <dt><strong><a name="performallpathssearchwithlengthupto" class="item"><strong>PerformAllPathsSearchWithLengthUpto</strong></a></strong></dt>
155 <dd>
156 <div class="OptionsBox">
157 $PathsTraversal-&gt;PerformAllPathsSearchWithLengthUpto($StartVertexID,
158 $Length, [$AllowCycles]);</div>
159 <p>Searches all paths starting from <em>StartVertexID</em> of length upto a <em>Length</em> with sharing of
160 edges in paths traversed and returns <em>PathsTraversal</em>.</p>
161 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
162 completing the cycle.</p>
163 </dd>
164 <dt><strong><a name="performbreadthfirstsearch" class="item"><strong>PerformBreadthFirstSearch</strong></a></strong></dt>
165 <dd>
166 <div class="OptionsBox">
167 $PathsTraversal-&gt;PerformBreadthFirstSearch();</div>
168 <p>Performs Breadth First Search (BFS) and returns <em>PathsTraversal</em>.</p>
169 </dd>
170 <dt><strong><a name="performbreadthfirstsearchwithlimit" class="item"><strong>PerformBreadthFirstSearchWithLimit</strong></a></strong></dt>
171 <dd>
172 <div class="OptionsBox">
173 $PathsTraversal-&gt;PerformBreadthFirstSearchWithLimit($DepthLimit,
174 [$RootVertexID]);</div>
175 <p>Performs BFS with depth up to <em>DepthLimit</em> starting at <em>RootVertexID</em> and returns
176 <em>PathsTraversal</em>. By default, root vertex ID corresponds to an arbitrary vertex.</p>
177 </dd>
178 <dt><strong><a name="performdepthfirstsearch" class="item"><strong>PerformDepthFirstSearch</strong></a></strong></dt>
179 <dd>
180 <div class="OptionsBox">
181 $Return = $PathsTraversal-&gt;PerformDepthFirstSearch();</div>
182 <p>Performs Depth First Search (DFS) and returns <em>PathsTraversal</em>.</p>
183 </dd>
184 <dt><strong><a name="performdepthfirstsearchwithlimit" class="item"><strong>PerformDepthFirstSearchWithLimit</strong></a></strong></dt>
185 <dd>
186 <div class="OptionsBox">
187 $PathsTraversal-&gt;PerformDepthFirstSearchWithLimit($DepthLimit,
188 [$RootVertexID]);</div>
189 <p>Performs DFS with depth up to <em>DepthLimit</em> starting at <em>RootVertexID</em> and returns
190 <em>PathsTraversal</em>. By default, root vertex ID corresponds to an arbitrary vertex.</p>
191 </dd>
192 <dt><strong><a name="performneighborhoodverticessearch" class="item"><strong>PerformNeighborhoodVerticesSearch</strong></a></strong></dt>
193 <dd>
194 <div class="OptionsBox">
195 $PathsTraversal-&gt;PerformNeighborhoodVerticesSearch($StartVertexID);</div>
196 <p>Searches vertices around <em>StartVertexID</em> at all neighborhood radii and returns
197 <em>PathsTraversal</em> object.</p>
198 </dd>
199 <dt><strong><a name="performneighborhoodverticessearchwithradiusupto" class="item"><strong>PerformNeighborhoodVerticesSearchWithRadiusUpto</strong></a></strong></dt>
200 <dd>
201 <div class="OptionsBox">
202 $PathsTraversal-&gt;PerformNeighborhoodVerticesSearchWithRadiusUpto(
203 $StartVertexID, $Radius);</div>
204 <p>Searches vertices around <em>StartVertexID</em> with neighborhood radius up to <em>Radius</em> and returns
205 <em>PathsTraversal</em> object.</p>
206 </dd>
207 <dt><strong><a name="performneighborhoodverticessearchwithsuccessors" class="item"><strong>PerformNeighborhoodVerticesSearchWithSuccessors</strong></a></strong></dt>
208 <dd>
209 <div class="OptionsBox">
210 $PathsTraversal-&gt;PerformNeighborhoodVerticesSearchWithSuccessors(
211 $StartVertexID);</div>
212 <p>Searches vertices around <em>StartVertexID</em> at all neighborhood radii along with identification of
213 successor vertices for each vertex found during the traversal and returns <em>PathsTraversal</em>.</p>
214 </dd>
215 <dt><strong><a name="performneighborhoodverticessearchwithsuccessorsandradiusupto" class="item"><strong>PerformNeighborhoodVerticesSearchWithSuccessorsAndRadiusUpto</strong></a></strong></dt>
216 <dd>
217 <div class="OptionsBox">
218 $PathsTraversal-&gt;
219 <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PerformNeighborhoodVerticesSearchWithSuccessorsAndRadiusUpto(
220 $StartVertexID, $Radius);</div>
221 <p>Searches vertices around <em>StartVertexID</em> with neighborhood radius upto <em>Radius</em> along with
222 identification of successor vertices for each vertex found during the traversal and returns
223 <em>PathsTraversal</em>.</p>
224 </dd>
225 <dt><strong><a name="performpathssearch" class="item"><strong>PerformPathsSearch</strong></a></strong></dt>
226 <dd>
227 <div class="OptionsBox">
228 $PathsTraversal-&gt;PerformPathsSearch($StartVertexID, [$AllowCycles]);</div>
229 <p>Searches paths starting from <em>StartVertexID</em> with no sharing of edges in paths traversed and
230 returns <em>PathsTraversal</em>.</p>
231 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
232 completing the cycle.</p>
233 </dd>
234 <dt><strong><a name="performpathssearchbetween" class="item"><strong>PerformPathsSearchBetween</strong></a></strong></dt>
235 <dd>
236 <div class="OptionsBox">
237 $PathsTraversal-&gt;PerformPathsSearchBetween($StartVertexID, $EndVertexID);</div>
238 <p>Searches paths between <em>StartVertexID</em> and <em>EndVertexID</em> and returns <em>PathsTraversal</em></p>
239 </dd>
240 <dt><strong><a name="performpathssearchwithlength" class="item"><strong>PerformPathsSearchWithLength</strong></a></strong></dt>
241 <dd>
242 <div class="OptionsBox">
243 $PathsTraversal-&gt;PerformPathsSearchWithLength($StartVertexID, $Length,
244 [$AllowCycles]);</div>
245 <p>Searches paths starting from <em>StartVertexID</em> with length <em>Length</em> with no sharing of
246 edges in paths traversed and returns <em>PathsTraversal</em>.</p>
247 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
248 completing the cycle.</p>
249 </dd>
250 <dt><strong><a name="performpathssearchwithlengthupto" class="item"><strong>PerformPathsSearchWithLengthUpto</strong></a></strong></dt>
251 <dd>
252 <div class="OptionsBox">
253 $PathsTraversal-&gt;PerformPathsSearchWithLengthUpto($StartVertexID, $Length,
254 [$AllowCycles]);</div>
255 <p>Searches paths starting from <em>StartVertexID</em> with length upto <em>Length</em> with no sharing of
256 edges in paths traversed and returns <em>PathsTraversal</em>.</p>
257 <p>By default, cycles are included in paths. A path containing a cycle is terminated at a vertex
258 completing the cycle.</p>
259 </dd>
260 <dt><strong><a name="stringifypaths" class="item"><strong>StringifyPaths</strong></a></strong></dt>
261 <dd>
262 <div class="OptionsBox">
263 $String = $PathsTraversal-&gt;StringifyPaths();</div>
264 <p>Returns a string containing information about traversed paths in <em>PathsTraversal</em> object</p>
265 </dd>
266 <dt><strong><a name="stringifypathstraversal" class="item"><strong>StringifyPathsTraversal</strong></a></strong></dt>
267 <dd>
268 <div class="OptionsBox">
269 $String = $PathsTraversal-&gt;StringifyPathsTraversal();</div>
270 <p>Returns a string containing information about <em>PathsTraversal</em> object.</p>
271 </dd>
272 <dt><strong><a name="stringifyverticesdepth" class="item"><strong>StringifyVerticesDepth</strong></a></strong></dt>
273 <dd>
274 <div class="OptionsBox">
275 $String = $PathsTraversal-&gt;StringifyVerticesDepth();</div>
276 <p>Returns a string containing information about depth of vertices found during search by
277 <em>PathsTraversal</em> object.</p>
278 </dd>
279 <dt><strong><a name="stringifyverticesneighborhoods" class="item"><strong>StringifyVerticesNeighborhoods</strong></a></strong></dt>
280 <dd>
281 <div class="OptionsBox">
282 $String = $PathsTraversal-&gt;StringifyVerticesNeighborhoods();</div>
283 <p>Returns a string containing information about neighborhoods of vertices found during search by
284 <em>PathsTraversal</em> object.</p>
285 </dd>
286 <dt><strong><a name="stringifyverticesneighborhoodswithsuccessors" class="item"><strong>StringifyVerticesNeighborhoodsWithSuccessors</strong></a></strong></dt>
287 <dd>
288 <div class="OptionsBox">
289 $String = $PathsTraversal-&gt;StringifyVerticesNeighborhoodsWithSuccessors();</div>
290 <p>Returns a string containing information about neighborhoods of vertices along with their successors
291 found during search by <em>PathsTraversal</em> object.</p>
292 </dd>
293 <dt><strong><a name="stringifyverticespredecessors" class="item"><strong>StringifyVerticesPredecessors</strong></a></strong></dt>
294 <dd>
295 <div class="OptionsBox">
296 $String = $PathsTraversal-&gt;StringifyVerticesPredecessors();</div>
297 <p>Returns a string containing information about predecessors of vertices found during search by
298 <em>PathsTraversal</em> object.</p>
299 </dd>
300 <dt><strong><a name="stringifyverticesroots" class="item"><strong>StringifyVerticesRoots</strong></a></strong></dt>
301 <dd>
302 <div class="OptionsBox">
303 $String = $PathsTraversal-&gt;StringifyVerticesRoots();</div>
304 <p>Returns a string containing information about roots of vertices found during search by
305 <em>PathsTraversal</em> object.</p>
306 </dd>
307 <dt><strong><a name="stringifyverticessuccessors" class="item"><strong>StringifyVerticesSuccessors</strong></a></strong></dt>
308 <dd>
309 <div class="OptionsBox">
310 $String = $PathsTraversal-&gt;StringifyVerticesSuccessors();</div>
311 <p>Returns a string containing information about successors of vertices found during search by
312 <em>PathsTraversal</em> object.</p>
313 </dd>
314 </dl>
315 <p>
316 </p>
317 <h2>AUTHOR</h2>
318 <p><a href="mailto:msud@san.rr.com">Manish Sud</a></p>
319 <p>
320 </p>
321 <h2>SEE ALSO</h2>
322 <p><a href="./Graph.html">Graph.pm</a>,&nbsp<a href="./Path.html">Path.pm</a>
323 </p>
324 <p>
325 </p>
326 <h2>COPYRIGHT</h2>
327 <p>Copyright (C) 2015 Manish Sud. All rights reserved.</p>
328 <p>This file is part of MayaChemTools.</p>
329 <p>MayaChemTools is free software; you can redistribute it and/or modify it under
330 the terms of the GNU Lesser General Public License as published by the Free
331 Software Foundation; either version 3 of the License, or (at your option)
332 any later version.</p>
333 <p>&nbsp</p><p>&nbsp</p><div class="DocNav">
334 <table width="100%" border=0 cellpadding=0 cellspacing=2>
335 <tr align="left" valign="top"><td width="33%" align="left"><a href="./PathGraph.html" title="PathGraph.html">Previous</a>&nbsp;&nbsp;<a href="./index.html" title="Table of Contents">TOC</a>&nbsp;&nbsp;<a href="./Graph.html" title="Graph.html">Next</a></td><td width="34%" align="middle"><strong>March 29, 2015</strong></td><td width="33%" align="right"><strong>Graph::PathsTraversal.pm</strong></td></tr>
336 </table>
337 </div>
338 <br />
339 <center>
340 <img src="../../images/h2o2.png">
341 </center>
342 </body>
343 </html>