algebraic-graphs-0.2: A library for algebraic graph construction and transformation

Copyright(c) Andrey Mokhov 2016-2018
LicenseMIT (see the file LICENSE)
Maintainerandrey.mokhov@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Algebra.Graph.Label

Contents

Description

Alga is a library for algebraic construction and manipulation of graphs in Haskell. See this paper for the motivation behind the library, the underlying theory, and implementation details.

This module provides basic data types and type classes for representing edge labels in edge-labelled graphs, e.g. see Algebra.Graph.Labelled.

Synopsis

Type classes for edge labels

class Semilattice a where Source #

A bounded join semilattice, satisfying the following laws:

  • Commutativity:

    x \/ y == y \/ x
  • Associativity:

    x \/ (y \/ z) == (x \/ y) \/ z
  • Identity:

    x \/ zero == x
  • Idempotence:

    x \/ x == x

Minimal complete definition

zero, (\/)

Methods

zero :: a Source #

(\/) :: a -> a -> a infixl 6 Source #

Instances
Semilattice Bool Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

zero :: Bool Source #

(\/) :: Bool -> Bool -> Bool Source #

Ord a => Semilattice (Set a) Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

zero :: Set a Source #

(\/) :: Set a -> Set a -> Set a Source #

Ord a => Semilattice (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

class Semilattice a => Dioid a where Source #

A dioid is an idempotent semiring, i.e. it satisfies the following laws:

  • Associativity:

    x /\ (y /\ z) == (x /\ y) /\ z
  • Identity:

    x /\ one == x
    one /\ x == x
  • Annihilating zero:

    x /\ zero == zero
    zero /\ x == zero
  • Distributivity:

    x /\ (y \/ z) == x /\ y \/ x /\ z
    (x \/ y) /\ z == x /\ z \/ y /\ z

Minimal complete definition

one, (/\)

Methods

one :: a Source #

(/\) :: a -> a -> a infixl 7 Source #

Instances
Dioid Bool Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

one :: Bool Source #

(/\) :: Bool -> Bool -> Bool Source #

(Num a, Ord a) => Dioid (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Data types for edge labels

data Distance a Source #

A distance is a non-negative value that can be Finite or Infinite.

Constructors

Finite a 
Infinite 
Instances
Eq a => Eq (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

(==) :: Distance a -> Distance a -> Bool #

(/=) :: Distance a -> Distance a -> Bool #

(Ord a, Num a) => Num (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Ord a => Ord (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

compare :: Distance a -> Distance a -> Ordering #

(<) :: Distance a -> Distance a -> Bool #

(<=) :: Distance a -> Distance a -> Bool #

(>) :: Distance a -> Distance a -> Bool #

(>=) :: Distance a -> Distance a -> Bool #

max :: Distance a -> Distance a -> Distance a #

min :: Distance a -> Distance a -> Distance a #

Show a => Show (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Methods

showsPrec :: Int -> Distance a -> ShowS #

show :: Distance a -> String #

showList :: [Distance a] -> ShowS #

(Num a, Ord a) => Dioid (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label

Ord a => Semilattice (Distance a) Source # 
Instance details

Defined in Algebra.Graph.Label