grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

spanningtree.c File Reference

Network Analysis library - spanning tree. 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 spanningtree.c:

Go to the source code of this file.


struct  union_find
struct  edge_cost_pair


static int uf_initialize (struct union_find *uf, int size)
static void uf_release (struct union_find *uf)
static int uf_find (struct union_find *uf, int v)
static void uf_union (struct union_find *uf, int u, int v)
static int cmp_edge (const void *pa, const void *pb)
int NetA_spanning_tree (dglGraph_s *graph, struct ilist *tree_list)
 Get number of edges in the spanning forest. More...

Detailed Description

Network Analysis library - spanning tree.

Computes minimum spanning tree in the network.

(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.

Daniel Bundala (Google Summer of Code 2009)

Definition in file spanningtree.c.

Function Documentation

◆ cmp_edge()

static int cmp_edge ( const void *  pa,
const void *  pb 

Definition at line 74 of file spanningtree.c.

Referenced by NetA_spanning_tree().

◆ NetA_spanning_tree()

◆ uf_find()

static int uf_find ( struct union_find uf,
int  v 

Definition at line 44 of file spanningtree.c.

References cur, union_find::parent, and tmp.

Referenced by NetA_spanning_tree(), and uf_union().

◆ uf_initialize()

static int uf_initialize ( struct union_find uf,
int  size 

Definition at line 28 of file spanningtree.c.

References union_find::parent.

Referenced by NetA_spanning_tree().

◆ uf_release()

static void uf_release ( struct union_find uf)

Definition at line 39 of file spanningtree.c.

References G_free(), and union_find::parent.

Referenced by NetA_spanning_tree().

◆ uf_union()

static void uf_union ( struct union_find uf,
int  u,
int  v 

Definition at line 59 of file spanningtree.c.

References union_find::parent, u, and uf_find().

Referenced by NetA_spanning_tree().