gft_graph.h
Go to the documentation of this file.
1 
2 #ifndef _GFT_GRAPH_H_
3 #define _GFT_GRAPH_H_
4 
5 #include "gft_common.h"
6 
7 namespace gft{
8  namespace Graph{
9 
10  typedef struct _Node {
11  int outdegree;
12  int arraysize;
13  /*Adjacency lists (lists of nodes that are connected to a given node)*/
14  int *adjList;
15  float *Warcs;
16  } GraphNode;
17 
18  typedef struct _Graph {
19  int nnodes;
21  float *Wnodes;
22  } Graph;
23 
24  /* A utility function that creates a graph of 'nnodes' vertices */
25  Graph *Create(int nnodes, int outdegree, float *Wnodes);
26 
27  void Destroy(Graph **graph);
28 
29  /* Adds an edge to an undirected graph */
30  void addEdge(Graph *graph, int src, int dest, float w);
31 
32  /* Adds an arc to a directed graph */
33  void addDirectedEdge(Graph *graph, int src, int dest, float w);
34 
35  } //end Graph namespace
36 } //end gft namespace
37 
38 
39 #endif
40 
int * adjList
Definition: gft_graph.h:14
int nnodes
Definition: gft_graph.h:19
void addDirectedEdge(Graph *graph, int src, int dest, float w)
Definition: gft_graph.cpp:59
struct gft::Graph::_Node GraphNode
Header file for common definitions and function prototypes.
Definition: gft_graph.h:10
Definition: gft_graph.h:18
void addEdge(Graph *graph, int src, int dest, float w)
Definition: gft_graph.cpp:53
Graph * Create(int nnodes, int outdegree, float *Wnodes)
Definition: gft_graph.cpp:8
int arraysize
Definition: gft_graph.h:12
GraphNode * nodes
Definition: gft_graph.h:20
struct gft::Graph::_Graph Graph
float * Wnodes
Definition: gft_graph.h:21
int outdegree
Definition: gft_graph.h:11
void Destroy(Graph **graph)
Definition: gft_graph.cpp:31
float * Warcs
Definition: gft_graph.h:15