I've been studying some of AGE's source code so that I can create functions to generate different kinds of graphs, such as the Barabási–Albert graph. Although another function like the create_complete_graph
does show how to create a graph and insert vertices and edges into it, it does not use functions that require the GRAPH_global_context
structure to be used.
Some of these functions, such as the ListGraphId *get_vertex_entry_edges_out(vertex_entry* ve)
needs to pass a vertex_entry
data type which the only way to retrieve it is by using:
vertex_entry *get_vertex_entry(GRAPH_global_context *ggctx, graphid vertex_id);
This would help creating the Barabasi-Albert graph because the creation of it depends on the amount of edges each vertex has, so it would be faster to retrieve the edges that comes in and out the vertices with the function above.
But, it is not written in the source code how or when to create a GRAPH_global_context
or how to properly. How can I implement this for the creation of the graph?