21 #include <grass/dgl/graph.h> 52 tin = (
int *)
G_calloc(nnodes + 1,
sizeof(
int));
53 min_tin = (
int *)
G_calloc(nnodes + 1,
sizeof(
int));
57 if (!tin || !min_tin || !parent || !stack || !current) {
62 for (i = 1; i <= nnodes; i++) {
77 if (tin[current_id] == 0) {
78 stack[0] = current_node;
80 parent[current_id] = 0;
85 if (tin[node_id] == 0)
86 min_tin[node_id] = tin[node_id] = ++time;
92 if (min_tin[to] > tin[node_id]) {
96 if (min_tin[to] < min_tin[node_id])
97 min_tin[node_id] = min_tin[to];
100 for (; current_edge[node_id]; current_edge[node_id] =
dglEdgeset_T_Next(¤t[node_id])) {
105 if (labs(edge_id) == parent[node_id])
110 if (tin[to_id] < min_tin[node_id])
111 min_tin[node_id] = tin[to_id];
114 parent[to_id] = labs(edge_id);
115 stack[stack_size++] = to;
119 if (!current_edge[node_id])
126 for (i = 1; i <= nnodes; i++)
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
dglInt32_t * dglGetNode(dglGraph_s *pGraph, dglInt32_t nNodeId)
dglInt32_t dglNodeGet_Id(dglGraph_s *pGraph, dglInt32_t *pnNode)
void dglNode_T_Release(dglNodeTraverser_s *pT)
void G_free(void *)
Free allocated memory.
int dglGet_NodeCount(dglGraph_s *pgraph)
dglInt32_t * dglEdgeGet_Tail(dglGraph_s *pGraph, dglInt32_t *pnEdge)
dglInt32_t * dglNode_T_First(dglNodeTraverser_s *pT)
dglInt32_t * dglEdgeset_T_First(dglEdgesetTraverser_s *pT)
int NetA_compute_bridges(dglGraph_s *graph, struct ilist *bridge_list)
Get number of bridges in the graph.
void dglEdgeset_T_Release(dglEdgesetTraverser_s *pT)
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
int dglNode_T_Initialize(dglNodeTraverser_s *pT, dglGraph_s *pGraph)
dglInt32_t * dglEdgeset_T_Next(dglEdgesetTraverser_s *pT)
dglInt32_t * dglNodeGet_OutEdgeset(dglGraph_s *pGraph, dglInt32_t *pnNode)
int dglEdgeset_T_Initialize(dglEdgesetTraverser_s *pT, dglGraph_s *pGraph, dglInt32_t *pnEdgeset)
dglInt32_t * dglNode_T_Next(dglNodeTraverser_s *pT)
dglInt32_t dglEdgeGet_Id(dglGraph_s *pGraph, dglInt32_t *pnEdge)