UndirectedGraph Type

Constructors

Constructor Description

UndirectedGraph()

Full Usage: UndirectedGraph()

Returns: UndirectedGraph
Returns: UndirectedGraph

Static members

Static member Description

UndirectedGraph.addEdge edge graph

Full Usage: UndirectedGraph.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 : UndirectedGraph<'NodeKey, 'EdgeData> - The graph the edge will be added to.

Returns: UndirectedGraph<'NodeKey, '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 : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the edge will be added to.

Returns: UndirectedGraph<'NodeKey, 'EdgeData>

Unit

UndirectedGraph.addEdges edges graph

Full Usage: UndirectedGraph.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 : UndirectedGraph<'NodeKey, 'EdgeData> - The graph to add the edge to

Returns: UndirectedGraph<'NodeKey, '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 : UndirectedGraph<'NodeKey, 'EdgeData>

The graph to add the edge to

Returns: UndirectedGraph<'NodeKey, 'EdgeData>

Unit

UndirectedGraph.addElement nk1 nd1 nk2 nd2 ed g

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

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

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

UndirectedGraph.addNode node graph

Full Usage: UndirectedGraph.addNode node graph

Parameters:
    node : 'NodeKey - The node to be created. The type must match the node type of the graph.
    graph : UndirectedGraph<'NodeKey, 'EdgeData> - The graph the node will be added to.

Returns: UndirectedGraph<'NodeKey, 'EdgeData> Unit

Adds a new node to the graph

node : 'NodeKey

The node to be created. The type must match the node type of the graph.

graph : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the node will be added to.

Returns: UndirectedGraph<'NodeKey, 'EdgeData>

Unit

UndirectedGraph.addNodes nodes graph

Full Usage: UndirectedGraph.addNodes nodes graph

Parameters:
Returns: UndirectedGraph<'NodeKey, 'EdgeData>
nodes : 'NodeKey[]
graph : UndirectedGraph<'NodeKey, 'EdgeData>
Returns: UndirectedGraph<'NodeKey, 'EdgeData>

UndirectedGraph.create (nodes, edges)

Full Usage: UndirectedGraph.create (nodes, edges)

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

Returns: UndirectedGraph<'NodeKey, 'EdgeData>
nodes : 'NodeKey[]
edges : ('NodeKey * 'NodeKey * 'EdgeData)[]
Returns: UndirectedGraph<'NodeKey, 'EdgeData>

UndirectedGraph.createFromEdges edges

Full Usage: UndirectedGraph.createFromEdges edges

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

Returns: UndirectedGraph<'NodeKey, 'EdgeData>
edges : ('NodeKey * 'NodeKey * 'EdgeData)[]
Returns: UndirectedGraph<'NodeKey, 'EdgeData>

UndirectedGraph.createFromNodes nodes

Full Usage: UndirectedGraph.createFromNodes nodes

Parameters:
    nodes : 'NodeKey[]

Returns: UndirectedGraph<'NodeKey, 'EdgeData>
nodes : 'NodeKey[]
Returns: UndirectedGraph<'NodeKey, 'EdgeData>

UndirectedGraph.find origin destination graph

Full Usage: UndirectedGraph.find origin destination graph

Parameters:
    origin : 'NodeKey - The starting node of the edge
    destination : 'NodeKey - The target node of the edge
    graph : UndirectedGraph<'NodeKey, '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 : UndirectedGraph<'NodeKey, '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.

UndirectedGraph.getAllEdges graph

Full Usage: UndirectedGraph.getAllEdges graph

Parameters:
    graph : UndirectedGraph<'NodeKey, '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 edges in the graph

graph : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the edges are present in

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

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

UndirectedGraph.getEdges origin graph

Full Usage: UndirectedGraph.getEdges origin graph

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

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

Returns the edges for given node

origin : 'NodeKey

The node from which the edges start

graph : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the node is present in

Returns: ('NodeKey * 'EdgeData)[]

An array of target nodes and the corresponding 'EdgeData.

UndirectedGraph.getNodes graph

Full Usage: UndirectedGraph.getNodes graph

Parameters:
Returns: 'NodeKey[] An array of nodes

Returns all nodes in te graph

graph : UndirectedGraph<'NodeKey, 'EdgeData>

The graph to be analysed

Returns: 'NodeKey[]

An array of nodes

UndirectedGraph.normalizeEdges graph

Full Usage: UndirectedGraph.normalizeEdges graph

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

Returns: UndirectedGraph<'NodeKey, float> Unit

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

graph : UndirectedGraph<'NodeKey, float>

The graph to perform the operation on

Returns: UndirectedGraph<'NodeKey, float>

Unit

UndirectedGraph.ofSeq edgelist

Full Usage: UndirectedGraph.ofSeq edgelist

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

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

UndirectedGraph.removeEdge edge graph

Full Usage: UndirectedGraph.removeEdge edge graph

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

Returns: UndirectedGraph<'NodeKey, '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 : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the edge will be removed from.

Returns: UndirectedGraph<'NodeKey, 'EdgeData>

Unit

UndirectedGraph.removeNode node graph

Full Usage: UndirectedGraph.removeNode node graph

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

Returns: UndirectedGraph<'NodeKey, 'EdgeData> Unit

Removes a node from the graph

node : 'NodeKey

The node to be removed.

graph : UndirectedGraph<'NodeKey, 'EdgeData>

The graph the edge will be removed from.

Returns: UndirectedGraph<'NodeKey, 'EdgeData>

Unit

UndirectedGraph.toSeq graph

Full Usage: UndirectedGraph.toSeq graph

Parameters:
Returns: seq<'NodeKey * 'NodeKey * 'NodeKey * 'NodeKey * 'EdgeData>
graph : UndirectedGraph<'NodeKey, 'EdgeData>
Returns: seq<'NodeKey * 'NodeKey * 'NodeKey * 'NodeKey * 'EdgeData>