graph-generators-0.1.3.0: Functions for generating structured or random FGL graphs

Safe HaskellSafe
LanguageHaskell2010

Data.Graph.Generators

Synopsis

Documentation

data GraphInfo Source

The information required to build a graph.

This datastructure is designed to occupy minimal space. With n being the number of nodes, the edge list contains tuples (from, to), denoting an edge from node *from* to node *to* where *from* and *to* are integers less than the number of nodes.

Note that for a graph with n nodes, the nodes are labelled [0..n-1].

This data structure is library-agnostic and can be converted to arbitrary representations.

Copyright (C) 2014 Uli Köhler Apache License v2.0

Constructors

GraphInfo 

Fields

numNodes :: Int

Number of nodes

edges :: [(Int, Int)]

Edge list

data GraphContext Source

The context of a single graph node.

This data-structure is library-agnostic, however, it is isomophic to FGL's UContext

Constructors

GraphContext 

Fields

inEdges :: [Int]

Nodes having an edge to the current node

nodeLabel :: Int

The node identifier of the current node

outEdges :: [Int]

Nodes having an ingoing edge from the current node

checkGraphInfo :: GraphInfo -> Bool Source

Check the integrity of a GraphInfo instance: Ensures for every edge (i,j), the following condition is met: 0 <= i < n && 0 <= j < n

numEdges :: GraphInfo -> Int Source

Get the edge count for a given GraphInfo instance