FSharp.FGL

FSharp.FGL is a functional library to work with graphs.

Example

This example demonstrates using a function defined in this sample library.

#r "FSharp.FGL.dll"

open FSharp.FGL 

Graph.empty
|> Vertices.addMany [(1,"Look At Me Im VertexOne");(2,"Look At Me Im VertexTwo")]
|> Undirected.Edges.add (1,2,"Im An Edge Between VertexOne And VertexTwo ")
|> Undirected.Edges.tryFind 1 2
//Returns Some (1,2,"Im An Edge Between VertexOne And VertexTwo ")

Overview

At the moment there are 2 different graph representations available, each with teir own functions:

  • FSharp.FGL, an inductive graph model that consists of so called contexts.
  • ArrayAdjacencyGraph, an adjacency list representation of a multigraph.

Samples & documentation

The library comes with comprehensible documentation. It can include tutorials automatically generated from *.fsx files in the content folder. The API reference is automatically generated from comments in the library implementation.

  • Tutorial contains a further explanation of this sample library.

  • API Reference contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into a documentation. You might also want to read the library design notes to understand how it works.

The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

Multiple items
Namespace FSharp

--------------------
Namespace Microsoft.FSharp
Namespace FSharp.FGL
Multiple items
Modul Graph

aus FSharp.FGL

--------------------
type Graph<'Vertex,'Label,'Edge (requires comparison)> = Map<'Vertex,MContext<'Vertex,'Label,'Edge>>
val empty : Graph<'Vertex,'Label,'Edge> (requires comparison)
Modul Vertices

aus FSharp.FGL
val addMany : vertices:LVertex<'Vertex,'Label> list -> g:Graph<'Vertex,'Label,'Edge> -> Graph<'Vertex,'Label,'Edge> (requires comparison)
Namespace FSharp.FGL.Undirected
Modul Edges

aus FSharp.FGL.Undirected
val add : 'Vertex * 'Vertex * 'Edge -> g:Graph<'Vertex,'Label,'Edge> -> Graph<'Vertex,'Label,'Edge> (requires comparison)
val tryFind : v1:'Vertex -> v2:'Vertex -> g:Graph<'Vertex,'Label,'Edge> -> LEdge<'Vertex,'Edge> option (requires comparison)