MatheusFarias03 opened a new pull request, #917:
URL: https://github.com/apache/age/pull/917

   Hi there! I've added a new function to generate Barabasi-Albert graphs, 
which I believe could be a valuable addition to this project and also is 
labeled as an enhancement tag at #278 . I've also included a screenshot of the 
graph visualization to demonstrate what the generated graph looks like with 50 
nodes and with bidirectional edges.
   
   ![Barabasi-Albert 
Graph](https://github.com/apache/age/assets/83461020/a9a0605a-ff7e-4067-bbba-c3c87f632500)
   
   
   The function is implemented in `src/backend/utils/graph_generation.c` and it 
is defined as:
   
   ```sql
   ag_catalog.age_create_barabasi_albert_graph(graph_name name, 
                                                               num_vertices int,
                                                               num_edges int,
                                                               node_label name 
= NULL,
                                                               edge_label name 
= NULL,
                                                               bidirectional 
bool = true)
   ```
   
   And the input is as follows:
   ```markdown
   Input:
   
   1. graph_name - Name of the graph to be created
   2. n - The number of vertices
   3. m - Number of edges to attach from a new node to existing nodes
   4. vertex_label_name - Name of the label to assign each vertex to.
   5. edge_label_name - Name of the label to assign each edge to.
   6. bidirectional - Bidirectional True or False. Default True.
   ```
   
   Additionally, I've added some auxiliary functions to handle the graph, since 
I could not call the functions that use `GRAPH_global_context`, `vertex_entity` 
and `edge_entity` in the file that I was working on and I didn't want to change 
them because it would probably have some effects on other files.
   
   Please let me know if you have any feedback or suggestions for improvements. 
Thank you for considering my contribution!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to