HaskellForMaths-0.1.6

Math.Combinatorics.Graph

Synopsis

Documentation

combinationsOf :: Integral t => t -> [a] -> [[a]]Source

combinationsOf k xs returns the subsets of xs of size k |If xs is in ascending order, then the returned list is in ascending order

data Graph a Source

Datatype for graphs, represented as a list of vertices and a list of edges |Both the list of vertices and the list of edges, and also the 2-element lists representing the edges, |are required to be in ascending order, without duplicates

Constructors

G [a] [[a]] 

Instances

Eq a => Eq (Graph a) 
Ord a => Ord (Graph a) 
Show a => Show (Graph a) 

nullGraph :: Graph IntSource

Safe constructor for graph from lists of vertices and edges. |graph (vs,es) checks that vs and es are valid before returning the graph.

c :: Integral t => t -> Graph tSource

The cyclic graph on n vertices

k :: Integral t => t -> Graph tSource

The complete graph on n vertices

fromDigits :: Integral a => Graph [a] -> Graph aSource

The complete bipartite graph on m and n vertices kb :: (Integral t) => t -> t -> Graph t

The complete bipartite graph on m left and n right vertices kb :: (Integral t) => t -> t -> Graph (Either t t)