Additional data structures¶
Linked lists¶
LinkedListNode
¶
Linked list node.
Source code in tralda/datastructures/linked.py
__init__(value: Any, next_node: LinkedListNode | None = None) -> None
¶
Constructor of the inked list node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value that the list node shall hold. |
required |
next_node
|
LinkedListNode | None
|
The successor node in the doubly-linked list. |
None
|
Source code in tralda/datastructures/linked.py
LinkedList
¶
Linked list.
Source code in tralda/datastructures/linked.py
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
__init__(*args: Any) -> None
¶
Constructor of the inked list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Any
|
A single value or an iterable of values to be added to the list. |
()
|
Source code in tralda/datastructures/linked.py
__len__() -> int
¶
__bool__() -> bool
¶
Returns whether the list is non-empty.
Returns:
| Type | Description |
|---|---|
bool
|
True if the list is non-empty, False otherwise. |
__iter__() -> LinkedListIterator
¶
Returns an iterator object for the list.
Returns:
| Type | Description |
|---|---|
LinkedListIterator
|
An iterator for this list. |
__getitem__(index: int) -> Any
¶
Access value at a specified index.
Returns:
| Type | Description |
|---|---|
Any
|
The value at the specified index. |
first() -> Any
¶
last() -> Any
¶
first_node() -> LinkedListNode
¶
node_at(index: int) -> LinkedListNode
¶
Return the list node at the specified index (in O(n) time).
The index can also be negative in which case it is counted from the end (as for built-in Python lists).
Returns:
| Type | Description |
|---|---|
LinkedListNode
|
The list node at the specified index. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If 'index' is not an integer. |
IndexError
|
If the index is out of bounds. |
Source code in tralda/datastructures/linked.py
append(value: Any) -> LinkedListNode
¶
Append an item to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be inserted at the end of the list. |
required |
Returns:
| Type | Description |
|---|---|
LinkedListNode
|
The new end node of the list. |
Source code in tralda/datastructures/linked.py
extend(iterable: Iterable) -> None
¶
Append multiple items to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iterable
|
Iterable
|
An iterable of values to be inserted at the end of the list. |
required |
concatenate(other: LinkedList) -> LinkedList
¶
Merges two linked lists.
The instance for which this function is called is extended, the other list should no longer be used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
LinkedList
|
The liked list to concatenate with this list. |
required |
Returns:
| Type | Description |
|---|---|
LinkedList
|
This LikedList instance. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If 'other' is not a LinkedList instance. |
Source code in tralda/datastructures/linked.py
append_left(value: Any) -> LinkedListNode
¶
Append an item to left side of the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be inserted at the beginning of the list. |
required |
Returns:
| Type | Description |
|---|---|
LinkedListNode
|
The new start node of the list. |
Source code in tralda/datastructures/linked.py
remove(value: Any) -> Any
¶
Remove an item by value (in O(n) time).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be removed. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the value was not found in the list. |
Source code in tralda/datastructures/linked.py
insert_right_of(node: LinkedListNode, value: Any) -> LinkedListNode
¶
Insert a new item right of a node of the list in O(1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
LinkedListNode
|
The list node next to which the item shall be inserted. |
required |
value
|
Any
|
The value to be inserted. |
required |
Returns:
| Type | Description |
|---|---|
LinkedListNode
|
The list node for the inserted value. |
Source code in tralda/datastructures/linked.py
truncate(index: int) -> None
¶
Truncate all nodes starting from the specified index in O(n) time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
The index from which on the list is truncated. |
required |
Source code in tralda/datastructures/linked.py
truncate_left(n: int) -> None
¶
Truncate n nodes on the left side.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of items to be truncated. |
required |
Source code in tralda/datastructures/linked.py
popleft() -> Any
¶
Removes the first item of the list and returns its value.
Returns:
| Type | Description |
|---|---|
Any
|
The former first item of the list which has been removed. |
Raises:
| Type | Description |
|---|---|
IndexError
|
If the list is empty. |
Source code in tralda/datastructures/linked.py
Doubly linked lists¶
DLListNode
¶
Doubly-linked list node.
Source code in tralda/datastructures/doubly_linked.py
__init__(value: Any, prev_node: DLListNode | None = None, next_node: DLListNode | None = None) -> None
¶
Constructor of the doubly-linked list node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value that the list node shall hold. |
required |
prev_node
|
DLListNode | None
|
The predecessor node in the doubly-linked list. |
None
|
next_node
|
DLListNode | None
|
The successor node in the doubly-linked list. |
None
|
Source code in tralda/datastructures/doubly_linked.py
DLList
¶
Doubly-linked list.
Source code in tralda/datastructures/doubly_linked.py
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | |
__init__(*args: Any) -> None
¶
Constructor of the doubly-linked list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Any
|
A single value or an iterable of values to be added to the list. |
()
|
Source code in tralda/datastructures/doubly_linked.py
__len__() -> int
¶
__bool__() -> bool
¶
Returns whether the list is non-empty.
Returns:
| Type | Description |
|---|---|
bool
|
True if the list is non-empty, False otherwise. |
__iter__() -> DLListIterator
¶
Returns an iterator object for the list.
Returns:
| Type | Description |
|---|---|
DLListIterator
|
An iterator for this list. |
__getitem__(index: int) -> Any
¶
Access value at a specified index.
Returns:
| Type | Description |
|---|---|
Any
|
The value at the specified index. |
first() -> Any
¶
last() -> Any
¶
first_node() -> DLListNode
¶
node_at(index: int) -> DLListNode
¶
Return the list node at the specified index (in O(n) time).
The index can also be negative in which case it is counted from the end (as for built-in Python lists).
Returns:
| Type | Description |
|---|---|
DLListNode
|
The list node at the specified index. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If 'index' is not an integer. |
IndexError
|
If the index is out of bounds. |
Source code in tralda/datastructures/doubly_linked.py
append(value: Any) -> DLListNode
¶
Append an item to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be inserted at the end of the list. |
required |
Returns:
| Type | Description |
|---|---|
DLListNode
|
The new end node of the list. |
Source code in tralda/datastructures/doubly_linked.py
extend(iterable: Iterable) -> None
¶
Append multiple items to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iterable
|
Iterable
|
An iterable of values to be inserted at the end of the list. |
required |
append_left(value: Any) -> DLListNode
¶
Append an item to left side of the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be inserted at the beginning of the list. |
required |
Returns:
| Type | Description |
|---|---|
DLListNode
|
The new start node of the list. |
Source code in tralda/datastructures/doubly_linked.py
remove_node(node: DLListNode) -> None
¶
Remove an item by reference to the 'DLListNode' instance in O(1) time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
DLListNode
|
The node to be removed. |
required |
Source code in tralda/datastructures/doubly_linked.py
remove(value: Any) -> None
¶
Remove an item by value (in O(n) time).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be removed. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the value was not found in the list. |
Source code in tralda/datastructures/doubly_linked.py
remove_range(index: int, length: int = None) -> None
¶
Removes a range from the index of the specified length.
Removes the range [index, index+length) from the sequence. If no length is specified or index + length is out of bounds, the list gets truncated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
The start of the range to be removed. |
required |
length
|
int
|
The length of the range to be removed. |
None
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If index is not an integer. |
TypeError
|
If length is not an integer or below 1. |
Source code in tralda/datastructures/doubly_linked.py
insert_right_of(node: DLListNode, value: Any) -> DLListNode
¶
Insert a new item right of a node of the list in O(1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
DLListNode
|
The list node next to which the item shall be inserted. |
required |
value
|
Any
|
The value to be inserted. |
required |
Returns:
| Type | Description |
|---|---|
DLListNode
|
The list node for the inserted value. |
Source code in tralda/datastructures/doubly_linked.py
truncate(index: int) -> None
¶
Truncate all nodes starting from the specified index in O(n) time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
The index from which on the list is truncated. |
required |
Source code in tralda/datastructures/doubly_linked.py
truncate_left(n: int) -> None
¶
Truncate n nodes on the left side.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of items to be truncated. |
required |
Source code in tralda/datastructures/doubly_linked.py
popright() -> Any
¶
Removes the last item of the list and returns its value.
Returns:
| Type | Description |
|---|---|
Any
|
The former last item of the list which has been removed. |
Raises:
| Type | Description |
|---|---|
IndexError
|
If the list is empty. |
Source code in tralda/datastructures/doubly_linked.py
popleft() -> Any
¶
Removes the first item of the list and returns its value.
Returns:
| Type | Description |
|---|---|
Any
|
The former first item of the list which has been removed. |
Raises:
| Type | Description |
|---|---|
IndexError
|
If the list is empty. |
Source code in tralda/datastructures/doubly_linked.py
clear() -> None
¶
sublist(left_node: DLListNode, right_node: DLListNode) -> list
¶
Sublist of items in the subsequence between two nodes of the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left_node
|
DLListNode
|
The left bound of the subsequence. |
required |
right_node
|
DLListNode
|
The right bound of the subsequence. |
required |
Returns:
| Type | Description |
|---|---|
list
|
The values in the subsequence in the standard Python list. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If 'right_node' is not a successor of 'left_node' in the list. |
Source code in tralda/datastructures/doubly_linked.py
Dynamic partition and connectivity data structures¶
Partition
¶
Dynamic partition implementation.
Source code in tralda/datastructures/partition.py
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 | |
__init__(iterable: Iterable) -> None
¶
Constructor of the partition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iterable
|
Iterable
|
An iterable of iterables defining the initial partition. |
required |
Source code in tralda/datastructures/partition.py
__len__() -> int
¶
Current number of sets in the partition.
Returns:
| Type | Description |
|---|---|
int
|
The current number of sets in the partition. |
__iter__() -> PartitionIterator
¶
An iterator for the dynamic partition.
Returns:
| Type | Description |
|---|---|
PartitionIterator
|
An iterator for this partition. |
in_same_set(x: Any, y: Any) -> bool
¶
Check whether two items are in the same set of the partition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Any
|
Item 1. |
required |
y
|
Any
|
Item 2. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if x and y are in the same set of the partition, False otherwise. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If x or y is not an item in the partition. |
Source code in tralda/datastructures/partition.py
separated_xy_z(x: Any, y: Any, z: Any) -> bool
¶
Check whether two items are in the same set but in a different set than the third.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Any
|
Item 1. |
required |
y
|
Any
|
Item 2. |
required |
z
|
Any
|
Item 3. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if x and y are in the same set of the partition and z is in a different one, False otherwise. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If x, y, or z is not an item in the partition. |
Source code in tralda/datastructures/partition.py
merge(repr1: Any, repr2: Any) -> set[Any]
¶
Merge two sets of the partition based on arbitrary representatives.
The merging is done efficiently by adding the elements of the smaller set to the bigger set. That way, each element is moved at most log(n) times into a new set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repr1
|
Any
|
Arbitrary representative of the first set. |
required |
repr2
|
Any
|
Arbitrary representative of the second set. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If 'repr1' or 'repr2' is not an item in the partition. |
Returns:
| Type | Description |
|---|---|
set[Any]
|
The smaller of the original two sets that now have been merged. When both sets have
equal size, the set containing |
Source code in tralda/datastructures/partition.py
HDTGraph
¶
Undirected graph datastructure for poly-logarithmic connectivity queries.
Implementation of the poly-logarithmic dynamic graph structure (HDT datastructure).
References
- Jacob Holm, Kristian de Lichtenberg, and Mikkel Thorup. Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity. J. ACM, 48(4):723-760, July 2001.
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
__init__() -> None
¶
Constructor of the undirected graph for poly-logarithmic connectivity queries.
get_nodes() -> Iterator[Any]
¶
Generator for the nodes in the graph.
Yields:
| Type | Description |
|---|---|
Any
|
The nodes in the graph. |
get_edges() -> Iterator[tuple[Any, Any]]
¶
Generator for the edges in the graph.
Yields:
| Type | Description |
|---|---|
tuple[Any, Any]
|
The edges in the graph. |
has_node(node: Any) -> bool
¶
Determine whether a node is in the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Any
|
The node for which to check if it is in the graph. |
required |
Return
Whether the node is contained in the graph.
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
has_edge(u: Any, v: Any) -> bool
¶
Determine whether an edge is in the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Any
|
The first node. |
required |
v
|
Any
|
The second node. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the graph has the undirected edge (u, v). |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
connected(u: Any, v: Any, level: int = 0) -> bool
¶
Determine in O(log n) whether u and v are connected in the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Any
|
The first node. |
required |
v
|
Any
|
The second node. |
required |
level
|
int
|
If provided, check for connectivity on that level. The default is 0 which checks for connectivity in the full current graph. |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether u and v are connected by a path in the graph. |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
get_component(node: Any) -> ETTree
¶
Return the connected component (ETT) of a given value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Any
|
A node in the graph. |
required |
Returns:
| Type | Description |
|---|---|
ETTree
|
The connected component that contains the node. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the node is not in the graph. |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
insert_node(node: Any) -> None
¶
Insert a loose node into the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Any
|
The node to add to the graph. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the node is already in the graph. |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
insert_edge(u: Any, v: Any) -> None
¶
Insert an edge (u, v) into the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Any
|
The first node. |
required |
v
|
Any
|
The second node. |
required |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
delete_edge(u: Any, v: Any) -> None
¶
Delete an edge from the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Any
|
The first endpoint of the edge. |
required |
v
|
Any
|
The second endpoint of the edge. |
required |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
add_loose_tree(tree: Tree) -> None
¶
Add the edges of a (rooted) tree as undirected edges.
The elements of the 'Tree' instance must not yet be nodes in the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tree
|
Tree
|
The tree whose nodes and edges shall be added to the graph. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If tree is not an instance of type Tree. |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
is_connected() -> bool
¶
Determine if the graph is connected (on level 0).
Returns:
| Type | Description |
|---|---|
bool
|
Whether the graph is connected. |
component_iterator(representative: Any) -> Iterator[Any]
¶
Iterator over the connected component of a given value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
representative
|
Any
|
A representative node of the component. |
required |
Yields:
| Type | Description |
|---|---|
Any
|
The nodes in the connected component. |
Source code in tralda/datastructures/hdtgraph/dynamic_graph.py
print_ett_forest(level: str | int = 'all') -> None
¶
Print Euler tour of the spanning forest.
Intended for testing purpose.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str | int
|
Level of the ETT spanning forest to be printed. The default is "all" in which case all levels are printed. |
'all'
|