https://github.com/avestura/fsharp-closeness-centrality-bfs
Calculate closeness centrality of graph using functional BFS
https://github.com/avestura/fsharp-closeness-centrality-bfs
bfs closeness-centrality complex-networks dotnet fsharp graph
Last synced: 7 months ago
JSON representation
Calculate closeness centrality of graph using functional BFS
- Host: GitHub
- URL: https://github.com/avestura/fsharp-closeness-centrality-bfs
- Owner: avestura
- Created: 2020-05-11T20:10:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T20:11:23.000Z (over 5 years ago)
- Last Synced: 2025-01-13T17:32:40.486Z (9 months ago)
- Topics: bfs, closeness-centrality, complex-networks, dotnet, fsharp, graph
- Language: F#
- Homepage:
- Size: 240 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# F# Closeness Centrality of graph using BFS
This is a sample F# source code that calculates closeness centrality of a graph using BFS
Two graph examples are provided in source code, one for `Programming Challenge-CN-Data.txt` which has 22963 nodes, called `graphOfQuestion`, and a simpler one with 6 nodes called `sampleGraph`
### Code Sample:
```fsharp
printfn "Closeness centrlity: %A" (closeness 0 graphOfQuestion)
(* Closeness centrlity: 2.710360145 *)
```### Prerequesties
- .NET Core 3 (F# compiler and all tools are bundled with dotnet)
### Run
```powershell
cd challenge
dotnet run
```