goyalarchit/graph-extra/1.0.1

Random.Graph

This module is useful for generating a random graph with given number of edges and nodes.

#Generators

simpleConnectedGraph : Int -> Int -> Generator ( List Int, List ( Int, Int ) )

This function generates a random graph that is connected if number of edges >= number of nodes - 1

Note: You can also generate random trees, just pass edge count as n-1.

simpleConnectedGraphWithRandomNodeEdgeLabels : Int -> Int -> Generator n -> Generator e -> Generator (Graph n e)

Similar to simpleConnectedGraph, also generates edge labels and node labels using the given generator.