uni-graphs-2.2.1.2: Graphs
Safe HaskellNone
LanguageHaskell2010

Graphs.PureGraphPrune

Description

The functions in this module implement pruning of PureGraphs, to remove hidden nodes as far as possible, while still showing the structure between non-hidden nodes.

NB. It is assumed the PureGraph is acyclic!

Synopsis

Documentation

pureGraphPrune Source #

Arguments

:: (Ord nodeInfo, Ord arcInfo) 
=> (nodeInfo -> Bool)

This function returns True if a node is hidden.

-> PureGraph nodeInfo arcInfo 
-> PureGraph nodeInfo (Maybe arcInfo)

In the returned graph, we use Nothing to indicate the arcs which don't correspond to arcs in the original graph.

Remove "hidden" vertices as far as possible from a graph, which must be acyclic, while still preserving the structure as far as possible.