graph-generators-0.1.0.0: Functions for generating structured or random FGL graphs

Safe HaskellNone
LanguageHaskell2010

Data.Graph.Generators.Random.ErdosRenyi

Contents

Synopsis

Graph generators

erdosRenyiGraph Source

Arguments

:: GenIO

The random number generator to use

-> Int

The number of nodes

-> Double

The probability for any pair of nodes to be connected

-> IO GraphInfo

The resulting graph (IO required for randomness)

erdosRenyiGraph' Source

Arguments

:: Int

The number of nodes

-> Double

The probability for any pair of nodes to be connected

-> IO GraphInfo

The resulting graph (IO required for randomness)

Graph component generators

erdosRenyiContext Source

Arguments

:: GenIO

The random number generator to use

-> Int

Identifier of the context's central node

-> [Int]

The algorithm will generate random edges to those nodes from or to the given node

-> Double

The probability for any pair of nodes to be connected

-> IO GraphContext

The resulting graph (IO required for randomness)

Utility functions

selectWithProbability Source

Arguments

:: GenIO

The random generator state

-> Double

The probability to select each list element

-> [a]

The list to filter

-> IO [a]

The filtered list