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

Safe HaskellNone

Data.Graph.Generators.Random.ErdosRenyi

Contents

Synopsis

Graph generators

erdosRenyiGraphSource

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

erdosRenyiContextSource

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

selectWithProbabilitySource

Arguments

:: GenIO

The random generator state

-> Double

The probability to select each list element

-> [a]

The list to filter

-> IO [a]

The filtered list