Describes a spanning tree of a graph as generated by a breadth-first traversal.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public, | allocatable, dimension(:) | :: | depth |
An array, one entry per vertex, containing the number of edges between the vertex and the root. Unreachable vertices are assigned a value of -1. |
||
| logical, | public, | allocatable, dimension(:) | :: | edge_in_tree |
An array, one entry per edge, that is true if the edge is part of the spanning tree. |
||
| integer(kind=int32), | public, | allocatable, dimension(:) | :: | parent_edge |
An array, one entry per vertex, containing the index of the edge connecting the vertex to its parent. The root vertex and any unreachable vertices are assigned a value of zero. |
||
| logical, | public, | allocatable, dimension(:) | :: | parent_edge_forward |
An array, one entry per vertex, that is true if the edge connecting the vertex to its parent is traversed from vertex_1 to vertex_2 when moving from the parent to the vertex. |
||
| integer(kind=int32), | public, | allocatable, dimension(:) | :: | parent_vertex |
An array, one entry per vertex, containing the index of the parent vertex. The root vertex and any unreachable vertices are assigned a value of zero. |
||
| integer(kind=int32), | public | :: | root | = | 0 |
The vertex from which the traversal was started. |
|
| integer(kind=int32), | public, | allocatable, dimension(:) | :: | visit_order |
An array containing the reachable vertices in the order in which they were visited. |
Gets the indices of all edges that are not part of the spanning tree.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(spanning_tree), | intent(in) | :: | this |
The spanning_tree object. |
An array containing the indices of the cut edges.
Gets the path from the root of the tree to the requested vertex.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(spanning_tree), | intent(in) | :: | this |
The spanning_tree object. |
||
| integer(kind=int32), | intent(in) | :: | v |
The index of the destination vertex. |
The resulting path. The path contains no edges if the requested vertex is the root vertex.
Determines if every vertex was reached by the traversal used to construct the tree.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(spanning_tree), | intent(in) | :: | this |
The spanning_tree object. |
True if the graph is connected; else, false.