haggle-0.1.0.0: A graph library offering mutable, immutable, and inductive graphs

Safe HaskellNone
LanguageHaskell2010

Data.Graph.Haggle.Digraph

Description

This graph implementation is a directed (multi-)graph that only tracks successors. This encoding is very compact. It is a multi-graph because it allows parallel edges between vertices. If you require only simple graphs, careful edge insertion is required (or another graph type might be more appropriate).

Limitations:

  • Removing nodes and edges is not currently possible.
  • Predecessors are not accessible
  • Edge existence tests are linear in the number of edges for the source node.
Synopsis

Documentation

data MDigraph m Source #

This is a compact (mutable) directed graph.

data Digraph Source #

Instances
NFData Digraph Source #

The Digraph is always in normal form, as the vectors are all unboxed

Instance details

Defined in Data.Graph.Haggle.Digraph

Methods

rnf :: Digraph -> () #

Thawable Digraph Source # 
Instance details

Defined in Data.Graph.Haggle.Digraph

Associated Types

type MutableGraph Digraph :: (Type -> Type) -> Type Source #

Methods

thaw :: (PrimMonad m, MonadRef m) => Digraph -> m (MutableGraph Digraph m) Source #

Graph Digraph Source # 
Instance details

Defined in Data.Graph.Haggle.Digraph

type MutableGraph Digraph Source # 
Instance details

Defined in Data.Graph.Haggle.Digraph

newMDigraph :: (PrimMonad m, MonadRef m) => m (MDigraph m) Source #

Create a new empty mutable graph with a small amount of storage reserved for vertices and edges.

newSizedMDigraph :: (PrimMonad m, MonadRef m) => Int -> Int -> m (MDigraph m) Source #

Create a new empty graph with storage reserved for szVerts vertices and szEdges edges.

g <- newSizedMDigraph szVerts szEdges