haskell-igraph-0.7.0: Haskell interface of the igraph library.

Safe HaskellNone
LanguageHaskell2010

IGraph.Mutable

Synopsis

Documentation

data MGraph m (d :: EdgeType) v e Source #

Mutable labeled graph.

Constructors

MGraph 

Fields

new :: forall m d v e. (SingI d, Ord v, Serialize v, PrimMonad m) => [v] -> m (MGraph (PrimState m) d v e) Source #

Create a new graph.

nNodes :: PrimMonad m => MGraph (PrimState m) d v e -> m Int Source #

Return the number of nodes in a graph.

nEdges :: PrimMonad m => MGraph (PrimState m) d v e -> m Int Source #

Return the number of edges in a graph.

addNodes Source #

Arguments

:: (Ord v, Serialize v, PrimMonad m) 
=> [v]

vertices' labels

-> MGraph (PrimState m) d v e 
-> m () 

Add nodes with labels to the graph.

delNodes :: (PrimMonad m, Ord v, Serialize v) => [Node] -> MGraph (PrimState m) d v e -> m () Source #

Delete nodes from the graph.

addEdges :: (PrimMonad m, Serialize e) => [LEdge e] -> MGraph (PrimState m) d v e -> m () Source #

Add edges with labels to the graph. If you also want to add new vertices, call addNodes first.

delEdges :: forall m d v e. (SingI d, PrimMonad m) => [Edge] -> MGraph (PrimState m) d v e -> m () Source #

Delete edges from the graph.

setEdgeAttr Source #

Arguments

:: (PrimMonad m, Serialize e) 
=> Int

Edge id

-> e 
-> MGraph (PrimState m) d v e 
-> m () 

Set edge attribute.

setNodeAttr Source #

Arguments

:: (PrimMonad m, Serialize v, Ord v) 
=> Int

Node id

-> v 
-> MGraph (PrimState m) d v e 
-> m () 

Set node attribute.