Skip to content

Instantly share code, notes, and snippets.

@HarryMcCarney
Created April 11, 2023 21:25
Show Gist options
  • Save HarryMcCarney/dae3568b61dcb23d33d6c2050c0e6ab7 to your computer and use it in GitHub Desktop.
Save HarryMcCarney/dae3568b61dcb23d33d6c2050c0e6ab7 to your computer and use it in GitHub Desktop.
#r "nuget: FSharp.FGL, 0.0.4"
#r "nuget: FSharp.FGL.ArrayAdjacencyGraph"
open FSharp.FGL
open FSharp.FGL.ArrayAdjacencyGraph
let vertices =
[ for i=01 to 3 do (i,i) ]
let edges =
[
1,2,1.0
2,3,1.0
]
let graph = ArrayAdjacencyGraph(vertices,edges)
// returns Some
graph.TryGetEdge (1,2)
// returns None - in an undirected graph the order of params shouldnt matter.
graph.TryGetEdge (2,1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment