GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
Loading...
Searching...
No Matches
components.c File Reference

Network Analysis library - graph components. More...

#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/vector.h>
#include <grass/glocale.h>
#include <grass/dgl/graph.h>
Include dependency graph for components.c:

Go to the source code of this file.

Functions

int NetA_weakly_connected_components (dglGraph_s *graph, int *component)
 Computes weakly connected components.
 
int NetA_strongly_connected_components (dglGraph_s *graph, int *component)
 Computes strongly connected components with Kosaraju's two-pass algorithm.
 

Detailed Description

Network Analysis library - graph components.

Computes strongly and weakly connected components.

(C) 2009-2010 by Daniel Bundala, and the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Daniel Bundala (Google Summer of Code 2009)
Markus Metz

Definition in file components.c.

Function Documentation

◆ NetA_strongly_connected_components()

int NetA_strongly_connected_components ( dglGraph_s graph,
int component 
)

Computes strongly connected components with Kosaraju's two-pass algorithm.

Parameters
graphinput graph
[out]componentarray of component ids
Returns
number of components
-1 on failure

Definition at line 159 of file components.c.

References _, dglEdgeGet_Head(), dglEdgeGet_Tail(), dglEdgeset_T_First(), dglEdgeset_T_Initialize(), dglEdgeset_T_Next(), dglEdgeset_T_Release(), dglGet_NodeAttrSize(), dglGet_NodeCount(), dglGetNode(), dglNode_T_First(), dglNode_T_Initialize(), dglNode_T_Next(), dglNode_T_Release(), dglNodeGet_Attr(), dglNodeGet_Id(), dglNodeGet_InEdgeset(), dglNodeGet_OutEdgeset(), G_calloc, G_fatal_error(), G_free(), G_warning(), and order().

◆ NetA_weakly_connected_components()

int NetA_weakly_connected_components ( dglGraph_s graph,
int component 
)