DiGraph Type

Constructors

Constructor Description

DiGraph()

Full Usage: DiGraph()

Returns: DiGraph
Returns: DiGraph

Static members

Static member Description

DiGraph.addEdge edge graph

Full Usage: DiGraph.addEdge edge graph

Parameters:
    edge : 'NodeKey * 'NodeKey * 'EdgeData - The edge to be created. A three part tuple containing the origin node, the destination node, and any edge label such as the weight.
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the edge will be added to.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> Unit

Adds a new edge to the graph

edge : 'NodeKey * 'NodeKey * 'EdgeData

The edge to be created. A three part tuple containing the origin node, the destination node, and any edge label such as the weight.

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the edge will be added to.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Unit

DiGraph.addEdges edges graph

Full Usage: DiGraph.addEdges edges graph

Parameters:
    edges : ('NodeKey * 'NodeKey * 'EdgeData)[] - The array of edges. Each edge is a three part tuple containing the origin node, the destination node, and any edge label such as the weight.
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph to add the edge to

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> Unit

Adds many edges to a graph at once

edges : ('NodeKey * 'NodeKey * 'EdgeData)[]

The array of edges. Each edge is a three part tuple containing the origin node, the destination node, and any edge label such as the weight.

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph to add the edge to

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Unit

DiGraph.addElement nk1 nd1 nk2 nd2 ed g

Full Usage: DiGraph.addElement nk1 nd1 nk2 nd2 ed g

Parameters:
    nk1 : 'NodeKey
    nd1 : 'NodeData
    nk2 : 'NodeKey
    nd2 : 'NodeData
    ed : 'EdgeData
    g : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>
nk1 : 'NodeKey
nd1 : 'NodeData
nk2 : 'NodeKey
nd2 : 'NodeData
ed : 'EdgeData
g : DiGraph<'NodeKey, 'NodeData, 'EdgeData>
Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

DiGraph.addNode nodeKey nodeData graph

Full Usage: DiGraph.addNode nodeKey nodeData graph

Parameters:
    nodeKey : 'NodeKey
    nodeData : 'NodeData
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the node will be added to.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> Unit

Adds a new node to the graph

nodeKey : 'NodeKey
nodeData : 'NodeData
graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the node will be added to.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Unit

DiGraph.addNodes nodes graph

Full Usage: DiGraph.addNodes nodes graph

Parameters:
    nodes : ('NodeKey * 'NodeData)[]
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>
nodes : ('NodeKey * 'NodeData)[]
graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>
Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

DiGraph.countEdges graph

Full Usage: DiGraph.countEdges graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph to be analysed

Returns: int A float of the total edges

Gets the total number of edges of the graph

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph to be analysed

Returns: int

A float of the total edges

DiGraph.countNodes graph

Full Usage: DiGraph.countNodes graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph to be analysed

Returns: int A float of the total nodes

Gets the total number of nodes of the graph

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph to be analysed

Returns: int

A float of the total nodes

DiGraph.createFromEdges edges

Full Usage: DiGraph.createFromEdges edges

Parameters:
    edges : ('NodeKey * 'NodeKey * 'EdgeData)[] - An array of edges. Each edge is a three part tuple of origin node, the destination node, and any edge label such as the weight

Returns: DiGraph<'NodeKey, 'NodeKey, 'EdgeData> A graph containing the nodes

Builds a graph from a list of edges. This is a shorthand graph generation method where NodeData is assumed to be of the same type as NodeKey.

edges : ('NodeKey * 'NodeKey * 'EdgeData)[]

An array of edges. Each edge is a three part tuple of origin node, the destination node, and any edge label such as the weight

Returns: DiGraph<'NodeKey, 'NodeKey, 'EdgeData>

A graph containing the nodes

DiGraph.createFromNodes nodes

Full Usage: DiGraph.createFromNodes nodes

Parameters:
    nodes : ('NodeKey * 'NodeData)[] - An array of nodes. The type of the nodes will strongly type the created graph to use that type for all nodes.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> A graph containing the nodes

Builds a graph from a list of nodes. The edges will then need to be added

nodes : ('NodeKey * 'NodeData)[]

An array of nodes. The type of the nodes will strongly type the created graph to use that type for all nodes.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

A graph containing the nodes

DiGraph.find origin destination graph

Full Usage: DiGraph.find origin destination graph

Parameters:
    origin : 'NodeKey - The starting node of the edge
    destination : 'NodeKey - The target node of the edge
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph to find the edge in

Returns: 'NodeKey * 'NodeKey * 'EdgeData A edge as a three part tuple of origin node, the destination node, and any edge label such as the weight.

Tries to find an edge between the specified nodes. Raises KeyNotFoundException if no such edge exists in the graph.

origin : 'NodeKey

The starting node of the edge

destination : 'NodeKey

The target node of the edge

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph to find the edge in

Returns: 'NodeKey * 'NodeKey * 'EdgeData

A edge as a three part tuple of origin node, the destination node, and any edge label such as the weight.

DiGraph.getAllEdges graph

Full Usage: DiGraph.getAllEdges graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the edges are present in

Returns: ('NodeKey * 'NodeKey * 'EdgeData)[] An array of origin, destination nodes and the corresponding 'EdgeData tuples.

Returns the all outbound edges in the graph

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the edges are present in

Returns: ('NodeKey * 'NodeKey * 'EdgeData)[]

An array of origin, destination nodes and the corresponding 'EdgeData tuples.

DiGraph.getInEdges destination graph

Full Usage: DiGraph.getInEdges destination graph

Parameters:
    destination : 'NodeKey
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the node is present in

Returns: ('NodeKey * 'EdgeData)[] An array of target nodes and the corresponding 'EdgeData.

Returns the outbound edges for given node

destination : 'NodeKey
graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the node is present in

Returns: ('NodeKey * 'EdgeData)[]

An array of target nodes and the corresponding 'EdgeData.

DiGraph.getNodes graph

Full Usage: DiGraph.getNodes graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph to be analysed

Returns: 'NodeKey[] An array of nodes

Returns all nodes in te graph

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph to be analysed

Returns: 'NodeKey[]

An array of nodes

DiGraph.getOutEdges origin graph

Full Usage: DiGraph.getOutEdges origin graph

Parameters:
    origin : 'NodeKey - The node from which the edges start
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the node is present in

Returns: ('NodeKey * 'EdgeData)[] An array of target nodes and the corresponding 'EdgeData.

Returns the outbound edges for given node

origin : 'NodeKey

The node from which the edges start

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the node is present in

Returns: ('NodeKey * 'EdgeData)[]

An array of target nodes and the corresponding 'EdgeData.

DiGraph.normalizeOutEdges graph

Full Usage: DiGraph.normalizeOutEdges graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, float> - The graph to perform the operation on

Returns: DiGraph<'NodeKey, 'NodeData, float> Unit

Normalises the weights of outbound edges from each node in a graph. The function assumes that the edge data type of the graph will be float.

graph : DiGraph<'NodeKey, 'NodeData, float>

The graph to perform the operation on

Returns: DiGraph<'NodeKey, 'NodeData, float>

Unit

DiGraph.ofSeq edgelist

Full Usage: DiGraph.ofSeq edgelist

Parameters:
    edgelist : seq<'NodeKey * 'NodeData * 'NodeKey * 'NodeData * 'EdgeData>

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>
edgelist : seq<'NodeKey * 'NodeData * 'NodeKey * 'NodeData * 'EdgeData>
Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

DiGraph.removeEdge edge graph

Full Usage: DiGraph.removeEdge edge graph

Parameters:
    edge : 'NodeKey * 'NodeKey - The edge to be removed. A two part tuple containing the origin node, the destination node.
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the edge will be removed from.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> Unit

Removes an edge to the graph.

edge : 'NodeKey * 'NodeKey

The edge to be removed. A two part tuple containing the origin node, the destination node.

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the edge will be removed from.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Unit

DiGraph.removeNode node graph

Full Usage: DiGraph.removeNode node graph

Parameters:
    node : 'NodeKey - The node to be removed.
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData> - The graph the edge will be removed from.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData> Unit

Removes a node from the graph

node : 'NodeKey

The node to be removed.

graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

The graph the edge will be removed from.

Returns: DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Unit

DiGraph.toAdjacencyMatrix getEdgeWeight graph

Full Usage: DiGraph.toAdjacencyMatrix getEdgeWeight graph

Parameters:
    getEdgeWeight : 'EdgeData -> float
    graph : DiGraph<'NodeKey, 'a, 'EdgeData> - The graph to be converted

Returns: float[][] An adjacency matrix

Converts the Graph to an Adjacency Matrix This is preliminary step in many graph algorithms such as Floyd-Warshall. The operation assumes edge data types of float in the graph.

getEdgeWeight : 'EdgeData -> float
graph : DiGraph<'NodeKey, 'a, 'EdgeData>

The graph to be converted

Returns: float[][]

An adjacency matrix

DiGraph.toSeq graph

Full Usage: DiGraph.toSeq graph

Parameters:
    graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>

Returns: seq<'NodeKey * 'NodeKey * 'NodeKey * 'NodeKey * 'EdgeData>
graph : DiGraph<'NodeKey, 'NodeData, 'EdgeData>
Returns: seq<'NodeKey * 'NodeKey * 'NodeKey * 'NodeKey * 'EdgeData>