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

   This PR adds a new function `age_create_erdos_renyi_graph` that generates a 
random graph with n nodes, where the probability for each node to connect to 
another one is based on a given probability. The edges can be set to be in one 
direction or in both directions. It is also possible to set the labels for both 
vertices and edges. 
   
   It uses the _G(n,p)_ model, where the graph is constructed by connecting 
labeled nodes randomly. Each edge is included in the graph with probability p, 
independently from every other edge. Equivalently, the probability for 
generating each graph that has n nodes and M edges is 
   
   ![Graph Generation 
Prob](https://github.com/apache/age/assets/83461020/4cfd195c-2c08-45fc-be84-c8fba3f555eb)
   
   Syntax:
   ```sql
   ag_catalog.age_create_erdos_renyi_graph(graph_name name, 
                                                   n int, 
                                                   p name,
                                                   vertex_label_name name = 
NULL,
                                                   edge_label_name name = NULL,
                                                   bidirectional bool = true)
   ```
   
   Additionally, the probability `p` was set to be of type `name`  because 
neither `PG_GETARG_FLOAT4(2)` or `DatumGetFloat4(PG_GETARG_DATUM(2));` were 
working.
   


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