-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell interface of the igraph library. -- -- igraph"http://igraph.org/c/" is a library for creating and -- manipulating large graphs. This package provides the Haskell interface -- of igraph. @package haskell-igraph @version 0.7.0 module IGraph.Internal.Constants data Neimode IgraphOut :: Neimode IgraphIn :: Neimode IgraphAll :: Neimode IgraphTotal :: Neimode data EdgeOrderType IgraphEdgeorderId :: EdgeOrderType IgraphEdgeorderFrom :: EdgeOrderType IgraphEdgeorderTo :: EdgeOrderType data ToDirected IgraphToDirectedArbitrary :: ToDirected IgraphToDirectedMutual :: ToDirected data SpincommUpdate IgraphSpincommUpdateSimple :: SpincommUpdate IgraphSpincommUpdateConfig :: SpincommUpdate data SpinglassImplementation IgraphSpincommImpOrig :: SpinglassImplementation IgraphSpincommImpNeg :: SpinglassImplementation data AttributeElemtype IgraphAttributeGraph :: AttributeElemtype IgraphAttributeVertex :: AttributeElemtype IgraphAttributeEdge :: AttributeElemtype data SubgraphImplementation IgraphSubgraphAuto :: SubgraphImplementation IgraphSubgraphCopyAndDelete :: SubgraphImplementation IgraphSubgraphCreateFromScratch :: SubgraphImplementation data Connectedness IgraphWeak :: Connectedness IgraphStrong :: Connectedness data PagerankAlgo IgraphPagerankAlgoPower :: PagerankAlgo IgraphPagerankAlgoArpack :: PagerankAlgo IgraphPagerankAlgoPrpack :: PagerankAlgo data ErdosRenyi IgraphErdosRenyiGnp :: ErdosRenyi IgraphErdosRenyiGnm :: ErdosRenyi data Rewiring IgraphRewiringSimple :: Rewiring IgraphRewiringSimpleLoops :: Rewiring data StarMode IgraphStarOut :: StarMode IgraphStarIn :: StarMode IgraphStarUndirected :: StarMode IgraphStarMutual :: StarMode data Degseq IgraphDegseqSimple :: Degseq IgraphDegseqVl :: Degseq IgraphDegseqSimpleNoMultiple :: Degseq instance GHC.Classes.Eq IGraph.Internal.Constants.Degseq instance GHC.Read.Read IGraph.Internal.Constants.Degseq instance GHC.Show.Show IGraph.Internal.Constants.Degseq instance GHC.Classes.Eq IGraph.Internal.Constants.StarMode instance GHC.Read.Read IGraph.Internal.Constants.StarMode instance GHC.Show.Show IGraph.Internal.Constants.StarMode instance GHC.Classes.Eq IGraph.Internal.Constants.Rewiring instance GHC.Read.Read IGraph.Internal.Constants.Rewiring instance GHC.Show.Show IGraph.Internal.Constants.Rewiring instance GHC.Classes.Eq IGraph.Internal.Constants.ErdosRenyi instance GHC.Read.Read IGraph.Internal.Constants.ErdosRenyi instance GHC.Show.Show IGraph.Internal.Constants.ErdosRenyi instance GHC.Classes.Eq IGraph.Internal.Constants.PagerankAlgo instance GHC.Read.Read IGraph.Internal.Constants.PagerankAlgo instance GHC.Show.Show IGraph.Internal.Constants.PagerankAlgo instance GHC.Classes.Eq IGraph.Internal.Constants.Connectedness instance GHC.Classes.Eq IGraph.Internal.Constants.SubgraphImplementation instance GHC.Read.Read IGraph.Internal.Constants.SubgraphImplementation instance GHC.Show.Show IGraph.Internal.Constants.SubgraphImplementation instance GHC.Classes.Eq IGraph.Internal.Constants.AttributeElemtype instance GHC.Show.Show IGraph.Internal.Constants.AttributeElemtype instance GHC.Classes.Eq IGraph.Internal.Constants.SpinglassImplementation instance GHC.Show.Show IGraph.Internal.Constants.SpinglassImplementation instance GHC.Classes.Eq IGraph.Internal.Constants.SpincommUpdate instance GHC.Show.Show IGraph.Internal.Constants.SpincommUpdate instance GHC.Classes.Eq IGraph.Internal.Constants.ToDirected instance GHC.Classes.Eq IGraph.Internal.Constants.EdgeOrderType instance GHC.Show.Show IGraph.Internal.Constants.EdgeOrderType instance GHC.Classes.Eq IGraph.Internal.Constants.Neimode instance GHC.Show.Show IGraph.Internal.Constants.Neimode instance GHC.Enum.Enum IGraph.Internal.Constants.Degseq instance GHC.Enum.Enum IGraph.Internal.Constants.StarMode instance GHC.Enum.Enum IGraph.Internal.Constants.Rewiring instance GHC.Enum.Enum IGraph.Internal.Constants.ErdosRenyi instance GHC.Enum.Enum IGraph.Internal.Constants.PagerankAlgo instance GHC.Enum.Enum IGraph.Internal.Constants.Connectedness instance GHC.Enum.Enum IGraph.Internal.Constants.SubgraphImplementation instance GHC.Enum.Enum IGraph.Internal.Constants.AttributeElemtype instance GHC.Enum.Enum IGraph.Internal.Constants.SpinglassImplementation instance GHC.Enum.Enum IGraph.Internal.Constants.SpincommUpdate instance GHC.Enum.Enum IGraph.Internal.Constants.ToDirected instance GHC.Enum.Enum IGraph.Internal.Constants.EdgeOrderType instance GHC.Enum.Enum IGraph.Internal.Constants.Neimode module IGraph.Internal.Initialization data HasInit igraphInit :: IO HasInit haskelligraphInit :: IO () haskelligraphInit'_ :: (IO ()) module IGraph.Types data EdgeType D :: EdgeType U :: EdgeType type DSym0 = D type USym0 = U type SEdgeType = (Sing :: EdgeType -> Type) type Node = Int type LNode a = (Node, a) type Edge = (Node, Node) type LEdge a = (Edge, a) vertexAttr :: String edgeAttr :: String instance GHC.Generics.Generic IGraph.Types.EdgeType instance GHC.Classes.Eq IGraph.Types.EdgeType instance Data.Singletons.Prelude.Eq.PEq IGraph.Types.EdgeType instance Data.Singletons.Internal.SingKind IGraph.Types.EdgeType instance Data.Singletons.Prelude.Eq.SEq IGraph.Types.EdgeType instance Data.Singletons.Decide.SDecide IGraph.Types.EdgeType instance Data.Singletons.Internal.SingI 'IGraph.Types.D instance Data.Singletons.Internal.SingI 'IGraph.Types.U instance Data.Serialize.Serialize IGraph.Types.EdgeType module IGraph.Internal data Vector -- | Allocate and initialize a vector. allocaVector :: (Ptr Vector -> IO a) -> IO a allocaVectorN :: Int -> (Ptr Vector -> IO a) -> IO a withList :: Real a => [a] -> (Ptr Vector -> IO b) -> IO b -- | Allocate a nullPtr if Nothing withListMaybe :: Real a => Maybe [a] -> (Ptr Vector -> IO b) -> IO b toList :: Ptr Vector -> IO [Double] igraphVectorNull :: (Ptr Vector) -> IO () igraphVectorFill :: (Ptr Vector) -> (Double) -> IO () igraphVectorE :: (Ptr Vector) -> (Int) -> IO ((Double)) igraphVectorSet :: (Ptr Vector) -> (Int) -> (Double) -> IO () igraphVectorTail :: (Ptr Vector) -> IO ((Double)) igraphVectorSize :: (Ptr Vector) -> IO ((Int)) igraphVectorCopyTo :: (Ptr Vector) -> (Ptr CDouble) -> IO () data VectorPtr -- | Allocate and initialize a pointer vector. allocaVectorPtr :: (Ptr VectorPtr -> IO a) -> IO a allocaVectorPtrN :: Int -> (Ptr VectorPtr -> IO a) -> IO a withPtrs :: [Ptr a] -> (Ptr VectorPtr -> IO b) -> IO b toLists :: Ptr VectorPtr -> IO [[Double]] igraphVectorPtrSize :: (Ptr VectorPtr) -> IO ((Int)) igraphVectorPtrE :: (Ptr VectorPtr) -> (Int) -> IO ((Ptr ())) igraphVectorPtrSet :: (Ptr VectorPtr) -> (Int) -> (Ptr ()) -> IO () data BSLen withByteString :: ByteString -> (Ptr BSLen -> IO a) -> IO a toByteString :: Ptr BSLen -> IO ByteString data BSVector allocaBSVectorN :: Int -> (Ptr BSVector -> IO a) -> IO a withByteStrings :: [ByteString] -> (Ptr BSVector -> IO a) -> IO a bsvectorSet :: Ptr BSVector -> Int -> ByteString -> IO () data Matrix allocaMatrix :: (Ptr Matrix -> IO a) -> IO a allocaMatrixN :: Int -> Int -> (Ptr Matrix -> IO a) -> IO a withRowLists :: Real a => [[a]] -> (Ptr Matrix -> IO b) -> IO b toRowLists :: Ptr Matrix -> IO [[Double]] toColumnLists :: Ptr Matrix -> IO [[Double]] igraphMatrixNull :: (Ptr Matrix) -> IO () igraphMatrixFill :: (Ptr Matrix) -> (Double) -> IO () igraphMatrixE :: (Ptr Matrix) -> (Int) -> (Int) -> IO ((Double)) igraphMatrixSet :: (Ptr Matrix) -> (Int) -> (Int) -> (Double) -> IO () igraphMatrixCopyTo :: (Ptr Matrix) -> (Ptr CDouble) -> IO () igraphMatrixNrow :: (Ptr Matrix) -> IO ((Int)) igraphMatrixNcol :: (Ptr Matrix) -> IO ((Int)) data IGraph withIGraph :: IGraph -> (Ptr IGraph -> IO b) -> IO b allocaIGraph :: (Ptr IGraph -> IO a) -> IO a addIGraphFinalizer :: Ptr IGraph -> IO IGraph mkLabelToId :: (Ord v, Serialize v) => IGraph -> Map v [Int] initializeNullAttribute :: PrimMonad m => IGraph -> m () -- | Create a igraph object and attach a finalizer igraphNew :: Int -> Bool -> HasInit -> IO IGraph igraphCreate :: (Ptr Vector) -> (Int) -> (Bool) -> IO ((IGraph)) -- | A graph is a simple graph if it does not contain loop edges and -- multiple edges. igraphIsSimple :: (IGraph) -> IO ((Bool)) igraphHasMultiple :: (IGraph) -> IO ((Bool)) data VertexSelector withVerticesAll :: (Ptr VertexSelector -> IO a) -> IO a withVerticesAdj :: Int -> Neimode -> (Ptr VertexSelector -> IO a) -> IO a withVerticesVector :: Ptr Vector -> (Ptr VertexSelector -> IO a) -> IO a withVerticesList :: Real a => [a] -> (Ptr VertexSelector -> IO b) -> IO b data VertexIterator iterateVertices :: IGraph -> Ptr VertexSelector -> (Ptr VertexIterator -> IO a) -> IO a iterateVerticesC :: IGraph -> Ptr VertexSelector -> (ConduitT i Int IO () -> IO a) -> IO a data EdgeSelector withEdgesAll :: EdgeOrderType -> (Ptr EdgeSelector -> IO a) -> IO a withEdgeIdsVector :: Ptr Vector -> (Ptr EdgeSelector -> IO a) -> IO a withEdgeIdsList :: [Int] -> (Ptr EdgeSelector -> IO b) -> IO b data EdgeIterator iterateEdges :: IGraph -> Ptr EdgeSelector -> (Ptr EdgeIterator -> IO a) -> IO a iterateEdgesC :: IGraph -> Ptr EdgeSelector -> (ConduitT i Int IO () -> IO a) -> IO a igraphCopy :: (IGraph) -> IO ((IGraph)) igraphVcount :: (IGraph) -> IO ((Int)) igraphEcount :: (IGraph) -> IO ((Int)) igraphGetEid :: (IGraph) -> (Int) -> (Int) -> (Bool) -> (Bool) -> IO ((Int)) igraphEdge :: (IGraph) -> (Int) -> IO ((Int), (Int)) igraphAddVertices :: (IGraph) -> (Int) -> (Ptr ()) -> IO () igraphAddEdge :: (IGraph) -> (Int) -> (Int) -> IO () -- | The edges are given in a vector, the first two elements define the -- first edge (the order is from , to for directed graphs). The vector -- should contain even number of integer numbers between zero and the -- number of vertices in the graph minus one (inclusive). If you also -- want to add new vertices, call igraph_add_vertices() first. igraphAddEdges :: (IGraph) -> (Ptr Vector) -> (Ptr ()) -> IO () -- | delete vertices igraphDeleteVertices :: (IGraph) -> (Ptr VertexSelector) -> IO () -- | delete edges igraphDeleteEdges :: (IGraph) -> (Ptr EdgeSelector) -> IO () data AttributeRecord withAttr :: Serialize a => String -> [a] -> (Ptr AttributeRecord -> IO b) -> IO b withBSAttr :: String -> Ptr BSVector -> (Ptr AttributeRecord -> IO b) -> IO b -- | Checks whether a (graph, vertex or edge) attribute exists igraphHaskellAttributeHasAttr :: (IGraph) -> (AttributeElemtype) -> (String) -> IO ((Bool)) -- | Query a string vertex attribute igraphHaskellAttributeVAS :: (IGraph) -> (String) -> (Int) -> IO ((Ptr BSLen)) -- | Query a string edge attribute. igraphHaskellAttributeEAS :: (IGraph) -> (String) -> (Int) -> IO ((Ptr BSLen)) igraphHaskellAttributeVASSet :: (IGraph) -> (String) -> (Int) -> (Ptr BSLen) -> IO () igraphHaskellAttributeVASSetv :: (IGraph) -> (String) -> (Ptr BSVector) -> IO () -- | Set a string edge attribute. igraphHaskellAttributeEASSet :: (IGraph) -> (String) -> (Int) -> (Ptr BSLen) -> IO () -- | Set a string edge attribute for all edges. igraphHaskellAttributeEASSetv :: (IGraph) -> (String) -> (Ptr BSVector) -> IO () data ArpackOpt allocaArpackOpt :: (Ptr ArpackOpt -> IO a) -> IO a module IGraph.Mutable -- | Mutable labeled graph. data MGraph m (d :: EdgeType) v e MGraph :: IGraph -> MutVar m (Map v [Node]) -> MGraph m v e [_mgraph] :: MGraph m v e -> IGraph [_mlabelToNode] :: MGraph m v e -> MutVar m (Map v [Node]) -- | Create a new graph. new :: forall m d v e. (SingI d, Ord v, Serialize v, PrimMonad m) => [v] -> m (MGraph (PrimState m) d v e) -- | Return the number of nodes in a graph. nNodes :: PrimMonad m => MGraph (PrimState m) d v e -> m Int -- | Return the number of edges in a graph. nEdges :: PrimMonad m => MGraph (PrimState m) d v e -> m Int -- | Add nodes with labels to the graph. addNodes :: (Ord v, Serialize v, PrimMonad m) => [v] -> MGraph (PrimState m) d v e -> m () -- | Delete nodes from the graph. delNodes :: (PrimMonad m, Ord v, Serialize v) => [Node] -> MGraph (PrimState m) d v e -> m () -- | Add edges with labels to the graph. If you also want to add new -- vertices, call addNodes first. addEdges :: (PrimMonad m, Serialize e) => [LEdge e] -> MGraph (PrimState m) d v e -> m () -- | Delete edges from the graph. delEdges :: forall m d v e. (SingI d, PrimMonad m) => [Edge] -> MGraph (PrimState m) d v e -> m () -- | Set edge attribute. setEdgeAttr :: (PrimMonad m, Serialize e) => Int -> e -> MGraph (PrimState m) d v e -> m () -- | Set node attribute. setNodeAttr :: (PrimMonad m, Serialize v, Ord v) => Int -> v -> MGraph (PrimState m) d v e -> m () module IGraph -- | Graph with labeled nodes and edges. data Graph (d :: EdgeType) v e Graph :: IGraph -> Map v [Node] -> Graph v e [_graph] :: Graph v e -> IGraph [_labelToNode] :: Graph v e -> Map v [Node] data EdgeType D :: EdgeType U :: EdgeType type Node = Int type LNode a = (Node, a) type Edge = (Node, Node) type LEdge a = (Edge, a) -- | Is the graph directed or not. isDirected :: forall d v e. SingI d => Graph d v e -> Bool -- | Return the number of nodes in a graph. nNodes :: Graph d v e -> Int -- | Return the label of given node. nodeLab :: Serialize v => Graph d v e -> Node -> v -- | Return all nodes. nodes gr == [0 .. nNodes gr - 1]. nodes :: Graph d v e -> [Node] labNodes :: Serialize v => Graph d v e -> [LNode v] -- | Return the number of edges in a graph. nEdges :: Graph d v e -> Int -- | Return the label of given edge. edgeLab :: Serialize e => Graph d v e -> Edge -> e -- | Return all edges. edges :: Graph d v e -> [Edge] labEdges :: Serialize e => Graph d v e -> [LEdge e] -- | Add nodes with labels to the graph. addNodes :: (Ord v, Serialize v) => [v] -> Graph d v e -> Graph d v e -- | Delete nodes from the graph. delNodes :: (Ord v, Serialize v) => [Node] -> Graph d v e -> Graph d v e -- | Add edges with labels to the graph. addEdges :: Serialize e => [LEdge e] -> Graph d v e -> Graph d v e -- | Delete edges from the graph. delEdges :: SingI d => [Edge] -> Graph d v e -> Graph d v e -- | Whether a edge exists in the graph. hasEdge :: Edge -> Graph d v e -> Bool -- | Return all nodes that are associated with given label. getNodes :: Ord v => Graph d v e -> v -> [Node] -- | Find the edge by edge ID. getEdgeByEid :: Graph d v e -> Int -> Edge -- | Find the edge label by edge ID. getEdgeLabByEid :: Serialize e => Graph d v e -> Int -> e -- | Create a empty graph. empty :: (SingI d, Serialize v, Ord v, Serialize e) => Graph d v e -- | Create a graph. mkGraph :: (SingI d, Serialize v, Ord v, Serialize e) => [v] -> [LEdge e] -> Graph d v e -- | Create a graph from labeled edges. fromLabeledEdges :: (SingI d, Serialize v, Ord v, Serialize e) => [((v, v), e)] -> Graph d v e -- | Create a graph from a stream of labeled edges. fromLabeledEdges' :: (MonadUnliftIO m, SingI d, Serialize v, Ord v, Serialize e) => a -> (a -> ConduitT () ((v, v), e) m ()) -> m (Graph d v e) -- | Convert a mutable graph to immutable graph. The original graph may not -- be used afterwards. unsafeFreeze :: PrimMonad m => MGraph (PrimState m) d v e -> m (Graph d v e) -- | Convert a mutable graph to immutable graph. freeze :: PrimMonad m => MGraph (PrimState m) d v e -> m (Graph d v e) -- | Create a mutable graph. The original graph may not be used afterwards. unsafeThaw :: PrimMonad m => Graph d v e -> m (MGraph (PrimState m) d v e) -- | Create a mutable graph. thaw :: PrimMonad m => Graph d v e -> m (MGraph (PrimState m) d v e) -- | Find all neighbors of the given node. neighbors :: Graph d v e -> Node -> [Node] -- | Find all nodes that link to to the given node. pre :: Graph 'D v e -> Node -> [Node] -- | Find all nodes that have a link from the given node. suc :: Graph 'D v e -> Node -> [Node] -- | Apply a function to change nodes' labels. nmap :: (Serialize v1, Serialize v2, Ord v2) => (LNode v1 -> v2) -> Graph d v1 e -> Graph d v2 e -- | Apply a function to change edges' labels. emap :: (Serialize e1, Serialize e2, Ord v, Serialize v) => (LEdge e1 -> e2) -> Graph d v e1 -> Graph d v e2 -- | Keep nodes that satisfy the constraint. nfilter :: (Ord v, Serialize v) => (LNode v -> Bool) -> Graph d v e -> Graph d v e -- | Keep edges that satisfy the constraint. efilter :: (SingI d, Ord v, Serialize v, Serialize e) => (LEdge e -> Bool) -> Graph d v e -> Graph d v e -- | Decides whether the input graph is a simple graph. A graph is a simple -- graph if it does not contain loop edges and multiple edges. isSimple :: Graph d v e -> Bool -- | Check whether the graph has at least one multiple edge. An edge is a -- multiple edge if there is another edge with the same head and tail -- vertices in the graph. hasMultiple :: Graph d v e -> Bool instance (Data.Singletons.Internal.SingI d, Data.Serialize.Serialize v, Data.Serialize.Serialize e, GHC.Classes.Ord v) => Data.Serialize.Serialize (IGraph.Graph d v e) module IGraph.Exporter.GEXF data NodeAttr NodeAttr :: Double -> AlphaColour Double -> String -> Double -> Double -> Int -> NodeAttr [_size] :: NodeAttr -> Double [_nodeColour] :: NodeAttr -> AlphaColour Double [_nodeLabel] :: NodeAttr -> String [_positionX] :: NodeAttr -> Double [_positionY] :: NodeAttr -> Double [_nodeZindex] :: NodeAttr -> Int defaultNodeAttributes :: NodeAttr data EdgeAttr EdgeAttr :: String -> AlphaColour Double -> Double -> Double -> Int -> EdgeAttr [_edgeLabel] :: EdgeAttr -> String [_edgeColour] :: EdgeAttr -> AlphaColour Double [_edgeWeight] :: EdgeAttr -> Double [_edgeArrowLength] :: EdgeAttr -> Double [_edgeZindex] :: EdgeAttr -> Int defaultEdgeAttributes :: EdgeAttr genXMLTree :: (SingI d, ArrowXml a) => Graph d NodeAttr EdgeAttr -> a XmlTree XmlTree writeGEXF :: SingI d => FilePath -> Graph d NodeAttr EdgeAttr -> IO () instance GHC.Generics.Generic IGraph.Exporter.GEXF.EdgeAttr instance GHC.Classes.Eq IGraph.Exporter.GEXF.EdgeAttr instance GHC.Read.Read IGraph.Exporter.GEXF.EdgeAttr instance GHC.Show.Show IGraph.Exporter.GEXF.EdgeAttr instance GHC.Generics.Generic IGraph.Exporter.GEXF.NodeAttr instance GHC.Classes.Eq IGraph.Exporter.GEXF.NodeAttr instance GHC.Read.Read IGraph.Exporter.GEXF.NodeAttr instance GHC.Show.Show IGraph.Exporter.GEXF.NodeAttr instance GHC.Classes.Ord IGraph.Exporter.GEXF.EdgeAttr instance Data.Serialize.Serialize IGraph.Exporter.GEXF.EdgeAttr instance GHC.Classes.Ord IGraph.Exporter.GEXF.NodeAttr instance Data.Serialize.Serialize IGraph.Exporter.GEXF.NodeAttr instance Data.Serialize.Serialize (Data.Colour.Internal.AlphaColour GHC.Types.Double) module IGraph.Algorithms.Structure getShortestPath :: Graph d v e -> Node -> Node -> [Node] inducedSubgraph :: (Ord v, Serialize v) => Graph d v e -> [Int] -> Graph d v e -- | Decides whether the graph is weakly connected. isConnected :: Graph d v e -> Bool isStronglyConnected :: Graph 'D v e -> Bool -- | Decompose a graph into connected components. decompose :: (Ord v, Serialize v) => Graph d v e -> [Graph d v e] -- | Checks whether a graph is a directed acyclic graph (DAG) or not. isDag :: Graph d v e -> Bool -- | Calculate a possible topological sorting of the graph. topSort :: Graph d v e -> [Node] -- | Calculate a possible topological sorting of the graph. If the graph is -- not acyclic (it has at least one cycle), a partial topological sort is -- returned. topSortUnsafe :: Graph d v e -> [Node] module IGraph.Algorithms.Motif -- | Every triple of vertices in a directed graph 003: A, B, C, the empty -- graph. 012: A->B, C, a graph with a single directed edge. 102: -- A-B, C, a graph with a mutual connection between two vertices. -- 021D: A-B-C, the binary out-tree. 021U: A->B<-C, the -- binary in-tree. 021C: A->B->C, the directed line. 111D: -- A-B<-C. 111U: A-B->C. 030T: A->BA-C. -- Feed forward loop. 030C: AA-C. 201: A-B-C. 120D: -- A-B-C, A-C. 120U: A->BA<-C. 120C: -- A->B->C, A-C. 210: A->B-C, A-C. 300: -- A-B-C, A-C, the complete graph. triad :: [Graph 'D () ()] triadCensus :: (Ord v, Read v) => Graph d v e -> [Int] module IGraph.Algorithms.Layout getLayout :: Graph d v e -> LayoutMethod -> IO [(Double, Double)] data LayoutMethod KamadaKawai :: !(Maybe [(Double, Double)]) -> !Int -> (Int -> Double) -> !Double -> !Double -> (Int -> Double) -> LayoutMethod [kk_seed] :: LayoutMethod -> !(Maybe [(Double, Double)]) [kk_nIter] :: LayoutMethod -> !Int -- | The base standard deviation of position change proposals [kk_sigma] :: LayoutMethod -> (Int -> Double) -- | The initial temperature for the annealing [kk_startTemp] :: LayoutMethod -> !Double -- | The cooling factor for the simulated annealing [kk_coolFact] :: LayoutMethod -> !Double -- | The Kamada-Kawai vertex attraction constant [kk_const] :: LayoutMethod -> (Int -> Double) LGL :: !Int -> (Int -> Double) -> (Int -> Double) -> !Double -> (Int -> Double) -> (Int -> Double) -> LayoutMethod [lgl_nIter] :: LayoutMethod -> !Int -- | The maximum length of the move allowed for a vertex in a single -- iteration. A reasonable default is the number of vertices. [lgl_maxdelta] :: LayoutMethod -> (Int -> Double) -- | This parameter gives the area of the square on which the vertices will -- be placed. A reasonable default value is the number of vertices -- squared. [lgl_area] :: LayoutMethod -> (Int -> Double) -- | The cooling exponent. A reasonable default value is 1.5. [lgl_coolexp] :: LayoutMethod -> !Double -- | Determines the radius at which vertex-vertex repulsion cancels out -- attraction of adjacent vertices. A reasonable default value is area -- times the number of vertices. [lgl_repulserad] :: LayoutMethod -> (Int -> Double) [lgl_cellsize] :: LayoutMethod -> (Int -> Double) defaultKamadaKawai :: LayoutMethod defaultLGL :: LayoutMethod module IGraph.Algorithms.Isomorphism getSubisomorphisms :: Graph d v1 e1 -> Graph d v2 e2 -> [[Int]] -- | Determine whether two graphs are isomorphic. isomorphic :: Graph d v1 e1 -> Graph d v2 e2 -> Bool -- | Creates a graph from the given isomorphism class. This function is -- implemented only for graphs with three or four vertices. isoclassCreate :: forall d. SingI d => Int -> Int -> Graph d () () isoclass3 :: forall d. SingI d => [Graph d () ()] isoclass4 :: forall d. SingI d => [Graph d () ()] module IGraph.Algorithms.Generators full :: forall d. SingI d => Int -> Bool -> Graph d () () -- | Return the Star graph. The center node is always associated with id 0. star :: Int -> Graph 'U () () -- | Creates a ring graph, a one dimensional lattice. ring :: Int -> Graph 'U () () data ErdosRenyiModel GNP :: Int -> Double -> ErdosRenyiModel GNM :: Int -> Int -> ErdosRenyiModel erdosRenyiGame :: forall d. SingI d => ErdosRenyiModel -> Bool -> IO (Graph d () ()) -- | Generates a random graph with a given degree sequence. degreeSequenceGame :: [Int] -> [Int] -> IO (Graph 'D () ()) -- | Randomly rewires a graph while preserving the degree distribution. rewire :: (Serialize v, Ord v, Serialize e) => Int -> Graph d v e -> IO (Graph d v e) module IGraph.Algorithms.Community modularity :: Graph d v e -> [[Int]] -> Maybe [Double] -> Double findCommunity :: Graph 'U v e -> Maybe [Double] -> CommunityMethod -> [[Int]] data CommunityMethod LeadingEigenvector :: Int -> CommunityMethod -- | number of iterations, default is 10000 [_nIter] :: CommunityMethod -> Int Spinglass :: Int -> Double -> Double -> Double -> Double -> CommunityMethod -- | number of spins, default is 25 [_nSpins] :: CommunityMethod -> Int -- | the temperature at the start [_startTemp] :: CommunityMethod -> Double -- | the algorithm stops at this temperature [_stopTemp] :: CommunityMethod -> Double -- | the cooling factor for the simulated annealing [_coolFact] :: CommunityMethod -> Double -- | the gamma parameter of the algorithm. [_gamma] :: CommunityMethod -> Double defaultLeadingEigenvector :: CommunityMethod defaultSpinglass :: CommunityMethod module IGraph.Algorithms.Clique cliques :: Graph d v e -> (Int, Int) -> [[Int]] largestCliques :: Graph d v e -> [[Int]] maximalCliques :: Graph d v e -> (Int, Int) -> [[Int]] cliqueNumber :: Graph d v e -> Int module IGraph.Algorithms.Centrality -- | The normalized closeness centrality of a node is the average length of -- the shortest path between the node and all other nodes in the graph. closeness :: [Int] -> Graph d v e -> Maybe [Double] -> Bool -> [Double] -- | Betweenness centrality betweenness :: [Int] -> Graph d v e -> Maybe [Double] -> [Double] -- | Eigenvector centrality eigenvectorCentrality :: Graph d v e -> Maybe [Double] -> [Double] -- | Google's PageRank algorithm, with option to pagerank :: SingI d => Graph d v e -> Maybe [Double] -> Maybe [Double] -> Double -> [Double] module IGraph.Algorithms