Created
April 11, 2023 21:25
-
-
Save HarryMcCarney/dae3568b61dcb23d33d6c2050c0e6ab7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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