Graph Module

General functions for both directed and undirected graphs

Functions and values

Function or value Description

decompose v g

Full Usage: decompose v g

Parameters:
    v : 'Vertex
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: Context<'Vertex, 'Label, 'Edge> * Graph<'Vertex, 'Label, 'Edge>

Lookup a context in the graph. If the binding exists, it returns the context and the graph minus the vertex and its edges. Raising KeyNotFoundException if no binding exists in the graph.

v : 'Vertex
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Context<'Vertex, 'Label, 'Edge> * Graph<'Vertex, 'Label, 'Edge>

decomposeFirst g

Full Usage: decomposeFirst g

Parameters:
Returns: Context<'Vertex, 'Label, 'Edge> option * Graph<'Vertex, 'Label, 'Edge>

If the given graph contains at least one vertex, returns a Some value of the first context and the graph minus the associated vertex and its edges. If the graph is empty, returns None and the initial graph.

g : Map<'Vertex, MContext<'Vertex, 'Label, 'Edge>>
Returns: Context<'Vertex, 'Label, 'Edge> option * Graph<'Vertex, 'Label, 'Edge>

empty

Full Usage: empty

Returns: Graph<'Vertex, 'Label, 'Edge>

Creates a new, empty graph.

Returns: Graph<'Vertex, 'Label, 'Edge>

foldContexts state folder g

Full Usage: foldContexts state folder g

Parameters:
    state : 'State
    folder : 'State -> Context<'Vertex, 'Label, 'Edge> -> 'State
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: 'State

Folds over the contexts in the graph.

state : 'State
folder : 'State -> Context<'Vertex, 'Label, 'Edge> -> 'State
g : Graph<'Vertex, 'Label, 'Edge>
Returns: 'State

getContext v g

Full Usage: getContext v g

Parameters:
    v : 'Vertex
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: Context<'Vertex, 'Label, 'Edge>

Lookup a context in the graph. Raising KeyNotFoundException if no binding exists in the graph.

v : 'Vertex
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Context<'Vertex, 'Label, 'Edge>

isEmpty

Full Usage: isEmpty

Returns: Graph<'Vertex, 'Label, 'Edge> -> bool

Returns true, if the Graph does not contain any vertices. Returns false, if not.

Returns: Graph<'Vertex, 'Label, 'Edge> -> bool

iterContexts action g

Full Usage: iterContexts action g

Parameters:
    action : Context<'Vertex, 'Label, 'Edge> -> unit
    g : Graph<'Vertex, 'Label, 'Edge>

Performs a given function on every edge of the graph.

action : Context<'Vertex, 'Label, 'Edge> -> unit
g : Graph<'Vertex, 'Label, 'Edge>

mapContexts mapping g

Full Usage: mapContexts mapping g

Parameters:
    mapping : Context<'Vertex, 'Label, 'Edge> -> 'T
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: Map<'Vertex, 'T>

Maps contexts of the graph.

mapping : Context<'Vertex, 'Label, 'Edge> -> 'T
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Map<'Vertex, 'T>

tryDecompose v g

Full Usage: tryDecompose v g

Parameters:
    v : 'Vertex
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: Context<'Vertex, 'Label, 'Edge> option * Graph<'Vertex, 'Label, 'Edge>

Lookup a context in the graph. If the binding exists, it returns a Some value of the context and the graph minus the vertex and its edges. If it doesn't exist, returns None and the initial graph.

v : 'Vertex
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Context<'Vertex, 'Label, 'Edge> option * Graph<'Vertex, 'Label, 'Edge>

tryGetContext v g

Full Usage: tryGetContext v g

Parameters:
    v : 'Vertex
    g : Graph<'Vertex, 'Label, 'Edge>

Returns: Context<'Vertex, 'Label, 'Edge> option

Lookup a context in the graph, returning a Some value if a binding exists and None if not.

v : 'Vertex
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Context<'Vertex, 'Label, 'Edge> option