-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Functions for generating structured or random FGL graphs -- -- Generators for graphs. Supports classic (constant-sized) graphs, -- deterministic Generators and different random graph generators, based -- on mwc-random. -- -- This library uses a library-agnostic and space-efficient graph -- representation. Combinators are provided to convert said -- representation to other graph representations (currently only FGL, see -- Data.Graph.Generators.FGL) -- -- Note that this library is in its early development stages. Don't use -- it for production code without checking the correctness of the -- algorithm implementation. @package graph-generators @version 0.1.2.0 module Data.Graph.Generators data GraphInfo GraphInfo :: Int -> [(Int, Int)] -> GraphInfo -- | Number of nodes numNodes :: GraphInfo -> Int -- | Edge list edges :: GraphInfo -> [(Int, Int)] data GraphContext GraphContext :: [Int] -> Int -> [Int] -> GraphContext -- | Nodes having an edge to the current node inEdges :: GraphContext -> [Int] -- | The node identifier of the current node nodeLabel :: GraphContext -> Int -- | Nodes having an ingoing edge from the current node outEdges :: GraphContext -> [Int] checkGraphInfo :: GraphInfo -> Bool -- | Get the edge count for a given GraphInfo instance numEdges :: GraphInfo -> Int instance [safe] Eq GraphInfo instance [safe] Show GraphInfo module Data.Graph.Generators.Classic trivialGraph :: GraphInfo bullGraph :: GraphInfo chvatalGraph :: GraphInfo cubicalGraph :: GraphInfo desarguesGraph :: GraphInfo diamondGraph :: GraphInfo dodecahedralGraph :: GraphInfo fruchtGraph :: GraphInfo heawoodGraph :: GraphInfo houseGraph :: GraphInfo houseXGraph :: GraphInfo icosahedralGraph :: GraphInfo krackhardtKiteGraph :: GraphInfo moebiusKantorGraph :: GraphInfo octahedralGraph :: GraphInfo pappusGraph :: GraphInfo petersenGraph :: GraphInfo sedgewickMazeGraph :: GraphInfo tetrahedralGraph :: GraphInfo truncatedCubeGraph :: GraphInfo truncatedTetrahedronGraph :: GraphInfo tutteGraph :: GraphInfo nullGraph :: GraphInfo module Data.Graph.Generators.Regular completeGraph :: Int -> GraphInfo completeGraphWithSelfloops :: Int -> GraphInfo completeBipartiteGraph :: Int -> Int -> GraphInfo emptyGraph :: Int -> GraphInfo barbellGraph :: Int -> Int -> GraphInfo generalizedBarbellGraph :: Int -> Int -> Int -> GraphInfo cycleGraph :: Int -> GraphInfo pathGraph :: Int -> GraphInfo starGraph :: Int -> GraphInfo wheelGraph :: Int -> GraphInfo grid2DGraph :: Int -> Int -> GraphInfo module Data.Graph.Generators.FGL graphInfoToUGr :: GraphInfo -> UGr module Data.Graph.Generators.Random.ErdosRenyi erdosRenyiGraph :: GenIO -> Int -> Double -> IO GraphInfo erdosRenyiGraph' :: Int -> Double -> IO GraphInfo erdosRenyiContext :: GenIO -> Int -> [Int] -> Double -> IO GraphContext selectWithProbability :: GenIO -> Double -> [a] -> IO [a] module Data.Graph.Generators.Random.BarabasiAlbert barabasiAlbertGraph :: GenIO -> Int -> Int -> IO GraphInfo barabasiAlbertGraph' :: Int -> Int -> IO GraphInfo -- | Select the nth element from a multiset occur list, treating it as -- virtual large list This is significantly faster than building up the -- entire list and selecting the nth element selectNth :: Int -> [(Int, Int)] -> Int -- | Select a single random element from the multiset, with precalculated -- size Note that the given size must be the total multiset size, not the -- number of distinct elements in said se selectRandomElement :: GenIO -> (IntMultiSet, Int) -> IO Int -- | Select n distinct random elements from a multiset, with This function -- will fail to terminate if there are less than n distinct elements in -- the multiset. This function accepts a multiset with precomputed size -- for performance reasons selectNDistinctRandomElements :: GenIO -> Int -> (IntMultiSet, Int) -> IO [Int]