Copyright | (c) Esa Pulkkinen 2018 |
---|---|
Maintainer | esa.pulkkinen@iki.fi |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
- digraphs
- operations for building graphs
- graph algorithms
- string conversion for graphs
- xml conversion for graphs
- dot conversion for graphs
- JSON conversion for graphs
- rdf conversion for graphs
- monoid for id,source,target,invert operations
- interface for graph monad and arrows
- arrow for inspecting graph data
- monad for inspecting graph data
These exported modules implement graphs as specified in Lawvere, Rosebrugh: Sets for mathematics.
Compact representation of the graph is:
- digraphs: left and right actions of a three-element non-trivial monoid on endomorphisms of the two-element set
- graphs : left and right actions of a four-element non-trivial monoid on endomorphisms of the two-element set
The graph representation is based on just single set which contains both
vertices and edges. This means we have operation,
isVertexM
, for determining whether an element
of the set is a vertex or an edge.
For non-mathematicians, think of a database table with three or four fields, where fields are called
- id
- source
- target
- invert
The invert field is not present in a digraph.
The monoid structure provides basic properties of source and target actions.
source . target == source
target . source == target
source . source == source
target . target == target
Think of the actions in terms of state machines, from any element, we can always ask for source and target, but above equations mean that for vertices,
isVertex v => source v == v
isVertex v => target v == v
Synopsis
- module Math.Graph.Digraph
- module Math.Graph.Reversible
- module Math.Graph.Labeled
- module Math.Graph.Algorithms
- module Math.Graph.GraphMap
- module Math.Graph.Show
- module Math.Graph.XML
- module Math.Graph.Dot
- module Math.Graph.JSON
- module Math.Graph.RDF
- module Math.Graph.GraphMonoid
- module Math.Graph.Interface
- module Math.Graph.InGraphA
- module Math.Graph.InGraphMonad
- module Math.Graph.Action
digraphs
module Math.Graph.Digraph
operations for building graphs
module Math.Graph.Reversible
labeled graphs
module Math.Graph.Labeled
graph algorithms
module Math.Graph.Algorithms
transformations between graphs
module Math.Graph.GraphMap
string conversion for graphs
module Math.Graph.Show
xml conversion for graphs
module Math.Graph.XML
dot conversion for graphs
module Math.Graph.Dot
JSON conversion for graphs
module Math.Graph.JSON
rdf conversion for graphs
module Math.Graph.RDF
monoid for id,source,target,invert operations
module Math.Graph.GraphMonoid
interface for graph monad and arrows
module Math.Graph.Interface
arrow for inspecting graph data
module Math.Graph.InGraphA
monad for inspecting graph data
module Math.Graph.InGraphMonad
library for general actions of a monoid
module Math.Graph.Action