Mescal
Loading...
Searching...
No Matches
graphs_tarjan.h
Go to the documentation of this file.
1
6#ifndef TARJAN_H_
7#define TARJAN_H_
8
9 /* ____ _ _____ _ _ */
10 /* / ___|_ __ __ _ _ __ | |__ ___ _ |_ _|_ _ _ __(_) __ _ _ __ ( )___ */
11 /* | | _| '__/ _` | '_ \| '_ \/ __(_) | |/ _` | '__| |/ _` | '_ \|// __| */
12 /* | |_| | | | (_| | |_) | | | \__ \_ | | (_| | | | | (_| | | | | \__ \ */
13 /* \____|_|_ \__,_| .__/|_| |_|___(_) |_|\__,_|_| _/ |\__,_|_| |_| |___/ */
14 /* / \ | | __ _|_|__ _ __(_) |_| |__ _ __ ___ |__/ */
15 /* / _ \ | |/ _` |/ _ \| '__| | __| '_ \| '_ ` _ \ */
16 /* / ___ \| | (_| | (_) | | | | |_| | | | | | | | | */
17 /* /_/ \_\_|\__, |\___/|_| |_|\__|_| |_|_| |_| |_| */
18 /* |___/ */
19
20//#define DEBUG_TARJAN
21
22
23#include "type_partitions.h"
24#include "graphs.h"
25#include <stdbool.h>
26
27/***********************/
28/* Classical algorithm */
29/***********************/
30
42);
43
55 bool* alph
56);
57
69 bool* alph,
70 bool ismor
71);
72
73
86 dgraph* g2,
87 bool* alph,
88 bool ismor
89);
90
91
92/**************************/
93/*+ Computations on SCCS +*/
94/**************************/
95
96
105 parti* P,
106 uint* inv,
107 uint j
108);
109
120 parti* sccs,
121 uint scc,
122 bool* alph
123);
124
125
138 parti* sccs,
139 uint* inv_sccs,
140 uint q1,
141 uint q2,
142 bool* alph
143);
144
145
154 parti* sccs
155);
156
165 parti* sccs
166);
167
168
181 parti* sccs,
182 uint q
183);
184
185
186
187#endif // TARJAN_H_
Implementation of graphs.
parti * tarjan(graph *g)
Tarjan's algorihtm for unlabeled graphs.
Definition graphs_tarjan.c:8
dgraph * dgraph_extract(dgraph *g, parti *P, uint *inv, uint j)
Extracts a single SCC of a dgraph and makes it a new dgraph.
Definition graphs_tarjan.c:629
parti * dtarjan(dgraph *g, bool *alph, bool ismor)
Tarjan's algorihtm for complete deterministic labeled graphs.
Definition graphs_tarjan.c:293
void dgraph_discard_nonscc_edges(dgraph *g, parti *sccs)
Modifies a dgraph by discarding all edges that are not internal to an SCC.
Definition graphs_tarjan.c:743
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.
Definition graphs_tarjan.c:650
parti * ltarjan(lgraph *g, bool *alph)
Tarjan's algorihtm for labeled graphs.
Definition graphs_tarjan.c:135
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.
Definition graphs_tarjan.c:758
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.
Definition graphs_tarjan.c:714
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.
Definition graphs_tarjan.c:778
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 alpha...
Definition graphs_tarjan.c:456
Type used to represent a complete deterministic directed labeled graph.
Definition graphs.h:73
Type used to represent a directed unlabeled graph.
Definition graphs.h:42
Type used to represent a directed labeled graph.
Definition graphs.h:57
First type used to represent a partition. This is not the one used by Union-Find.
Definition type_partitions.h:36
Types used to represent partitions. Includes the union-find algorithm.