cabal-install-solver-3.12.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.Solver.Modular.LabeledGraph

Contents

- Graphs
  - Building graphs
  - Graph properties
  - Operations on the underlying unlabeled graph

Description

Wrapper around Data.Graph with support for edge labels

Synopsis

- type Graph e = Array Vertex [(e, Vertex)]
- type Vertex = Int
- graphFromEdges :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]), key -> Maybe Vertex)
- graphFromEdges' :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]))
- buildG :: Bounds -> [Edge e] -> Graph e
- transposeG :: Graph e -> Graph e
- vertices :: Graph e -> [Vertex]
- edges :: Graph e -> [Edge e]
- forgetLabels :: Graph e -> Graph
- topSort :: Graph e -> [Vertex]

# Graphs

type Graph e = Array Vertex [(e, Vertex)] Source #

type Vertex = Int Source #

Abstract representation of vertices.

## Building graphs

graphFromEdges :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]), key -> Maybe Vertex) Source #

Construct an edge-labeled graph

This is a simple adaptation of the definition in Data.Graph

graphFromEdges' :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)])) Source #

buildG :: Bounds -> [Edge e] -> Graph e Source #

transposeG :: Graph e -> Graph e Source #

## Graph properties

vertices :: Graph e -> [Vertex] Source #

edges :: Graph e -> [Edge e] Source #

## Operations on the underlying unlabeled graph

forgetLabels :: Graph e -> Graph Source #

topSort :: Graph e -> [Vertex] Source #