Define the edge struct and functions relating to it.
Edge struct to be used as edges in the graph structs.
Definition: edge.h:10
The vertex struct containing the neighbouring edges as pointers.
Definition: vertex.h:16
edge ** edges
The list of neighbour edge instances as pointers.
Definition: vertex.h:19
double local_weight
The sum of all weights of connected edges.
Definition: vertex.h:18
int dim
The number of slots in array (local dimension)
Definition: vertex.h:17
void vertex_add_edge_to_neighbourhood(vertex *v, edge *e)
Add the edge e to the neighbourhood v->edges.
Definition: vertex.c:23
edge * vertex_find_connecting_edge(vertex *v, int dst)
Find the edge that connects vertex v with the vertex of index dst.
Definition: vertex.c:77
vertex * vertex_new()
Allocate the memory for a new vertex with no neighbours.
Definition: vertex.c:6
void vertex_rm_edge_from_neighbourhood(vertex *v, edge *e)
Remove edge e from neighbourhood of vertex v.
Definition: vertex.c:65
void vertex_free(vertex *v)
Free the input vertex pointer and all edges pointing to it.
Definition: vertex.c:13
struct vertex vertex
The typedef of the vertex struct.