1 <?xml version="1.0" encoding="ascii"?> |
|
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
3 "DTD/xhtml1-transitional.dtd"> |
|
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
5 <head> |
|
6 <title>graph.hypergraph</title> |
|
7 <link rel="stylesheet" href="epydoc.css" type="text/css" /> |
|
8 <script type="text/javascript" src="epydoc.js"></script> |
|
9 </head> |
|
10 |
|
11 <body bgcolor="white" text="black" link="blue" vlink="#204080" |
|
12 alink="#204080"> |
|
13 <!-- ==================== NAVIGATION BAR ==================== --> |
|
14 <table class="navbar" border="0" width="100%" cellpadding="0" |
|
15 bgcolor="#a0c0ff" cellspacing="0"> |
|
16 <tr valign="middle"> |
|
17 <!-- Home link --> |
|
18 <th> <a |
|
19 href="graph-module.html">Home</a> </th> |
|
20 |
|
21 <!-- Tree link --> |
|
22 <th> <a |
|
23 href="module-tree.html">Trees</a> </th> |
|
24 |
|
25 <!-- Index link --> |
|
26 <th> <a |
|
27 href="identifier-index.html">Indices</a> </th> |
|
28 |
|
29 <!-- Help link --> |
|
30 <th> <a |
|
31 href="help.html">Help</a> </th> |
|
32 |
|
33 <!-- Project homepage --> |
|
34 <th class="navbar" align="right" width="100%"> |
|
35 <table border="0" cellpadding="0" cellspacing="0"> |
|
36 <tr><th class="navbar" align="center" |
|
37 ><a class="navbar" target="_top" href="http://code.google.com/p/python-graph/">python-graph</a></th> |
|
38 </tr></table></th> |
|
39 </tr> |
|
40 </table> |
|
41 <table width="100%" cellpadding="0" cellspacing="0"> |
|
42 <tr valign="top"> |
|
43 <td width="100%"> |
|
44 <span class="breadcrumbs"> |
|
45 <a href="graph-module.html">Package graph</a> :: |
|
46 Class hypergraph |
|
47 </span> |
|
48 </td> |
|
49 <td> |
|
50 <table cellpadding="0" cellspacing="0"> |
|
51 <!-- hide/show private --> |
|
52 </table> |
|
53 </td> |
|
54 </tr> |
|
55 </table> |
|
56 <!-- ==================== CLASS DESCRIPTION ==================== --> |
|
57 <h1 class="epydoc">Class hypergraph</h1><p class="nomargin-top"></p> |
|
58 <pre class="base-tree"> |
|
59 object --+ |
|
60 | |
|
61 <strong class="uidshort">hypergraph</strong> |
|
62 </pre> |
|
63 |
|
64 <hr /> |
|
65 <p>Hypergraph class.</p> |
|
66 <p>Hypergraphs are a generalization of graphs where an edge (called |
|
67 hyperedge) can connect more than two nodes.</p> |
|
68 |
|
69 <!-- ==================== INSTANCE METHODS ==================== --> |
|
70 <a name="section-InstanceMethods"></a> |
|
71 <table class="summary" border="1" cellpadding="3" |
|
72 cellspacing="0" width="100%" bgcolor="white"> |
|
73 <tr bgcolor="#70b0f0" class="table-header"> |
|
74 <td align="left" colspan="2" class="table-header"> |
|
75 <span class="table-header">Instance Methods</span></td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td width="15%" align="right" valign="top" class="summary"> |
|
79 <span class="summary-type"> </span> |
|
80 </td><td class="summary"> |
|
81 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
82 <tr> |
|
83 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
84 Initialize a hypergraph.</td> |
|
85 <td align="right" valign="top"> |
|
86 |
|
87 |
|
88 </td> |
|
89 </tr> |
|
90 </table> |
|
91 |
|
92 </td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td width="15%" align="right" valign="top" class="summary"> |
|
96 <span class="summary-type">number</span> |
|
97 </td><td class="summary"> |
|
98 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
99 <tr> |
|
100 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#__len__" class="summary-sig-name">__len__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
101 Return the size of the hypergraph when requested by len().</td> |
|
102 <td align="right" valign="top"> |
|
103 |
|
104 |
|
105 </td> |
|
106 </tr> |
|
107 </table> |
|
108 |
|
109 </td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td width="15%" align="right" valign="top" class="summary"> |
|
113 <span class="summary-type">string</span> |
|
114 </td><td class="summary"> |
|
115 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
116 <tr> |
|
117 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
118 Return a string representing the hypergraph when requested by str() |
|
119 (or print).</td> |
|
120 <td align="right" valign="top"> |
|
121 |
|
122 |
|
123 </td> |
|
124 </tr> |
|
125 </table> |
|
126 |
|
127 </td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td width="15%" align="right" valign="top" class="summary"> |
|
131 <span class="summary-type"> </span> |
|
132 </td><td class="summary"> |
|
133 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
134 <tr> |
|
135 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#add_hyperedge" class="summary-sig-name">add_hyperedge</a>(<span class="summary-sig-arg">self</span>, |
|
136 <span class="summary-sig-arg">hyperedge</span>)</span><br /> |
|
137 Add given hyperedge to the hypergraph.</td> |
|
138 <td align="right" valign="top"> |
|
139 |
|
140 |
|
141 </td> |
|
142 </tr> |
|
143 </table> |
|
144 |
|
145 </td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td width="15%" align="right" valign="top" class="summary"> |
|
149 <span class="summary-type"> </span> |
|
150 </td><td class="summary"> |
|
151 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
152 <tr> |
|
153 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#add_hyperedges" class="summary-sig-name">add_hyperedges</a>(<span class="summary-sig-arg">self</span>, |
|
154 <span class="summary-sig-arg">edgelist</span>)</span><br /> |
|
155 Add given hyperedges to the hypergraph.</td> |
|
156 <td align="right" valign="top"> |
|
157 |
|
158 |
|
159 </td> |
|
160 </tr> |
|
161 </table> |
|
162 |
|
163 </td> |
|
164 </tr> |
|
165 <tr> |
|
166 <td width="15%" align="right" valign="top" class="summary"> |
|
167 <span class="summary-type"> </span> |
|
168 </td><td class="summary"> |
|
169 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
170 <tr> |
|
171 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#add_node" class="summary-sig-name">add_node</a>(<span class="summary-sig-arg">self</span>, |
|
172 <span class="summary-sig-arg">node</span>)</span><br /> |
|
173 Add given node to the hypergraph.</td> |
|
174 <td align="right" valign="top"> |
|
175 |
|
176 |
|
177 </td> |
|
178 </tr> |
|
179 </table> |
|
180 |
|
181 </td> |
|
182 </tr> |
|
183 <tr> |
|
184 <td width="15%" align="right" valign="top" class="summary"> |
|
185 <span class="summary-type"> </span> |
|
186 </td><td class="summary"> |
|
187 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
188 <tr> |
|
189 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#add_nodes" class="summary-sig-name">add_nodes</a>(<span class="summary-sig-arg">self</span>, |
|
190 <span class="summary-sig-arg">nodelist</span>)</span><br /> |
|
191 Add given nodes to the hypergraph.</td> |
|
192 <td align="right" valign="top"> |
|
193 |
|
194 |
|
195 </td> |
|
196 </tr> |
|
197 </table> |
|
198 |
|
199 </td> |
|
200 </tr> |
|
201 <tr> |
|
202 <td width="15%" align="right" valign="top" class="summary"> |
|
203 <span class="summary-type">boolean</span> |
|
204 </td><td class="summary"> |
|
205 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
206 <tr> |
|
207 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#has_node" class="summary-sig-name">has_node</a>(<span class="summary-sig-arg">self</span>, |
|
208 <span class="summary-sig-arg">node</span>)</span><br /> |
|
209 Return whether the requested node exists.</td> |
|
210 <td align="right" valign="top"> |
|
211 |
|
212 |
|
213 </td> |
|
214 </tr> |
|
215 </table> |
|
216 |
|
217 </td> |
|
218 </tr> |
|
219 <tr> |
|
220 <td width="15%" align="right" valign="top" class="summary"> |
|
221 <span class="summary-type">list</span> |
|
222 </td><td class="summary"> |
|
223 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
224 <tr> |
|
225 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#hyperedges" class="summary-sig-name">hyperedges</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
226 Return hyperedge list.</td> |
|
227 <td align="right" valign="top"> |
|
228 |
|
229 |
|
230 </td> |
|
231 </tr> |
|
232 </table> |
|
233 |
|
234 </td> |
|
235 </tr> |
|
236 <tr> |
|
237 <td width="15%" align="right" valign="top" class="summary"> |
|
238 <span class="summary-type"> </span> |
|
239 </td><td class="summary"> |
|
240 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
241 <tr> |
|
242 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#link" class="summary-sig-name">link</a>(<span class="summary-sig-arg">self</span>, |
|
243 <span class="summary-sig-arg">node</span>, |
|
244 <span class="summary-sig-arg">hyperedge</span>)</span><br /> |
|
245 Link given node and hyperedge.</td> |
|
246 <td align="right" valign="top"> |
|
247 |
|
248 |
|
249 </td> |
|
250 </tr> |
|
251 </table> |
|
252 |
|
253 </td> |
|
254 </tr> |
|
255 <tr> |
|
256 <td width="15%" align="right" valign="top" class="summary"> |
|
257 <span class="summary-type">list</span> |
|
258 </td><td class="summary"> |
|
259 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
260 <tr> |
|
261 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#links" class="summary-sig-name">links</a>(<span class="summary-sig-arg">self</span>, |
|
262 <span class="summary-sig-arg">obj</span>)</span><br /> |
|
263 Return all objects linked to the given one.</td> |
|
264 <td align="right" valign="top"> |
|
265 |
|
266 |
|
267 </td> |
|
268 </tr> |
|
269 </table> |
|
270 |
|
271 </td> |
|
272 </tr> |
|
273 <tr> |
|
274 <td width="15%" align="right" valign="top" class="summary"> |
|
275 <span class="summary-type">list</span> |
|
276 </td><td class="summary"> |
|
277 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
278 <tr> |
|
279 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#nodes" class="summary-sig-name">nodes</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
280 Return node list.</td> |
|
281 <td align="right" valign="top"> |
|
282 |
|
283 |
|
284 </td> |
|
285 </tr> |
|
286 </table> |
|
287 |
|
288 </td> |
|
289 </tr> |
|
290 <tr> |
|
291 <td width="15%" align="right" valign="top" class="summary"> |
|
292 <span class="summary-type"> </span> |
|
293 </td><td class="summary"> |
|
294 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
295 <tr> |
|
296 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#unlink" class="summary-sig-name">unlink</a>(<span class="summary-sig-arg">self</span>, |
|
297 <span class="summary-sig-arg">node</span>, |
|
298 <span class="summary-sig-arg">hyperedge</span>)</span><br /> |
|
299 Unlink given node and hyperedge.</td> |
|
300 <td align="right" valign="top"> |
|
301 |
|
302 |
|
303 </td> |
|
304 </tr> |
|
305 </table> |
|
306 |
|
307 </td> |
|
308 </tr> |
|
309 <tr> |
|
310 <td width="15%" align="right" valign="top" class="summary"> |
|
311 <span class="summary-type"> </span> |
|
312 </td><td class="summary"> |
|
313 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
314 <tr> |
|
315 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#read" class="summary-sig-name">read</a>(<span class="summary-sig-arg">self</span>, |
|
316 <span class="summary-sig-arg">string</span>, |
|
317 <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">xml</code><code class="variable-quote">'</code></span>)</span><br /> |
|
318 Read a hypergraph from a string.</td> |
|
319 <td align="right" valign="top"> |
|
320 |
|
321 |
|
322 </td> |
|
323 </tr> |
|
324 </table> |
|
325 |
|
326 </td> |
|
327 </tr> |
|
328 <tr> |
|
329 <td width="15%" align="right" valign="top" class="summary"> |
|
330 <span class="summary-type">string</span> |
|
331 </td><td class="summary"> |
|
332 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
333 <tr> |
|
334 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#write" class="summary-sig-name">write</a>(<span class="summary-sig-arg">self</span>, |
|
335 <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">xml</code><code class="variable-quote">'</code></span>)</span><br /> |
|
336 Write the hypergraph to a string.</td> |
|
337 <td align="right" valign="top"> |
|
338 |
|
339 |
|
340 </td> |
|
341 </tr> |
|
342 </table> |
|
343 |
|
344 </td> |
|
345 </tr> |
|
346 <tr> |
|
347 <td width="15%" align="right" valign="top" class="summary"> |
|
348 <span class="summary-type">dictionary</span> |
|
349 </td><td class="summary"> |
|
350 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
351 <tr> |
|
352 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#accessibility" class="summary-sig-name">accessibility</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
353 Accessibility matrix (transitive closure).</td> |
|
354 <td align="right" valign="top"> |
|
355 |
|
356 |
|
357 </td> |
|
358 </tr> |
|
359 </table> |
|
360 |
|
361 </td> |
|
362 </tr> |
|
363 <tr> |
|
364 <td width="15%" align="right" valign="top" class="summary"> |
|
365 <span class="summary-type">dictionary</span> |
|
366 </td><td class="summary"> |
|
367 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
368 <tr> |
|
369 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#connected_components" class="summary-sig-name">connected_components</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
370 Connected components.</td> |
|
371 <td align="right" valign="top"> |
|
372 |
|
373 |
|
374 </td> |
|
375 </tr> |
|
376 </table> |
|
377 |
|
378 </td> |
|
379 </tr> |
|
380 <tr> |
|
381 <td width="15%" align="right" valign="top" class="summary"> |
|
382 <span class="summary-type">list</span> |
|
383 </td><td class="summary"> |
|
384 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
385 <tr> |
|
386 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#cut_hyperedges" class="summary-sig-name">cut_hyperedges</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
387 Return the cut-hyperedges of the given hypergraph.</td> |
|
388 <td align="right" valign="top"> |
|
389 |
|
390 |
|
391 </td> |
|
392 </tr> |
|
393 </table> |
|
394 |
|
395 </td> |
|
396 </tr> |
|
397 <tr> |
|
398 <td width="15%" align="right" valign="top" class="summary"> |
|
399 <span class="summary-type">list</span> |
|
400 </td><td class="summary"> |
|
401 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
402 <tr> |
|
403 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#cut_nodes" class="summary-sig-name">cut_nodes</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
404 Return the cut-nodes of the given hypergraph.</td> |
|
405 <td align="right" valign="top"> |
|
406 |
|
407 |
|
408 </td> |
|
409 </tr> |
|
410 </table> |
|
411 |
|
412 </td> |
|
413 </tr> |
|
414 <tr> |
|
415 <td width="15%" align="right" valign="top" class="summary"> |
|
416 <span class="summary-type">int</span> |
|
417 </td><td class="summary"> |
|
418 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
419 <tr> |
|
420 <td><span class="summary-sig"><a href="graph.hypergraph-class.html#rank" class="summary-sig-name">rank</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
|
421 Return the rank of the given hypergraph.</td> |
|
422 <td align="right" valign="top"> |
|
423 |
|
424 |
|
425 </td> |
|
426 </tr> |
|
427 </table> |
|
428 |
|
429 </td> |
|
430 </tr> |
|
431 <tr> |
|
432 <td colspan="2" class="summary"> |
|
433 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
|
434 <code>__delattr__</code>, |
|
435 <code>__getattribute__</code>, |
|
436 <code>__hash__</code>, |
|
437 <code>__new__</code>, |
|
438 <code>__reduce__</code>, |
|
439 <code>__reduce_ex__</code>, |
|
440 <code>__repr__</code>, |
|
441 <code>__setattr__</code> |
|
442 </p> |
|
443 </td> |
|
444 </tr> |
|
445 </table> |
|
446 <!-- ==================== PROPERTIES ==================== --> |
|
447 <a name="section-Properties"></a> |
|
448 <table class="summary" border="1" cellpadding="3" |
|
449 cellspacing="0" width="100%" bgcolor="white"> |
|
450 <tr bgcolor="#70b0f0" class="table-header"> |
|
451 <td align="left" colspan="2" class="table-header"> |
|
452 <span class="table-header">Properties</span></td> |
|
453 </tr> |
|
454 <tr> |
|
455 <td colspan="2" class="summary"> |
|
456 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
|
457 <code>__class__</code> |
|
458 </p> |
|
459 </td> |
|
460 </tr> |
|
461 </table> |
|
462 <!-- ==================== METHOD DETAILS ==================== --> |
|
463 <a name="section-MethodDetails"></a> |
|
464 <table class="details" border="1" cellpadding="3" |
|
465 cellspacing="0" width="100%" bgcolor="white"> |
|
466 <tr bgcolor="#70b0f0" class="table-header"> |
|
467 <td align="left" colspan="2" class="table-header"> |
|
468 <span class="table-header">Method Details</span></td> |
|
469 </tr> |
|
470 </table> |
|
471 <a name="__init__"></a> |
|
472 <div> |
|
473 <table class="details" border="1" cellpadding="3" |
|
474 cellspacing="0" width="100%" bgcolor="white"> |
|
475 <tr><td> |
|
476 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
477 <tr valign="top"><td> |
|
478 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>)</span> |
|
479 <br /><em class="fname">(Constructor)</em> |
|
480 </h3> |
|
481 </td><td align="right" valign="top" |
|
482 > |
|
483 </td> |
|
484 </tr></table> |
|
485 |
|
486 <p>Initialize a hypergraph.</p> |
|
487 <dl class="fields"> |
|
488 <dt>Overrides: |
|
489 object.__init__ |
|
490 </dt> |
|
491 </dl> |
|
492 </td></tr></table> |
|
493 </div> |
|
494 <a name="__len__"></a> |
|
495 <div> |
|
496 <table class="details" border="1" cellpadding="3" |
|
497 cellspacing="0" width="100%" bgcolor="white"> |
|
498 <tr><td> |
|
499 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
500 <tr valign="top"><td> |
|
501 <h3 class="epydoc"><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">self</span>)</span> |
|
502 <br /><em class="fname">(Length operator)</em> |
|
503 </h3> |
|
504 </td><td align="right" valign="top" |
|
505 > |
|
506 </td> |
|
507 </tr></table> |
|
508 |
|
509 <p>Return the size of the hypergraph when requested by len().</p> |
|
510 <dl class="fields"> |
|
511 <dt>Returns: number</dt> |
|
512 <dd>Size of the hypergraph.</dd> |
|
513 </dl> |
|
514 </td></tr></table> |
|
515 </div> |
|
516 <a name="__str__"></a> |
|
517 <div> |
|
518 <table class="details" border="1" cellpadding="3" |
|
519 cellspacing="0" width="100%" bgcolor="white"> |
|
520 <tr><td> |
|
521 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
522 <tr valign="top"><td> |
|
523 <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span> |
|
524 <br /><em class="fname">(Informal representation operator)</em> |
|
525 </h3> |
|
526 </td><td align="right" valign="top" |
|
527 > |
|
528 </td> |
|
529 </tr></table> |
|
530 |
|
531 <p>Return a string representing the hypergraph when requested by str() |
|
532 (or print).</p> |
|
533 <dl class="fields"> |
|
534 <dt>Returns: string</dt> |
|
535 <dd>String representing the hypergraph.</dd> |
|
536 <dt>Overrides: |
|
537 object.__str__ |
|
538 </dt> |
|
539 </dl> |
|
540 </td></tr></table> |
|
541 </div> |
|
542 <a name="add_hyperedge"></a> |
|
543 <div> |
|
544 <table class="details" border="1" cellpadding="3" |
|
545 cellspacing="0" width="100%" bgcolor="white"> |
|
546 <tr><td> |
|
547 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
548 <tr valign="top"><td> |
|
549 <h3 class="epydoc"><span class="sig"><span class="sig-name">add_hyperedge</span>(<span class="sig-arg">self</span>, |
|
550 <span class="sig-arg">hyperedge</span>)</span> |
|
551 </h3> |
|
552 </td><td align="right" valign="top" |
|
553 > |
|
554 </td> |
|
555 </tr></table> |
|
556 |
|
557 <p>Add given hyperedge to the hypergraph.</p> |
|
558 <dl class="fields"> |
|
559 <dt>Parameters:</dt> |
|
560 <dd><ul class="nomargin-top"> |
|
561 <li><strong class="pname"><code>hyperedge</code></strong> (hyperedge) - Hyperedge identifier.</li> |
|
562 </ul></dd> |
|
563 </dl> |
|
564 <div class="fields"> <p><strong>Attention:</strong> |
|
565 While hyperedge-nodes can be of any type, it's strongly recommended |
|
566 to use only numbers and single-line strings as node identifiers if |
|
567 you intend to use write(). |
|
568 </p> |
|
569 </div></td></tr></table> |
|
570 </div> |
|
571 <a name="add_hyperedges"></a> |
|
572 <div> |
|
573 <table class="details" border="1" cellpadding="3" |
|
574 cellspacing="0" width="100%" bgcolor="white"> |
|
575 <tr><td> |
|
576 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
577 <tr valign="top"><td> |
|
578 <h3 class="epydoc"><span class="sig"><span class="sig-name">add_hyperedges</span>(<span class="sig-arg">self</span>, |
|
579 <span class="sig-arg">edgelist</span>)</span> |
|
580 </h3> |
|
581 </td><td align="right" valign="top" |
|
582 > |
|
583 </td> |
|
584 </tr></table> |
|
585 |
|
586 <p>Add given hyperedges to the hypergraph.</p> |
|
587 <dl class="fields"> |
|
588 <dt>Parameters:</dt> |
|
589 <dd><ul class="nomargin-top"> |
|
590 <li><strong class="pname"><code>edgelist</code></strong> (list) - List of hyperedge-nodes to be added to the graph.</li> |
|
591 </ul></dd> |
|
592 </dl> |
|
593 <div class="fields"> <p><strong>Attention:</strong> |
|
594 While hyperedge-nodes can be of any type, it's strongly recommended |
|
595 to use only numbers and single-line strings as node identifiers if |
|
596 you intend to use write(). |
|
597 </p> |
|
598 </div></td></tr></table> |
|
599 </div> |
|
600 <a name="add_node"></a> |
|
601 <div> |
|
602 <table class="details" border="1" cellpadding="3" |
|
603 cellspacing="0" width="100%" bgcolor="white"> |
|
604 <tr><td> |
|
605 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
606 <tr valign="top"><td> |
|
607 <h3 class="epydoc"><span class="sig"><span class="sig-name">add_node</span>(<span class="sig-arg">self</span>, |
|
608 <span class="sig-arg">node</span>)</span> |
|
609 </h3> |
|
610 </td><td align="right" valign="top" |
|
611 > |
|
612 </td> |
|
613 </tr></table> |
|
614 |
|
615 <p>Add given node to the hypergraph.</p> |
|
616 <dl class="fields"> |
|
617 <dt>Parameters:</dt> |
|
618 <dd><ul class="nomargin-top"> |
|
619 <li><strong class="pname"><code>node</code></strong> (node) - Node identifier.</li> |
|
620 </ul></dd> |
|
621 </dl> |
|
622 <div class="fields"> <p><strong>Attention:</strong> |
|
623 While nodes can be of any type, it's strongly recommended to use |
|
624 only numbers and single-line strings as node identifiers if you |
|
625 intend to use write(). |
|
626 </p> |
|
627 </div></td></tr></table> |
|
628 </div> |
|
629 <a name="add_nodes"></a> |
|
630 <div> |
|
631 <table class="details" border="1" cellpadding="3" |
|
632 cellspacing="0" width="100%" bgcolor="white"> |
|
633 <tr><td> |
|
634 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
635 <tr valign="top"><td> |
|
636 <h3 class="epydoc"><span class="sig"><span class="sig-name">add_nodes</span>(<span class="sig-arg">self</span>, |
|
637 <span class="sig-arg">nodelist</span>)</span> |
|
638 </h3> |
|
639 </td><td align="right" valign="top" |
|
640 > |
|
641 </td> |
|
642 </tr></table> |
|
643 |
|
644 <p>Add given nodes to the hypergraph.</p> |
|
645 <dl class="fields"> |
|
646 <dt>Parameters:</dt> |
|
647 <dd><ul class="nomargin-top"> |
|
648 <li><strong class="pname"><code>nodelist</code></strong> (list) - List of nodes to be added to the graph.</li> |
|
649 </ul></dd> |
|
650 </dl> |
|
651 <div class="fields"> <p><strong>Attention:</strong> |
|
652 While nodes can be of any type, it's strongly recommended to use |
|
653 only numbers and single-line strings as node identifiers if you |
|
654 intend to use write(). |
|
655 </p> |
|
656 </div></td></tr></table> |
|
657 </div> |
|
658 <a name="has_node"></a> |
|
659 <div> |
|
660 <table class="details" border="1" cellpadding="3" |
|
661 cellspacing="0" width="100%" bgcolor="white"> |
|
662 <tr><td> |
|
663 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
664 <tr valign="top"><td> |
|
665 <h3 class="epydoc"><span class="sig"><span class="sig-name">has_node</span>(<span class="sig-arg">self</span>, |
|
666 <span class="sig-arg">node</span>)</span> |
|
667 </h3> |
|
668 </td><td align="right" valign="top" |
|
669 > |
|
670 </td> |
|
671 </tr></table> |
|
672 |
|
673 <p>Return whether the requested node exists.</p> |
|
674 <dl class="fields"> |
|
675 <dt>Parameters:</dt> |
|
676 <dd><ul class="nomargin-top"> |
|
677 <li><strong class="pname"><code>node</code></strong> (node) - Node identifier</li> |
|
678 </ul></dd> |
|
679 <dt>Returns: boolean</dt> |
|
680 <dd>Truth-value for node existence.</dd> |
|
681 </dl> |
|
682 </td></tr></table> |
|
683 </div> |
|
684 <a name="hyperedges"></a> |
|
685 <div> |
|
686 <table class="details" border="1" cellpadding="3" |
|
687 cellspacing="0" width="100%" bgcolor="white"> |
|
688 <tr><td> |
|
689 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
690 <tr valign="top"><td> |
|
691 <h3 class="epydoc"><span class="sig"><span class="sig-name">hyperedges</span>(<span class="sig-arg">self</span>)</span> |
|
692 </h3> |
|
693 </td><td align="right" valign="top" |
|
694 > |
|
695 </td> |
|
696 </tr></table> |
|
697 |
|
698 <p>Return hyperedge list.</p> |
|
699 <dl class="fields"> |
|
700 <dt>Returns: list</dt> |
|
701 <dd>List of hyperedges linked to the given node.</dd> |
|
702 </dl> |
|
703 </td></tr></table> |
|
704 </div> |
|
705 <a name="link"></a> |
|
706 <div> |
|
707 <table class="details" border="1" cellpadding="3" |
|
708 cellspacing="0" width="100%" bgcolor="white"> |
|
709 <tr><td> |
|
710 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
711 <tr valign="top"><td> |
|
712 <h3 class="epydoc"><span class="sig"><span class="sig-name">link</span>(<span class="sig-arg">self</span>, |
|
713 <span class="sig-arg">node</span>, |
|
714 <span class="sig-arg">hyperedge</span>)</span> |
|
715 </h3> |
|
716 </td><td align="right" valign="top" |
|
717 > |
|
718 </td> |
|
719 </tr></table> |
|
720 |
|
721 <p>Link given node and hyperedge.</p> |
|
722 <dl class="fields"> |
|
723 <dt>Parameters:</dt> |
|
724 <dd><ul class="nomargin-top"> |
|
725 <li><strong class="pname"><code>node</code></strong> (node) - Node.</li> |
|
726 <li><strong class="pname"><code>hyperedge</code></strong> (node) - Hyperedge.</li> |
|
727 </ul></dd> |
|
728 </dl> |
|
729 </td></tr></table> |
|
730 </div> |
|
731 <a name="links"></a> |
|
732 <div> |
|
733 <table class="details" border="1" cellpadding="3" |
|
734 cellspacing="0" width="100%" bgcolor="white"> |
|
735 <tr><td> |
|
736 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
737 <tr valign="top"><td> |
|
738 <h3 class="epydoc"><span class="sig"><span class="sig-name">links</span>(<span class="sig-arg">self</span>, |
|
739 <span class="sig-arg">obj</span>)</span> |
|
740 </h3> |
|
741 </td><td align="right" valign="top" |
|
742 > |
|
743 </td> |
|
744 </tr></table> |
|
745 |
|
746 <p>Return all objects linked to the given one.</p> |
|
747 <p>If given a node, linked hyperedges will be returned. If given a |
|
748 hyperedge, linked nodes will be returned.</p> |
|
749 <dl class="fields"> |
|
750 <dt>Parameters:</dt> |
|
751 <dd><ul class="nomargin-top"> |
|
752 <li><strong class="pname"><code>obj</code></strong> (node or hyperedge) - Object identifier.</li> |
|
753 </ul></dd> |
|
754 <dt>Returns: list</dt> |
|
755 <dd>List of objects linked to the given one.</dd> |
|
756 </dl> |
|
757 </td></tr></table> |
|
758 </div> |
|
759 <a name="nodes"></a> |
|
760 <div> |
|
761 <table class="details" border="1" cellpadding="3" |
|
762 cellspacing="0" width="100%" bgcolor="white"> |
|
763 <tr><td> |
|
764 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
765 <tr valign="top"><td> |
|
766 <h3 class="epydoc"><span class="sig"><span class="sig-name">nodes</span>(<span class="sig-arg">self</span>)</span> |
|
767 </h3> |
|
768 </td><td align="right" valign="top" |
|
769 > |
|
770 </td> |
|
771 </tr></table> |
|
772 |
|
773 <p>Return node list.</p> |
|
774 <dl class="fields"> |
|
775 <dt>Returns: list</dt> |
|
776 <dd>Node list.</dd> |
|
777 </dl> |
|
778 </td></tr></table> |
|
779 </div> |
|
780 <a name="unlink"></a> |
|
781 <div> |
|
782 <table class="details" border="1" cellpadding="3" |
|
783 cellspacing="0" width="100%" bgcolor="white"> |
|
784 <tr><td> |
|
785 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
786 <tr valign="top"><td> |
|
787 <h3 class="epydoc"><span class="sig"><span class="sig-name">unlink</span>(<span class="sig-arg">self</span>, |
|
788 <span class="sig-arg">node</span>, |
|
789 <span class="sig-arg">hyperedge</span>)</span> |
|
790 </h3> |
|
791 </td><td align="right" valign="top" |
|
792 > |
|
793 </td> |
|
794 </tr></table> |
|
795 |
|
796 <p>Unlink given node and hyperedge.</p> |
|
797 <dl class="fields"> |
|
798 <dt>Parameters:</dt> |
|
799 <dd><ul class="nomargin-top"> |
|
800 <li><strong class="pname"><code>node</code></strong> (node) - Node.</li> |
|
801 <li><strong class="pname"><code>hyperedge</code></strong> (hyperedge) - Hyperedge.</li> |
|
802 </ul></dd> |
|
803 </dl> |
|
804 </td></tr></table> |
|
805 </div> |
|
806 <a name="read"></a> |
|
807 <div> |
|
808 <table class="details" border="1" cellpadding="3" |
|
809 cellspacing="0" width="100%" bgcolor="white"> |
|
810 <tr><td> |
|
811 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
812 <tr valign="top"><td> |
|
813 <h3 class="epydoc"><span class="sig"><span class="sig-name">read</span>(<span class="sig-arg">self</span>, |
|
814 <span class="sig-arg">string</span>, |
|
815 <span class="sig-arg">fmt</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">xml</code><code class="variable-quote">'</code></span>)</span> |
|
816 </h3> |
|
817 </td><td align="right" valign="top" |
|
818 > |
|
819 </td> |
|
820 </tr></table> |
|
821 |
|
822 <p>Read a hypergraph from a string. Nodes and hyperedges specified in the |
|
823 input will be added to the current graph.</p> |
|
824 <dl class="fields"> |
|
825 <dt>Parameters:</dt> |
|
826 <dd><ul class="nomargin-top"> |
|
827 <li><strong class="pname"><code>string</code></strong> (string) - Input string specifying a graph.</li> |
|
828 <li><strong class="pname"><code>fmt</code></strong> (string) - Input format. Possible formats are: |
|
829 <ol start="1"> |
|
830 <li> |
|
831 'xml' - XML (default) |
|
832 </li> |
|
833 </ol></li> |
|
834 </ul></dd> |
|
835 </dl> |
|
836 </td></tr></table> |
|
837 </div> |
|
838 <a name="write"></a> |
|
839 <div> |
|
840 <table class="details" border="1" cellpadding="3" |
|
841 cellspacing="0" width="100%" bgcolor="white"> |
|
842 <tr><td> |
|
843 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
844 <tr valign="top"><td> |
|
845 <h3 class="epydoc"><span class="sig"><span class="sig-name">write</span>(<span class="sig-arg">self</span>, |
|
846 <span class="sig-arg">fmt</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">xml</code><code class="variable-quote">'</code></span>)</span> |
|
847 </h3> |
|
848 </td><td align="right" valign="top" |
|
849 > |
|
850 </td> |
|
851 </tr></table> |
|
852 |
|
853 <p>Write the hypergraph to a string. Depending of the output format, this |
|
854 string can be used by read() to rebuild the graph.</p> |
|
855 <dl class="fields"> |
|
856 <dt>Parameters:</dt> |
|
857 <dd><ul class="nomargin-top"> |
|
858 <li><strong class="pname"><code>fmt</code></strong> (string) - Output format. Possible formats are: |
|
859 <ol start="1"> |
|
860 <li> |
|
861 'xml' - XML (default) |
|
862 </li> |
|
863 <li> |
|
864 'dot' - DOT Language (for GraphViz) |
|
865 </li> |
|
866 <li> |
|
867 'dotclr' - DOT Language, coloured |
|
868 </li> |
|
869 </ol></li> |
|
870 </ul></dd> |
|
871 <dt>Returns: string</dt> |
|
872 <dd>String specifying the graph.</dd> |
|
873 </dl> |
|
874 </td></tr></table> |
|
875 </div> |
|
876 <a name="accessibility"></a> |
|
877 <div> |
|
878 <table class="details" border="1" cellpadding="3" |
|
879 cellspacing="0" width="100%" bgcolor="white"> |
|
880 <tr><td> |
|
881 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
882 <tr valign="top"><td> |
|
883 <h3 class="epydoc"><span class="sig"><span class="sig-name">accessibility</span>(<span class="sig-arg">self</span>)</span> |
|
884 </h3> |
|
885 </td><td align="right" valign="top" |
|
886 > |
|
887 </td> |
|
888 </tr></table> |
|
889 |
|
890 <p>Accessibility matrix (transitive closure).</p> |
|
891 <dl class="fields"> |
|
892 <dt>Returns: dictionary</dt> |
|
893 <dd>Accessibility information for each node.</dd> |
|
894 </dl> |
|
895 </td></tr></table> |
|
896 </div> |
|
897 <a name="connected_components"></a> |
|
898 <div> |
|
899 <table class="details" border="1" cellpadding="3" |
|
900 cellspacing="0" width="100%" bgcolor="white"> |
|
901 <tr><td> |
|
902 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
903 <tr valign="top"><td> |
|
904 <h3 class="epydoc"><span class="sig"><span class="sig-name">connected_components</span>(<span class="sig-arg">self</span>)</span> |
|
905 </h3> |
|
906 </td><td align="right" valign="top" |
|
907 > |
|
908 </td> |
|
909 </tr></table> |
|
910 |
|
911 <p>Connected components.</p> |
|
912 <dl class="fields"> |
|
913 <dt>Returns: dictionary</dt> |
|
914 <dd>Pairing that associates each node to its connected component.</dd> |
|
915 </dl> |
|
916 </td></tr></table> |
|
917 </div> |
|
918 <a name="cut_hyperedges"></a> |
|
919 <div> |
|
920 <table class="details" border="1" cellpadding="3" |
|
921 cellspacing="0" width="100%" bgcolor="white"> |
|
922 <tr><td> |
|
923 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
924 <tr valign="top"><td> |
|
925 <h3 class="epydoc"><span class="sig"><span class="sig-name">cut_hyperedges</span>(<span class="sig-arg">self</span>)</span> |
|
926 </h3> |
|
927 </td><td align="right" valign="top" |
|
928 > |
|
929 </td> |
|
930 </tr></table> |
|
931 |
|
932 <p>Return the cut-hyperedges of the given hypergraph.</p> |
|
933 <dl class="fields"> |
|
934 <dt>Returns: list</dt> |
|
935 <dd>List of cut-nodes.</dd> |
|
936 </dl> |
|
937 </td></tr></table> |
|
938 </div> |
|
939 <a name="cut_nodes"></a> |
|
940 <div> |
|
941 <table class="details" border="1" cellpadding="3" |
|
942 cellspacing="0" width="100%" bgcolor="white"> |
|
943 <tr><td> |
|
944 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
945 <tr valign="top"><td> |
|
946 <h3 class="epydoc"><span class="sig"><span class="sig-name">cut_nodes</span>(<span class="sig-arg">self</span>)</span> |
|
947 </h3> |
|
948 </td><td align="right" valign="top" |
|
949 > |
|
950 </td> |
|
951 </tr></table> |
|
952 |
|
953 <p>Return the cut-nodes of the given hypergraph.</p> |
|
954 <dl class="fields"> |
|
955 <dt>Returns: list</dt> |
|
956 <dd>List of cut-nodes.</dd> |
|
957 </dl> |
|
958 </td></tr></table> |
|
959 </div> |
|
960 <a name="rank"></a> |
|
961 <div> |
|
962 <table class="details" border="1" cellpadding="3" |
|
963 cellspacing="0" width="100%" bgcolor="white"> |
|
964 <tr><td> |
|
965 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
966 <tr valign="top"><td> |
|
967 <h3 class="epydoc"><span class="sig"><span class="sig-name">rank</span>(<span class="sig-arg">self</span>)</span> |
|
968 </h3> |
|
969 </td><td align="right" valign="top" |
|
970 > |
|
971 </td> |
|
972 </tr></table> |
|
973 |
|
974 <p>Return the rank of the given hypergraph.</p> |
|
975 <dl class="fields"> |
|
976 <dt>Returns: int</dt> |
|
977 <dd>Rank of graph.</dd> |
|
978 </dl> |
|
979 </td></tr></table> |
|
980 </div> |
|
981 <br /> |
|
982 <!-- ==================== NAVIGATION BAR ==================== --> |
|
983 <table class="navbar" border="0" width="100%" cellpadding="0" |
|
984 bgcolor="#a0c0ff" cellspacing="0"> |
|
985 <tr valign="middle"> |
|
986 <!-- Home link --> |
|
987 <th> <a |
|
988 href="graph-module.html">Home</a> </th> |
|
989 |
|
990 <!-- Tree link --> |
|
991 <th> <a |
|
992 href="module-tree.html">Trees</a> </th> |
|
993 |
|
994 <!-- Index link --> |
|
995 <th> <a |
|
996 href="identifier-index.html">Indices</a> </th> |
|
997 |
|
998 <!-- Help link --> |
|
999 <th> <a |
|
1000 href="help.html">Help</a> </th> |
|
1001 |
|
1002 <!-- Project homepage --> |
|
1003 <th class="navbar" align="right" width="100%"> |
|
1004 <table border="0" cellpadding="0" cellspacing="0"> |
|
1005 <tr><th class="navbar" align="center" |
|
1006 ><a class="navbar" target="_top" href="http://code.google.com/p/python-graph/">python-graph</a></th> |
|
1007 </tr></table></th> |
|
1008 </tr> |
|
1009 </table> |
|
1010 <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
|
1011 <tr> |
|
1012 <td align="left" class="footer"> |
|
1013 Generated by Epydoc 3.0.1 on Mon Oct 27 20:36:38 2008 |
|
1014 </td> |
|
1015 <td align="right" class="footer"> |
|
1016 <a target="mainFrame" href="http://epydoc.sourceforge.net" |
|
1017 >http://epydoc.sourceforge.net</a> |
|
1018 </td> |
|
1019 </tr> |
|
1020 </table> |
|
1021 |
|
1022 <script type="text/javascript"> |
|
1023 <!-- |
|
1024 // Private objects are initially displayed (because if |
|
1025 // javascript is turned off then we want them to be |
|
1026 // visible); but by default, we want to hide them. So hide |
|
1027 // them unless we have a cookie that says to show them. |
|
1028 checkCookie(); |
|
1029 // --> |
|
1030 </script> |
|
1031 </body> |
|
1032 </html> |
|