Vertices Module

Functions for vertices of both directed and undirected graphs

Functions and values

Function or value Description

add (arg1, arg2) g

Full Usage: add (arg1, arg2) g

Parameters:
    arg0 : 'Vertex
    arg1 : 'Label
    g : Graph<'Vertex, 'Label, 'Edge>

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

Adds a labeled vertex to the graph.

arg0 : 'Vertex
arg1 : 'Label
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Graph<'Vertex, 'Label, 'Edge>

addMany vertices g

Full Usage: addMany vertices g

Parameters:
    vertices : LVertex<'Vertex, 'Label> list
    g : Graph<'Vertex, 'Label, 'Edge>

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

Adds a list of labeled vertices to the graph.

vertices : LVertex<'Vertex, 'Label> list
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Graph<'Vertex, 'Label, 'Edge>

contains v g

Full Usage: contains v g

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

Returns: bool

Returns true, if the vertex v is contained in the graph. Otherwise, it returns false.

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

count g

Full Usage: count g

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

Returns: int

Evaluates the number of vertices in the graph.

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

filter predicate g

Full Usage: filter predicate g

Parameters:
    predicate : 'Vertex -> 'Label -> bool
    g : Graph<'Vertex, 'Label, 'Edge>

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

Returns a new graph containing only the vertices for which the given predicate returns true.

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

find v g

Full Usage: find v g

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

Returns: LVertex<'Vertex, 'Label>

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

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

fold state folder g

Full Usage: fold state folder g

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

Returns: 'T

Applies a function folder to each vertex of the graph, threading an accumulator argument through the computation.

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

iter action g

Full Usage: iter action g

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

Performs a given function on every vertex and its label of a graph.

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

iteri action g

Full Usage: iteri action g

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

Performs a given function on every vertex and its label of a graph. The mapping function also receives an ascending integer index.

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

map mapping g

Full Usage: map mapping g

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

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

Maps the vertexlabels of the graph.

mapping : 'Vertex -> 'Label -> 'RLabel
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Graph<'Vertex, 'RLabel, 'Edge>

mapi mapping g

Full Usage: mapi mapping g

Parameters:
    mapping : int -> 'Vertex -> 'Label -> 'RLabel
    g : Graph<'Vertex, 'Label, 'Edge>

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

Maps the vertexlabels of the graph. The mapping function also receives an ascending integer index.

mapping : int -> 'Vertex -> 'Label -> 'RLabel
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Graph<'Vertex, 'RLabel, 'Edge>

remove v g

Full Usage: remove v g

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

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

Removes a vertex from the graph.

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

removeMany nList g

Full Usage: removeMany nList g

Parameters:
    nList : 'Vertex list
    g : Graph<'Vertex, 'Label, 'Edge>

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

Removes a list of vertices from the graph.

nList : 'Vertex list
g : Graph<'Vertex, 'Label, 'Edge>
Returns: Graph<'Vertex, 'Label, 'Edge>

toVertexList g

Full Usage: toVertexList g

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

Returns: LVertex<'Vertex, 'Label> list

Creates a list of all vertices and their labels.

g : Graph<'Vertex, 'Label, 'Edge>
Returns: LVertex<'Vertex, 'Label> list

tryFind v g

Full Usage: tryFind v g

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

Returns: LVertex<'Vertex, 'Label> option

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

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