algebraic-graphs-0.7: A library for algebraic graph construction and transformation
Copyright(c) Andrey Mokhov 2016-2022
LicenseMIT (see the file LICENSE)
Maintainer[email protected]
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Algebra.Graph.Labelled.Example.Network

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 contains a simple example of using edge-labelled graphs defined in the module Algebra.Graph.Labelled for working with networks, i.e. graphs whose edges are labelled with distances.

Synopsis

Documentation

data City Source #

Our example networks have cities as vertices.

type JourneyTime = Int Source #

For simplicity we measure journey times in integer number of minutes.

eastCoast :: Network JourneyTime City Source #

A part of the EastCoast train network between Aberdeen and London.

eastCoast = overlays [ Aberdeen  -<150>- Edinburgh
                     , Edinburgh -< 90>- Newcastle
                     , Newcastle -<170>- London ]

scotRail :: Network JourneyTime City Source #

A part of the ScotRail train network between Aberdeen and Glasgow.

scotRail = overlays [ Aberdeen  -<140>- Edinburgh
                    , Edinburgh -< 50>- Glasgow
                    , Edinburgh -< 70>- Glasgow ]

network :: Network JourneyTime City Source #

An example train network.

network = overlay scotRail eastCoast