Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- data DegreeSequence
- degreeSequence :: [Int] -> DegreeSequence
- getDegreeSequence :: (Hashable v, Eq v) => UGraph v e -> Maybe DegreeSequence
- isGraphicalSequence :: DegreeSequence -> Bool
- holdsHandshakingLemma :: DegreeSequence -> Bool

# Documentation

data DegreeSequence Source #

The Degree Sequence of a simple `UGraph`

is a list of degrees of the
vertices in the graph

Use `degreeSequence`

to construct a valid Degree Sequence

## Instances

Eq DegreeSequence Source # | |

Defined in Data.Graph.UGraph.DegreeSequence (==) :: DegreeSequence -> DegreeSequence -> Bool # (/=) :: DegreeSequence -> DegreeSequence -> Bool # | |

Ord DegreeSequence Source # | |

Defined in Data.Graph.UGraph.DegreeSequence compare :: DegreeSequence -> DegreeSequence -> Ordering # (<) :: DegreeSequence -> DegreeSequence -> Bool # (<=) :: DegreeSequence -> DegreeSequence -> Bool # (>) :: DegreeSequence -> DegreeSequence -> Bool # (>=) :: DegreeSequence -> DegreeSequence -> Bool # max :: DegreeSequence -> DegreeSequence -> DegreeSequence # min :: DegreeSequence -> DegreeSequence -> DegreeSequence # | |

Show DegreeSequence Source # | |

Defined in Data.Graph.UGraph.DegreeSequence showsPrec :: Int -> DegreeSequence -> ShowS # show :: DegreeSequence -> String # showList :: [DegreeSequence] -> ShowS # |

# Construction

degreeSequence :: [Int] -> DegreeSequence Source #

Construct a `DegreeSequence`

from a list of degrees. Negative degree values
get discarded

getDegreeSequence :: (Hashable v, Eq v) => UGraph v e -> Maybe DegreeSequence Source #

Get the `DegreeSequence`

of a simple `UGraph`

. If the graph is not `simple`

(see `isSimple`

) the result is Nothing

# Queries

isGraphicalSequence :: DegreeSequence -> Bool Source #

Tell if a `DegreeSequence`

is a Graphical Sequence

A Degree Sequence is a `Graphical Sequence`

if a corresponding `UGraph`

for
it exists. Uses the Havel-Hakimi algorithm

holdsHandshakingLemma :: DegreeSequence -> Bool Source #

Tell if a `DegreeSequence`

holds the Handshaking lemma, that is, if the
number of vertices with odd degree is even