Skip to content

avestura/fsharp-closeness-centrality-bfs

Repository files navigation

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:

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

cd challenge
dotnet run

About

Calculate closeness centrality of graph using functional BFS

Topics

Resources

Stars

Watchers

Forks

Languages