IntGraph-0.1.0.0: Dynamically sized graph library

Safe HaskellSafe
LanguageHaskell2010

Data.IntGraph.Directed

Description

Functions for interacting with a graph as a directed graph

Synopsis

Documentation

type Node = Int Source #

The nodes of the graph are Ints

type NodeSet = Set Node Source #

A NodeSet is a Set of Nodes

type Edge = (Node, Node) Source #

An edge is a pair of nodes

data IntGraph Source #

An IntGraph is a maping of Ints (Nodes) to sets of Nodes (Ints)

empty :: IntGraph Source #

the empty graph

addNode :: Node -> IntGraph -> IntGraph Source #

Adds a single node with no neighbors. | If node already in graph, does nothing.

nodes :: IntGraph -> [Node] Source #

Returns a list of the nodes in the graph

removeNode :: Node -> IntGraph -> IntGraph Source #

removes a node and all its incident edges

addEdge :: Edge -> IntGraph -> IntGraph Source #

Add an edge to the graph | If either of the nodes are not already present in the graph, | They are added.

edges :: IntGraph -> [Edge] Source #

Returns a list of all edges in the graph

removeEdge :: Edge -> IntGraph -> IntGraph Source #

Remove an edge from the graph

fromEdges :: [Edge] -> IntGraph Source #

Turns a list of edges into a graph