FSharpAux


Graph

Namespace: FSharpAux

Nested types and modules

TypeDescription
Adjacency<'Tedge, 'Tkey>

Alias for a list of edges

AdjacencyGraph<'Tnode, 'Tedge, 'Tkey>

A Graph is a Vertex list. The nextNode allows for consistent addressing of nodes

AdjacencyNode<'Tnode, 'Tedge, 'Tkey>

Alias for a single node with its edges

IEdge<'Tkey>

Interface needs to be implemented by every edge (connection; link; line; arc) in a graph

INode<'Tkey>

Interface needs to be implemented by every node (vertex; point) in a graph

Functions and values

Function or valueDescription
addAdjacencyNode(arg1, arg2) g
Signature: ('Tnode * Adjacency<'Tedge,'Tkey>) -> g:AdjacencyGraph<'Tnode,'Tedge,'Tkey> -> AdjacencyNode<'Tnode,'Tedge,'Tkey> list
Type parameters: 'Tnode, 'Tkey, 'Tedge

Add a new adjacency node

addEdge e g
Signature: e:'Tedge -> g:AdjacencyGraph<'Tnode,'Tedge,'Tkey> -> AdjacencyGraph<'Tnode,'Tedge,'Tkey>
Type parameters: 'Tedge, 'Tkey, 'Tnode

Add a new Edge

getAdjacencyNode v g
Signature: v:'?9105 -> g:AdjacencyGraph<'?9106,'?9107,'?9105> -> AdjacencyNode<'?9106,'?9107,'?9105>
Type parameters: '?9105, '?9106, '?9107

Getting a node and its edges from a graph by id

getEdgesFromAdjacencyNode(arg1, arg2)
Signature: (INode<'?9094> * Adjacency<'?9095,'?9094>) -> Adjacency<'?9095,'?9094>
Type parameters: '?9094, '?9095

Gets node from adjacencyNode

getNodeFromAdjacencyNode(arg1, arg2)
Signature: ('?9090 * Adjacency<'?9092,'?9091>) -> '?9090
Type parameters: '?9090, '?9091, '?9092

Gets node from adjacencyNode

nodeId(arg1, arg2)
Signature: ('Tnode * Adjacency<'Tedge,'Tkey>) -> 'Tkey
Type parameters: 'Tnode, 'Tkey, 'Tedge
removeEdge eId g
Signature: eId:'Tkey -> g:AdjacencyGraph<'Tnode,'Tedge,'Tkey> -> AdjacencyGraph<'Tnode,'Tedge,'Tkey>
Type parameters: 'Tkey, 'Tnode, 'Tedge

Removes an edge from a graph by id

removeVertex nodeId g
Signature: nodeId:'Tkey -> g:AdjacencyGraph<'Tnode,'Tedge,'Tkey> -> AdjacencyGraph<'Tnode,'Tedge,'Tkey>
Type parameters: 'Tkey, 'Tnode, 'Tedge

Removes a node from a graph by id and removes any related edges

tryGetAdjacencyNode v g
Signature: v:'?9101 -> g:AdjacencyGraph<'?9102,'?9103,'?9101> -> AdjacencyNode<'?9102,'?9103,'?9101> option
Type parameters: '?9101, '?9102, '?9103

Tries to get a node and its edges from a graph by id

tryGetEdges v g
Signature: v:'Tkey -> g:AdjacencyGraph<'?9114,'?9115,'Tkey> -> Adjacency<'?9115,'Tkey> option
Type parameters: 'Tkey, '?9114, '?9115

Getting all edges (adjacency) from a graph by a vertex id

tryGetNodeById v g
Signature: v:'?9109 -> g:AdjacencyGraph<'?9110,'?9111,'?9109> -> '?9110 option
Type parameters: '?9109, '?9110, '?9111

Tries to get a node from a graph by id

Fork me on GitHub