Mescal
|
Implementation of Tarjan's algorithm. More...
Go to the source code of this file.
Functions | |
parti * | tarjan (graph *g) |
Tarjan's algorihtm for unlabeled graphs. | |
parti * | ltarjan (lgraph *g, bool *alph) |
Tarjan's algorihtm for labeled graphs. | |
parti * | dtarjan (dgraph *g, bool *alph, bool ismor) |
Tarjan's algorihtm for complete deterministic labeled graphs. | |
parti * | dualdtarjan (dgraph *g1, dgraph *g2, bool *alph, bool ismor) |
Tarjan's algorihtm for two complete deterministic labeled graphs sharing the same state set and alphabet. Computation is done in the merge of the two graphs. | |
dgraph * | dgraph_extract (dgraph *g, parti *P, uint *inv, uint j) |
Extracts a single SCC of a dgraph and makes it a new dgraph. | |
void | dgraph_compute_alph_scc (dgraph *g, parti *sccs, uint scc, bool *alph) |
Computes the alphabet of a strongly connected component of a labeled graph. | |
bool | dgraph_common_alph_loop (dgraph *g, parti *sccs, uint *inv_sccs, uint q1, uint q2, bool *alph) |
Computes the alphabet of a strongly connected component of a labeled graph. | |
void | dgraph_discard_nonscc_edges (dgraph *g, parti *sccs) |
Modifies a dgraph by discarding all edges that are not internal to an SCC. | |
dgraph * | dgraph_copy_discard_nonscc_edges (dgraph *g, parti *sccs) |
Copies a dgraph while discarding all edges that go from a state to a different SCC. | |
bool | dgraph_ntrivial_loop (dgraph *g, parti *sccs, uint q) |
Tests if there exists a non-trivial loop on a given state q of a dgraph. | |
Implementation of Tarjan's algorithm.
bool dgraph_common_alph_loop | ( | dgraph * | g, |
parti * | sccs, | ||
uint * | inv_sccs, | ||
uint | q1, | ||
uint | q2, | ||
bool * | alph ) |
Computes the alphabet of a strongly connected component of a labeled graph.
g | The graph. |
sccs | The partition of the graph into strongly connected components. |
inv_sccs | The inverse mapping of the partition. |
q1 | The index of the state in the first SCC. |
q2 | The index of the state in the second SCC. |
alph | The alphabet of the SCC (an array indexed by the letters). |
Computes the alphabet of a strongly connected component of a labeled graph.
g | The graph. |
sccs | The partition of the graph into strongly connected components. |
scc | The index of the SCC. |
alph | The array used to store the computed alphabet (an array indexed by the letters). |
Copies a dgraph while discarding all edges that go from a state to a different SCC.
g | The dgraph to copy. |
sccs | The SCCs of the dgraph. |
Modifies a dgraph by discarding all edges that are not internal to an SCC.
g | The dgraph to modify. |
sccs | The partition of the dgraph into sccs. |
Extracts a single SCC of a dgraph and makes it a new dgraph.
g | The dgraph to extract the SCC from. |
P | The partition of the dgraph. |
inv | The inverse mapping of the partition. |
j | The index of the SCC to extract. |
Tests if there exists a non-trivial loop on a given state q of a dgraph.
g | The dgraph to test. |
sccs | The SCCs of the dgraph. |
q | The state q. |
Tarjan's algorihtm for complete deterministic labeled graphs.
g | The complete deterministic labeled graph. |
alph | An array of Booleans indexed by the labels. Only the edges labeled by a letter marked true are considered. NULL means all labels are considered. |
ismor | If true, the algorithm is run on a Cayley graph (all vertices are reachable from ONE = 0). |
Tarjan's algorihtm for two complete deterministic labeled graphs sharing the same state set and alphabet. Computation is done in the merge of the two graphs.
g1 | The first complete deterministic labeled graph. |
g2 | The second complete deterministic labeled graph. |
alph | An array of Booleans indexed by the labels. Only the edges labeled by a letter marked true are considered. NULL means all labels are considered. |
ismor | If true, the algorithm is run on Cayley graphs (all vertices are reachable from ONE = 0). |
Tarjan's algorihtm for labeled graphs.
g | The labeled graph. |
alph | An array of Booleans indexed by the labels. Only the edges labeled by a letter marked true are considered. NULL means all labels are considered. |