tarjan.h
Go to the documentation of this file.
1/*
2Copyright (C) 2012 (c) Jostein R. Natvig <jostein natvig at gmail.com>
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of
5this software and associated documentation files (the "Software"), to deal in
6the Software without restriction, including without limitation the rights to
7use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8of the Software, and to permit persons to whom the Software is furnished to do
9so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22
34#ifndef TARJAN_H_INCLUDED
35#define TARJAN_H_INCLUDED
36
37#include <stddef.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif /* __cplusplus */
42
49struct TarjanWorkSpace;
50
56struct TarjanSCCResult;
57
64{
68 size_t size;
69
77 const int *vertex;
78};
79
90struct TarjanWorkSpace *
91create_tarjan_workspace(const size_t nvert);
92
99void
100destroy_tarjan_workspace(struct TarjanWorkSpace *ws);
101
108void
109destroy_tarjan_sccresult(struct TarjanSCCResult *scc);
110
119size_t
120tarjan_get_numcomponents(const struct TarjanSCCResult *scc);
121
133struct TarjanComponent
134tarjan_get_strongcomponent(const struct TarjanSCCResult *scc,
135 const size_t compID);
136
157struct TarjanSCCResult *
158tarjan(const size_t nv,
159 const size_t *ia,
160 const int *ja);
161
193struct TarjanSCCResult *
194tarjan_reachable_sccs(const size_t nv,
195 const size_t *ia,
196 const int *ja,
197 const size_t nstart,
198 const int *start_pts,
199 struct TarjanWorkSpace *ws);
200
224int
225tarjan_reverse_sccresult(struct TarjanSCCResult *scc);
226
227#ifdef __cplusplus
228}
229#endif /* __cplusplus */
230
231#endif /* TARJAN_H_INCLUDED */
232
233/* Local Variables: */
234/* c-basic-offset:4 */
235/* End: */
Definition: tarjan.h:64
const int * vertex
Definition: tarjan.h:77
size_t size
Definition: tarjan.h:68
struct TarjanSCCResult * tarjan(const size_t nv, const size_t *ia, const int *ja)
struct TarjanComponent tarjan_get_strongcomponent(const struct TarjanSCCResult *scc, const size_t compID)
size_t tarjan_get_numcomponents(const struct TarjanSCCResult *scc)
void destroy_tarjan_sccresult(struct TarjanSCCResult *scc)
struct TarjanWorkSpace * create_tarjan_workspace(const size_t nvert)
void destroy_tarjan_workspace(struct TarjanWorkSpace *ws)